Migrate more strings to translation keys (#11683)

This commit is contained in:
Michael Telatynski 2023-10-02 13:52:27 +01:00 committed by GitHub
parent 632d8f4bc7
commit 41a2325a2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
86 changed files with 4744 additions and 4051 deletions

View file

@ -81,7 +81,7 @@ export const PollDetail: React.FC<Props> = ({ poll, permalinkCreator, requestMod
onClick={onLinkClick}
rel="noreferrer noopener"
>
{_t("View poll in timeline")}
{_t("right_panel|poll|view_in_timeline")}
</AccessibleButton>
</div>
</>

View file

@ -30,7 +30,7 @@ export const PollDetailHeader: React.FC<Props> = ({ filter, onNavigateBack }) =>
return (
<AccessibleButton kind="content_inline" onClick={onNavigateBack} className="mx_PollDetailHeader">
<LeftCaretIcon className="mx_PollDetailHeader_icon" />
{filter === "ACTIVE" ? _t("Active polls") : _t("Past polls")}
{filter === "ACTIVE" ? _t("right_panel|poll|active_heading") : _t("right_panel|poll|past_heading")}
</AccessibleButton>
);
};

View file

@ -33,7 +33,7 @@ const LoadingPolls: React.FC<{ noResultsYet?: boolean }> = ({ noResultsYet }) =>
})}
>
<InlineSpinner />
{_t("Loading polls")}
{_t("right_panel|poll|loading")}
</div>
);
@ -44,7 +44,7 @@ const LoadMorePolls: React.FC<{ loadMorePolls?: () => void; isLoading?: boolean
kind="link_inline"
onClick={() => loadMorePolls()}
>
{_t("Load more polls")}
{_t("right_panel|poll|load_more")}
{isLoading && <InlineSpinner />}
</AccessibleButton>
) : null;
@ -56,25 +56,20 @@ const getNoResultsMessage = (
loadMorePolls?: () => void,
): string => {
if (!loadMorePolls) {
return filter === "ACTIVE"
? _t("There are no active polls in this room")
: _t("There are no past polls in this room");
return filter === "ACTIVE" ? _t("right_panel|poll|empty_active") : _t("right_panel|poll|empty_past");
}
// we don't know how much history has been fetched
if (!oldestEventTimestamp) {
return filter === "ACTIVE"
? _t("There are no active polls. Load more polls to view polls for previous months")
: _t("There are no past polls. Load more polls to view polls for previous months");
? _t("right_panel|poll|empty_active_load_more")
: _t("right_panel|poll|empty_past_load_more");
}
const fetchedHistoryDaysCount = Math.ceil((Date.now() - oldestEventTimestamp) / ONE_DAY_MS);
return filter === "ACTIVE"
? _t(
"There are no active polls for the past %(count)s days. Load more polls to view polls for previous months",
{ count: fetchedHistoryDaysCount },
)
: _t("There are no past polls for the past %(count)s days. Load more polls to view polls for previous months", {
? _t("right_panel|poll|empty_active_load_more_n_days", { count: fetchedHistoryDaysCount })
: _t("right_panel|poll|empty_past_load_more_n_days", {
count: fetchedHistoryDaysCount,
});
};

View file

@ -37,7 +37,7 @@ export const PollListItem: React.FC<Props> = ({ event, onClick }) => {
const formattedDate = formatLocalDateShort(event.getTs());
return (
<li data-testid={`pollListItem-${event.getId()!}`} className="mx_PollListItem" onClick={onClick}>
<TooltipTarget label={_t("View poll")} alignment={Alignment.Top}>
<TooltipTarget label={_t("right_panel|poll|view_poll")} alignment={Alignment.Top}>
<div className="mx_PollListItem_content">
<span>{formattedDate}</span>
<PollIcon className="mx_PollListItem_icon" />

View file

@ -100,7 +100,7 @@ export const PollListItemEnded: React.FC<Props> = ({ event, poll, onClick }) =>
return (
<li data-testid={`pollListItem-${event.getId()!}`} className="mx_PollListItemEnded" onClick={onClick}>
<TooltipTarget label={_t("View poll")} alignment={Alignment.Top}>
<TooltipTarget label={_t("right_panel|poll|view_poll")} alignment={Alignment.Top}>
<div className="mx_PollListItemEnded_content">
<div className="mx_PollListItemEnded_title">
<PollIcon className="mx_PollListItemEnded_icon" />
@ -124,7 +124,7 @@ export const PollListItemEnded: React.FC<Props> = ({ event, poll, onClick }) =>
</div>
)}
<div className="mx_PollListItemEnded_voteCount">
<Caption>{_t("Final result based on %(count)s votes", { count: totalVoteCount })}</Caption>
<Caption>{_t("right_panel|poll|final_result", { count: totalVoteCount })}</Caption>
</div>
</div>
</TooltipTarget>