diff --git a/src/DateUtils.ts b/src/DateUtils.ts index 78b390a4aa..f955299682 100644 --- a/src/DateUtils.ts +++ b/src/DateUtils.ts @@ -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, 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 }); } /** diff --git a/src/Roles.ts b/src/Roles.ts index aa6a369081..1ec2be004d 100644 --- a/src/Roles.ts +++ b/src/Roles.ts @@ -18,11 +18,11 @@ import { _t } from "./languageHandler"; export function levelRoleMap(usersDefault: number): Record { return { - undefined: _t("Default"), - 0: _t("Restricted"), - [usersDefault]: _t("Default"), - 50: _t("Moderator"), - 100: _t("Admin"), + undefined: _t("power_level|default"), + 0: _t("power_level|restricted"), + [usersDefault]: _t("power_level|default"), + 50: _t("power_level|moderator"), + 100: _t("power_level|admin"), }; } diff --git a/src/components/views/dialogs/BugReportDialog.tsx b/src/components/views/dialogs/BugReportDialog.tsx index 5a9af1dc3f..d2074c5cd4 100644 --- a/src/components/views/dialogs/BugReportDialog.tsx +++ b/src/components/views/dialogs/BugReportDialog.tsx @@ -217,20 +217,16 @@ export default class BugReportDialog extends React.Component {
{warning} -

- {_t( - "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.", - )} -

+

{_t("bug_reporting|description")}

{_t( - "Before submitting logs, you must create a GitHub issue to describe your problem.", + "bug_reporting|before_submitting", {}, { a: (sub) => ( @@ -248,7 +244,7 @@ export default class BugReportDialog extends React.Component {

- {_t("Download logs")} + {_t("bug_reporting|download_logs")} {this.state.downloadProgress && {this.state.downloadProgress} ...}
@@ -256,7 +252,7 @@ export default class BugReportDialog extends React.Component { { rows={5} onChange={this.onTextChange} value={this.state.text} - placeholder={_t( - "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.", - )} + placeholder={_t("bug_reporting|additional_context")} /> {progress} {error}
{ )}

- {_t( - "If you've submitted a bug via GitHub, debug logs can help us track down the problem. ", - )} - {_t( - "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.", - )} + {_t("bug_reporting|introduction")} +   + {_t("bug_reporting|description")}

- {_t("Submit debug logs")} + {_t("bug_reporting|submit_debug_logs")} ); diff --git a/src/components/views/rooms/MessageComposer.tsx b/src/components/views/rooms/MessageComposer.tsx index 7c7624f6e5..44c494765f 100644 --- a/src/components/views/rooms/MessageComposer.tsx +++ b/src/components/views/rooms/MessageComposer.tsx @@ -64,6 +64,7 @@ import { SdkContextClass } from "../../../contexts/SDKContext"; import { VoiceBroadcastInfoState } from "../../../voice-broadcast"; import { createCantStartVoiceMessageBroadcastDialog } from "../dialogs/CantStartVoiceMessageBroadcastDialog"; import { UIFeature } from "../../../settings/UIFeature"; +import { formatTimeLeft } from "../../../DateUtils"; let instanceCount = 0; @@ -569,11 +570,7 @@ export class MessageComposer extends React.Component { if (this.state.recordingTimeLeftSeconds) { const secondsLeft = Math.round(this.state.recordingTimeLeftSeconds); recordingTooltip = ( - + ); } diff --git a/src/components/views/rooms/MessageComposerFormatBar.tsx b/src/components/views/rooms/MessageComposerFormatBar.tsx index ac62b8a2d6..f57ce93904 100644 --- a/src/components/views/rooms/MessageComposerFormatBar.tsx +++ b/src/components/views/rooms/MessageComposerFormatBar.tsx @@ -54,7 +54,7 @@ export default class MessageComposerFormatBar extends React.PureComponent this.props.onAction(Formatting.Bold)} icon="Bold" shortcut={this.props.shortcuts.bold} @@ -68,13 +68,13 @@ export default class MessageComposerFormatBar extends React.PureComponent this.props.onAction(Formatting.Strikethrough)} icon="Strikethrough" visible={this.state.visible} /> this.props.onAction(Formatting.Code)} icon="Code" shortcut={this.props.shortcuts.code} diff --git a/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx b/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx index 0045b13ab2..bf0ad48cf5 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx @@ -93,47 +93,47 @@ export function FormattingButtons({ composer, actionStates }: FormattingButtonsP