Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions web/src/components/overview/UsersSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
*/

import React from "react";
import { sprintf } from "sprintf-js";
import { useProgressTracking } from "~/hooks/use-progress-tracking";
import { useConfig } from "~/hooks/model/config";
import { useIssues } from "~/hooks/model/issue";
import { USER } from "~/routes/paths";
import { _ } from "~/i18n";
import Summary from "~/components/core/Summary";
import Link from "~/components/core/Link";
import Text from "~/components/core/Text";
import { USER } from "~/routes/paths";
import { _ } from "~/i18n";

const rootConfigured = (config) => {
if (!config.root) return false;
Expand Down Expand Up @@ -59,11 +59,18 @@ const Value = () => {
if (root && !user) return _("Configured for the root user");

const userName = config.user.userName;
// TRANSLATORS: %s is a username like 'jdoe'
if (root) return sprintf(_("Configured for root and user '%s'"), userName);
const text = root
? // TRANSLATORS: %s is a username like 'jdoe'
_("Configured for root and user %s")
: // TRANSLATORS: %s is a username like 'jdoe'
_("Configured for user %s");
const [textStart, textEnd] = text.split("%s");

// TRANSLATORS: %s is a username like 'jdoe'
return sprintf(_("Configured for user '%s'"), userName);
return (
<>
{textStart} <Text isBold>{userName}</Text> {textEnd}
</>
);
};

/**
Expand Down