Port more strings to translation keys (#11474)
* Port composer formatting strings to translation keys ``` replace "Bold" "composer|format_bold" replace "Italic" "composer|format_italic" replace "Underline" "composer|format_underline" replace "Strikethrough" "composer|format_strikethrough" replace "Bulleted list" "composer|format_unordered_list" replace "Numbered list" "composer|format_ordered_list" replace "Indent increase" "composer|format_increase_indent" replace "Indent decrease" "composer|format_decrease_indent" replace "Code" "composer|format_inline_code" replace "Code block" "composer|format_code_block" replace "Link" "composer|format_link" copy "composer|format_bold" "Bold" copy "composer|format_link" "Link" copy "composer|format_inline_code" "Code" ``` * Port role strings to translation keys ``` copy "Default" "power_level|default" copy "Restricted" "power_level|restricted" copy "Moderator" "power_level|moderator" copy "Admin" "power_level|admin" ``` * Port bug reporting strings to translation keys ``` replace "If you've submitted a bug via GitHub, debug logs can help us track down the problem. " "bug_reporting|introduction" replace "Debug logs contain application usage data including your username, the IDs or aliases of the rooms you have visited, which UI elements you last interacted with, and the usernames of other users. They do not contain messages." "bug_reporting|description" copy "To report a Matrix-related security issue, please read the Matrix.org <a>Security Disclosure Policy</a>." "bug_reporting|matrix_security_issue" replace "Submit debug logs" "bug_reporting|submit_debug_logs" replace "Bug reporting" "bug_reporting|title" replace "If there is additional context that would help in analysing the issue, such as what you were doing at the time, room IDs, user IDs, etc., please include those things here." "bug_reporting|additional_context" replace "Send logs" "bug_reporting|send_logs" replace "GitHub issue" "bug_reporting|github_issue" replace "Download logs" "bug_reporting|download_logs" copy "Before submitting logs, you must <a>create a GitHub issue</a> to describe your problem." "bug_reporting|before_submitting" ``` * i18n * Port time duration strings to translation keys ``` replace "%(hours)sh %(minutes)sm %(seconds)ss left" "time|hours_minutes_seconds_left" replace "%(minutes)sm %(seconds)ss left" "time|minutes_seconds_left" replace "%(seconds)ss left" "time|seconds_left" replace "%(date)s at %(time)s" "time|date_at_time" replace "%(value)sd" "time|short_days" replace "%(value)sh" "time|short_hours" replace "%(value)sm" "time|short_minutes" replace "%(value)ss" "time|short_seconds" replace "%(days)sd %(hours)sh %(minutes)sm %(seconds)ss" "time|short_days_hours_minutes_seconds" replace "%(hours)sh %(minutes)sm %(seconds)ss" "time|short_hours_minutes_seconds" replace "%(minutes)sm %(seconds)ss" "time|short_minutes_seconds" ``` * i18n
This commit is contained in:
parent
2bc129b848
commit
9329b896b3
65 changed files with 1786 additions and 1043 deletions
|
@ -212,7 +212,7 @@ export function formatTimeLeft(inSeconds: number): string {
|
|||
const seconds = Math.floor((inSeconds % (60 * 60)) % 60).toFixed(0);
|
||||
|
||||
if (hours !== "0") {
|
||||
return _t("%(hours)sh %(minutes)sm %(seconds)ss left", {
|
||||
return _t("time|hours_minutes_seconds_left", {
|
||||
hours,
|
||||
minutes,
|
||||
seconds,
|
||||
|
@ -220,13 +220,13 @@ export function formatTimeLeft(inSeconds: number): string {
|
|||
}
|
||||
|
||||
if (minutes !== "0") {
|
||||
return _t("%(minutes)sm %(seconds)ss left", {
|
||||
return _t("time|minutes_seconds_left", {
|
||||
minutes,
|
||||
seconds,
|
||||
});
|
||||
}
|
||||
|
||||
return _t("%(seconds)ss left", {
|
||||
return _t("time|seconds_left", {
|
||||
seconds,
|
||||
});
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ export function wantsDateSeparator(prevEventDate: Optional<Date>, nextEventDate:
|
|||
|
||||
export function formatFullDateNoDay(date: Date): string {
|
||||
const locale = getUserLanguage();
|
||||
return _t("%(date)s at %(time)s", {
|
||||
return _t("time|date_at_time", {
|
||||
date: date.toLocaleDateString(locale).replace(/\//g, "-"),
|
||||
time: date.toLocaleTimeString(locale).replace(/:/g, "-"),
|
||||
});
|
||||
|
@ -311,15 +311,15 @@ export function formatRelativeTime(date: Date, showTwelveHour = false): string {
|
|||
*/
|
||||
export function formatDuration(durationMs: number): string {
|
||||
if (durationMs >= DAY_MS) {
|
||||
return _t("%(value)sd", { value: Math.round(durationMs / DAY_MS) });
|
||||
return _t("time|short_days", { value: Math.round(durationMs / DAY_MS) });
|
||||
}
|
||||
if (durationMs >= HOUR_MS) {
|
||||
return _t("%(value)sh", { value: Math.round(durationMs / HOUR_MS) });
|
||||
return _t("time|short_hours", { value: Math.round(durationMs / HOUR_MS) });
|
||||
}
|
||||
if (durationMs >= MINUTE_MS) {
|
||||
return _t("%(value)sm", { value: Math.round(durationMs / MINUTE_MS) });
|
||||
return _t("time|short_minutes", { value: Math.round(durationMs / MINUTE_MS) });
|
||||
}
|
||||
return _t("%(value)ss", { value: Math.round(durationMs / 1000) });
|
||||
return _t("time|short_seconds", { value: Math.round(durationMs / 1000) });
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -334,15 +334,15 @@ export function formatPreciseDuration(durationMs: number): string {
|
|||
const seconds = Math.floor((durationMs % MINUTE_MS) / 1000);
|
||||
|
||||
if (days > 0) {
|
||||
return _t("%(days)sd %(hours)sh %(minutes)sm %(seconds)ss", { days, hours, minutes, seconds });
|
||||
return _t("time|short_days_hours_minutes_seconds", { days, hours, minutes, seconds });
|
||||
}
|
||||
if (hours > 0) {
|
||||
return _t("%(hours)sh %(minutes)sm %(seconds)ss", { hours, minutes, seconds });
|
||||
return _t("time|short_hours_minutes_seconds", { hours, minutes, seconds });
|
||||
}
|
||||
if (minutes > 0) {
|
||||
return _t("%(minutes)sm %(seconds)ss", { minutes, seconds });
|
||||
return _t("time|short_minutes_seconds", { minutes, seconds });
|
||||
}
|
||||
return _t("%(value)ss", { value: seconds });
|
||||
return _t("time|short_seconds", { value: seconds });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue