Migrate more strings to translation keys (#11613)
This commit is contained in:
parent
d46d4b3d04
commit
5cb8cbd893
111 changed files with 8214 additions and 6766 deletions
|
@ -46,7 +46,7 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class FontScalingPanel extends React.Component<IProps, IState> {
|
||||
private readonly MESSAGE_PREVIEW_TEXT = _t("Hey you. You're the best!");
|
||||
private readonly MESSAGE_PREVIEW_TEXT = _t("common|preview_message");
|
||||
|
||||
private unmounted = false;
|
||||
|
||||
|
@ -89,19 +89,19 @@ export default class FontScalingPanel extends React.Component<IProps, IState> {
|
|||
const max = FontWatcher.MAX_SIZE;
|
||||
|
||||
if (isNaN(parsedSize)) {
|
||||
return { valid: false, feedback: _t("Size must be a number") };
|
||||
return { valid: false, feedback: _t("settings|appearance|font_size_nan") };
|
||||
}
|
||||
|
||||
if (!(min <= parsedSize && parsedSize <= max)) {
|
||||
return {
|
||||
valid: false,
|
||||
feedback: _t("Custom font size can only be between %(min)s pt and %(max)s pt", { min, max }),
|
||||
feedback: _t("settings|appearance|font_size_limit", { min, max }),
|
||||
};
|
||||
}
|
||||
|
||||
SettingsStore.setValue("baseFontSizeV2", null, SettingLevel.DEVICE, parseInt(value!, 10));
|
||||
|
||||
return { valid: true, feedback: _t("Use between %(min)s pt and %(max)s pt", { min, max }) };
|
||||
return { valid: true, feedback: _t("settings|appearance|font_size_valid", { min, max }) };
|
||||
};
|
||||
|
||||
public render(): React.ReactNode {
|
||||
|
|
|
@ -60,7 +60,7 @@ export default class ImageSizePanel extends React.Component<IProps, IState> {
|
|||
checked={this.state.size === ImageSize.Normal}
|
||||
onChange={this.onSizeChange}
|
||||
>
|
||||
{_t("Default")}
|
||||
{_t("settings|appearance|image_size_default")}
|
||||
</StyledRadioButton>
|
||||
</label>
|
||||
<label>
|
||||
|
@ -71,7 +71,7 @@ export default class ImageSizePanel extends React.Component<IProps, IState> {
|
|||
checked={this.state.size === ImageSize.Large}
|
||||
onChange={this.onSizeChange}
|
||||
>
|
||||
{_t("Large")}
|
||||
{_t("settings|appearance|image_size_large")}
|
||||
</StyledRadioButton>
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
@ -184,8 +184,8 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
|
|||
const definitions: IDefinition<JoinRule>[] = [
|
||||
{
|
||||
value: JoinRule.Invite,
|
||||
label: _t("Private (invite only)"),
|
||||
description: _t("Only invited people can join."),
|
||||
label: _t("room_settings|security|join_rule_invite"),
|
||||
description: _t("room_settings|security|join_rule_invite_description"),
|
||||
checked:
|
||||
joinRule === JoinRule.Invite || (joinRule === JoinRule.Restricted && !restrictedAllowRoomIds?.length),
|
||||
},
|
||||
|
@ -194,7 +194,7 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
|
|||
label: _t("common|public"),
|
||||
description: (
|
||||
<>
|
||||
{_t("Anyone can find and join.")}
|
||||
{_t("room_settings|security|join_rule_public_description")}
|
||||
{aliasWarning}
|
||||
</>
|
||||
),
|
||||
|
|
|
@ -783,9 +783,9 @@ export default class Notifications extends React.PureComponent<IProps, IState> {
|
|||
}
|
||||
|
||||
const VectorStateToLabel = {
|
||||
[VectorState.On]: _t("On"),
|
||||
[VectorState.Off]: _t("Off"),
|
||||
[VectorState.Loud]: _t("Noisy"),
|
||||
[VectorState.On]: _t("common|on"),
|
||||
[VectorState.Off]: _t("common|off"),
|
||||
[VectorState.Loud]: _t("settings|notifications|noisy"),
|
||||
};
|
||||
|
||||
const makeRadio = (r: IVectorPushRule, s: VectorState): JSX.Element => (
|
||||
|
|
|
@ -243,7 +243,7 @@ export default class NotificationsSettingsTab extends React.Component<IProps, IS
|
|||
className: "mx_NotificationSettingsTab_noneEntry",
|
||||
label: (
|
||||
<>
|
||||
{_t("Off")}
|
||||
{_t("common|off")}
|
||||
<div className="mx_NotificationSettingsTab_microCopy">
|
||||
{_t("You won't get any notifications")}
|
||||
</div>
|
||||
|
|
|
@ -52,7 +52,7 @@ export default class AppearanceUserSettingsTab extends React.Component<IProps, I
|
|||
public static contextType = MatrixClientContext;
|
||||
public context!: React.ContextType<typeof MatrixClientContext>;
|
||||
|
||||
private readonly MESSAGE_PREVIEW_TEXT = _t("Hey you. You're the best!");
|
||||
private readonly MESSAGE_PREVIEW_TEXT = _t("common|preview_message");
|
||||
|
||||
private unmounted = false;
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ const KeyboardShortcutSection: React.FC<IKeyboardShortcutSectionProps> = ({ cate
|
|||
const KeyboardUserSettingsTab: React.FC = () => {
|
||||
return (
|
||||
<SettingsTab>
|
||||
<SettingsSection heading={_t("Keyboard")}>
|
||||
<SettingsSection heading={_t("settings|keyboard|title")}>
|
||||
{visibleCategories.map(([categoryName, category]) => {
|
||||
return (
|
||||
<KeyboardShortcutSection key={categoryName} categoryName={categoryName} category={category} />
|
||||
|
|
|
@ -275,7 +275,7 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||
description={_t(
|
||||
"Your personal ban list holds all the users/servers you personally don't want to see messages from. After ignoring your first user/server, a new room will show up in your room list named '%(myBanList)s' - stay in this room to keep the ban list in effect.",
|
||||
{
|
||||
myBanList: _t("My Ban List"),
|
||||
myBanList: _t("labs_mjolnir|room_name"),
|
||||
},
|
||||
)}
|
||||
>
|
||||
|
|
|
@ -147,7 +147,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
<SettingsTab data-testid="mx_PreferencesUserSettingsTab">
|
||||
<SettingsSection heading={_t("common|preferences")}>
|
||||
{roomListSettings.length > 0 && (
|
||||
<SettingsSubsection heading={_t("Room list")}>
|
||||
<SettingsSubsection heading={_t("settings|preferences|room_list_heading")}>
|
||||
{this.renderGroup(roomListSettings)}
|
||||
</SettingsSubsection>
|
||||
)}
|
||||
|
@ -157,9 +157,9 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
</SettingsSubsection>
|
||||
|
||||
<SettingsSubsection
|
||||
heading={_t("Keyboard shortcuts")}
|
||||
heading={_t("settings|preferences|keyboard_heading")}
|
||||
description={_t(
|
||||
"To view all keyboard shortcuts, <a>click here</a>.",
|
||||
"settings|preferences|keyboard_view_shortcuts_button",
|
||||
{},
|
||||
{
|
||||
a: (sub) => (
|
||||
|
@ -173,26 +173,26 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
{this.renderGroup(PreferencesUserSettingsTab.KEYBINDINGS_SETTINGS)}
|
||||
</SettingsSubsection>
|
||||
|
||||
<SettingsSubsection heading={_t("Displaying time")}>
|
||||
<SettingsSubsection heading={_t("settings|preferences|time_heading")}>
|
||||
{this.renderGroup(PreferencesUserSettingsTab.TIME_SETTINGS)}
|
||||
</SettingsSubsection>
|
||||
|
||||
<SettingsSubsection
|
||||
heading={_t("common|presence")}
|
||||
description={_t("Share your activity and status with others.")}
|
||||
description={_t("settings|preferences|presence_description")}
|
||||
>
|
||||
{this.renderGroup(PreferencesUserSettingsTab.PRESENCE_SETTINGS)}
|
||||
</SettingsSubsection>
|
||||
|
||||
<SettingsSubsection heading={_t("Composer")}>
|
||||
<SettingsSubsection heading={_t("settings|preferences|composer_heading")}>
|
||||
{this.renderGroup(PreferencesUserSettingsTab.COMPOSER_SETTINGS)}
|
||||
</SettingsSubsection>
|
||||
|
||||
<SettingsSubsection heading={_t("Code blocks")}>
|
||||
<SettingsSubsection heading={_t("settings|preferences|code_blocks_heading")}>
|
||||
{this.renderGroup(PreferencesUserSettingsTab.CODE_BLOCKS_SETTINGS)}
|
||||
</SettingsSubsection>
|
||||
|
||||
<SettingsSubsection heading={_t("Images, GIFs and videos")}>
|
||||
<SettingsSubsection heading={_t("settings|preferences|media_heading")}>
|
||||
{this.renderGroup(PreferencesUserSettingsTab.IMAGES_AND_VIDEOS_SETTINGS)}
|
||||
</SettingsSubsection>
|
||||
|
||||
|
@ -200,7 +200,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
{this.renderGroup(PreferencesUserSettingsTab.TIMELINE_SETTINGS)}
|
||||
</SettingsSubsection>
|
||||
|
||||
<SettingsSubsection heading={_t("Room directory")}>
|
||||
<SettingsSubsection heading={_t("settings|preferences|room_directory_heading")}>
|
||||
{this.renderGroup(PreferencesUserSettingsTab.ROOM_DIRECTORY_SETTINGS)}
|
||||
</SettingsSubsection>
|
||||
|
||||
|
@ -212,7 +212,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
name="Electron.enableHardwareAcceleration"
|
||||
level={SettingLevel.PLATFORM}
|
||||
hideIfCannotSet
|
||||
label={_t("Enable hardware acceleration (restart %(appName)s to take effect)", {
|
||||
label={_t("settings|preferences|Electron.enableHardwareAcceleration", {
|
||||
appName: SdkConfig.get().brand,
|
||||
})}
|
||||
/>
|
||||
|
@ -221,19 +221,19 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
<SettingsFlag name="Electron.warnBeforeExit" level={SettingLevel.PLATFORM} hideIfCannotSet />
|
||||
|
||||
<Field
|
||||
label={_t("Autocomplete delay (ms)")}
|
||||
label={_t("settings|preferences|autocomplete_delay")}
|
||||
type="number"
|
||||
value={this.state.autocompleteDelay}
|
||||
onChange={this.onAutocompleteDelayChange}
|
||||
/>
|
||||
<Field
|
||||
label={_t("Read Marker lifetime (ms)")}
|
||||
label={_t("settings|preferences|rm_lifetime")}
|
||||
type="number"
|
||||
value={this.state.readMarkerInViewThresholdMs}
|
||||
onChange={this.onReadMarkerInViewThresholdMs}
|
||||
/>
|
||||
<Field
|
||||
label={_t("Read Marker off-screen lifetime (ms)")}
|
||||
label={_t("settings|preferences|rm_lifetime_offscreen")}
|
||||
type="number"
|
||||
value={this.state.readMarkerOutOfViewThresholdMs}
|
||||
onChange={this.onReadMarkerOutOfViewThresholdMs}
|
||||
|
|
|
@ -208,7 +208,7 @@ export default class VoiceUserSettingsTab extends React.Component<{}, IState> {
|
|||
await MediaDeviceHandler.setAudioNoiseSuppression(v);
|
||||
this.setState({ audioNoiseSuppression: MediaDeviceHandler.getAudioNoiseSuppression() });
|
||||
}}
|
||||
label={_t("Noise suppression")}
|
||||
label={_t("settings|voip|noise_suppression")}
|
||||
data-testid="voice-noise-suppression"
|
||||
/>
|
||||
<LabelledToggleSwitch
|
||||
|
@ -217,7 +217,7 @@ export default class VoiceUserSettingsTab extends React.Component<{}, IState> {
|
|||
await MediaDeviceHandler.setAudioEchoCancellation(v);
|
||||
this.setState({ audioEchoCancellation: MediaDeviceHandler.getAudioEchoCancellation() });
|
||||
}}
|
||||
label={_t("Echo cancellation")}
|
||||
label={_t("settings|voip|echo_cancellation")}
|
||||
data-testid="voice-echo-cancellation"
|
||||
/>
|
||||
</SettingsSubsection>
|
||||
|
@ -229,7 +229,7 @@ export default class VoiceUserSettingsTab extends React.Component<{}, IState> {
|
|||
/>
|
||||
<SettingsFlag
|
||||
name="fallbackICEServerAllowed"
|
||||
label={_t("Allow fallback call assist server (%(server)s)", {
|
||||
label={_t("settings|voip|enable_fallback_ice_server", {
|
||||
server: new URL(FALLBACK_ICE_SERVER).pathname,
|
||||
})}
|
||||
level={SettingLevel.DEVICE}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue