mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 09:01:17 -08:00
implement localization for settings and experimental features
This commit is contained in:
5 files changed
+50
-25
No files matched your search
+23
-2
@@ -89,7 +89,22 @@
|
||||
"selected_language_for_pronouns": "Selected language for pronouns",
|
||||
"the_language_to_show_pronouns_for_when_the_above_setting_is_enabled": "The language to show pronouns for when the above setting is enabled.",
|
||||
"language_code_e_g_en_de_en_de": "Language code (e.g. 'en', 'de', 'en,de')"
|
||||
}
|
||||
},
|
||||
"save_bandwidth_for_sticker_and_emoji_images": "Save Bandwidth for Sticker and Emoji Images",
|
||||
"enable_bandwidth_saving_for_stickers_and_emojis": "Enable bandwidth saving for stickers and emojis",
|
||||
"if_enabled_sticker_and_emoji_images_will_be_optimized_to_save_bandwidth_thi": "If enabled, sticker and emoji images will be optimized to save bandwidth. This helps reduce data usage when viewing these images. But will increase server computation load.",
|
||||
"personas_per_message_profiles": "Personas (Per-Message Profiles)",
|
||||
"show_personas_tab": "Show Personas Tab",
|
||||
"enables_the_personas_tab_in_the_settings_menu_for_per_message_profiles": "Enables the personas tab in the settings menu for per-message profiles",
|
||||
"experimental": "Experimental",
|
||||
"the_features_listed_below_may_be_unstable_or_incomplete": "The features listed below may be unstable or incomplete,",
|
||||
"use_at_your_own_risk": "use at your own risk",
|
||||
"please_report_any_new_issues_potentially_caused_by_these_features": "Please report any new issues potentially caused by these features!",
|
||||
"enable_sharing_of_encrypted_history": "Enable Sharing of Encrypted History",
|
||||
"enable_the_sharehistory_command": "Enable the /sharehistory command",
|
||||
"if_enabled_this_command_will_allow_users_to_share_encrypted_history_with_ot": "If enabled, this command will allow users to share encrypted history with other newly joined users, as per MSC4268.",
|
||||
"disable_sharehistory_command": "Disable /sharehistory command",
|
||||
"enable_sharehistory_command": "Enable /sharehistory command"
|
||||
},
|
||||
"General": {
|
||||
"continue": "Continue",
|
||||
@@ -120,7 +135,8 @@
|
||||
"upload_area": "Upload area",
|
||||
"display_name": "Display name",
|
||||
"pronouns": "Pronouns",
|
||||
"unknown": "Unknown"
|
||||
"unknown": "Unknown",
|
||||
"edit": "Edit"
|
||||
},
|
||||
"RoomView": {
|
||||
"failed_to_load_history": "Failed to load history.",
|
||||
@@ -214,5 +230,10 @@
|
||||
"invite_to_direct_message_anyway": "Invite to Direct Message anyway",
|
||||
"invite_another_member": "Invite another Member"
|
||||
}
|
||||
},
|
||||
"DevTools": {
|
||||
"json_content": "JSON Content",
|
||||
"account_data": "Account Data",
|
||||
"developer_tools": "Developer Tools"
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import { useTextAreaCodeEditor } from '$hooks/useTextAreaCodeEditor';
|
||||
import { Page, PageHeader } from './page';
|
||||
import { SequenceCard } from './sequence-card';
|
||||
import { TextViewerContent } from './text-viewer';
|
||||
import { t } from 'i18next';
|
||||
|
||||
const EDITOR_INTENT_SPACE_COUNT = 2;
|
||||
|
||||
@@ -122,7 +123,7 @@ function AccountDataEdit({
|
||||
aria-disabled={submitting}
|
||||
>
|
||||
<Box shrink="No" direction="Column" gap="100">
|
||||
<Text size="L400">Account Data</Text>
|
||||
<Text size="L400">{t('DevTools.account_data')}</Text>
|
||||
<Box gap="300">
|
||||
<Box grow="Yes" direction="Column">
|
||||
<Input
|
||||
@@ -143,7 +144,7 @@ function AccountDataEdit({
|
||||
disabled={submitting}
|
||||
before={submitting && <Spinner variant="Primary" fill="Solid" size="300" />}
|
||||
>
|
||||
<Text size="B400">Save</Text>
|
||||
<Text size="B400">{t('General.save')}</Text>
|
||||
</Button>
|
||||
<Button
|
||||
variant="Secondary"
|
||||
@@ -154,7 +155,7 @@ function AccountDataEdit({
|
||||
onClick={onCancel}
|
||||
disabled={submitting}
|
||||
>
|
||||
<Text size="B400">Cancel</Text>
|
||||
<Text size="B400">{t('General.cancel')}</Text>
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
@@ -166,7 +167,7 @@ function AccountDataEdit({
|
||||
</Box>
|
||||
<Box grow="Yes" direction="Column" gap="100">
|
||||
<Box shrink="No">
|
||||
<Text size="L400">JSON Content</Text>
|
||||
<Text size="L400">{t('DevTools.json_content')}</Text>
|
||||
</Box>
|
||||
<TextAreaComponent
|
||||
ref={textAreaRef}
|
||||
@@ -209,7 +210,7 @@ function AccountDataView({ type, defaultContent, onEdit }: AccountDataViewProps)
|
||||
>
|
||||
<Box shrink="No" gap="300" alignItems="End">
|
||||
<Box grow="Yes" direction="Column" gap="100">
|
||||
<Text size="L400">Account Data</Text>
|
||||
<Text size="L400">{t('DevTools.account_data')}</Text>
|
||||
<Input
|
||||
variant="SurfaceVariant"
|
||||
size="400"
|
||||
@@ -220,11 +221,11 @@ function AccountDataView({ type, defaultContent, onEdit }: AccountDataViewProps)
|
||||
/>
|
||||
</Box>
|
||||
<Button variant="Secondary" size="400" radii="300" onClick={onEdit}>
|
||||
<Text size="B400">Edit</Text>
|
||||
<Text size="B400">{t('General.edit')}</Text>
|
||||
</Button>
|
||||
</Box>
|
||||
<Box grow="Yes" direction="Column" gap="100">
|
||||
<Text size="L400">JSON Content</Text>
|
||||
<Text size="L400">{t('DevTools.json_content')}</Text>
|
||||
<SequenceCard variant="SurfaceVariant">
|
||||
<Scroll visibility="Always" size="300" hideTrack>
|
||||
<TextViewerContent
|
||||
@@ -291,7 +292,7 @@ export function AccountDataEditor({
|
||||
onClick={requestClose}
|
||||
before={<Icon size="100" src={Icons.ArrowLeft} />}
|
||||
>
|
||||
<Text size="T300">Developer Tools</Text>
|
||||
<Text size="T300">{t('DevTools.developer_tools')}</Text>
|
||||
</Chip>
|
||||
</Box>
|
||||
<Box shrink="No">
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useSetting } from '$state/hooks/settings';
|
||||
import { settingsAtom } from '$state/settings';
|
||||
import { Box, Switch, Text } from 'folds';
|
||||
import { SequenceCardStyle } from '../styles.css';
|
||||
import { t } from 'i18next';
|
||||
|
||||
export function BandwidthSavingEmojis() {
|
||||
const [useBandwidthSaving, setUseBandwidthSaving] = useSetting(
|
||||
@@ -13,7 +14,7 @@ export function BandwidthSavingEmojis() {
|
||||
|
||||
return (
|
||||
<Box direction="Column" gap="100">
|
||||
<Text size="L400">Save Bandwidth for Sticker and Emoji Images</Text>
|
||||
<Text size="L400">{t('Settings.save_bandwidth_for_sticker_and_emoji_images')}</Text>
|
||||
<SequenceCard
|
||||
className={SequenceCardStyle}
|
||||
variant="SurfaceVariant"
|
||||
@@ -21,9 +22,9 @@ export function BandwidthSavingEmojis() {
|
||||
gap="100"
|
||||
>
|
||||
<SettingTile
|
||||
title="Enable bandwidth saving for stickers and emojis"
|
||||
title={t('Settings.enable_bandwidth_saving_for_stickers_and_emojis')}
|
||||
focusId="bandwidth-saving-emojis"
|
||||
description="If enabled, sticker and emoji images will be optimized to save bandwidth. This helps reduce data usage when viewing these images. But will increase server computation load."
|
||||
description={t('Settings.if_enabled_sticker_and_emoji_images_will_be_optimized_to_save_bandwidth_thi')}
|
||||
after={
|
||||
<Switch variant="Primary" value={useBandwidthSaving} onChange={setUseBandwidthSaving} />
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { Sync } from '../general';
|
||||
import { SettingsSectionPage } from '../SettingsSectionPage';
|
||||
import { BandwidthSavingEmojis } from './BandwithSavingEmojis';
|
||||
import { MSC4268HistoryShare } from './MSC4268HistoryShare';
|
||||
import { t } from 'i18next';
|
||||
|
||||
function PersonaToggle() {
|
||||
const [showPersonaSetting, setShowPersonaSetting] = useSetting(
|
||||
@@ -19,12 +20,12 @@ function PersonaToggle() {
|
||||
|
||||
return (
|
||||
<Box direction="Column" gap="100">
|
||||
<Text size="L400">Personas (Per-Message Profiles)</Text>
|
||||
<Text size="L400">{t('Settings.personas_per_message_profiles')}</Text>
|
||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||
<SettingTile
|
||||
title="Show Personas Tab"
|
||||
title={t('Settings.show_personas_tab')}
|
||||
focusId="show-personas-tab"
|
||||
description="Enables the personas tab in the settings menu for per-message profiles"
|
||||
description={t('Settings.enables_the_personas_tab_in_the_settings_menu_for_per_message_profiles')}
|
||||
after={
|
||||
<Switch variant="Primary" value={showPersonaSetting} onChange={setShowPersonaSetting} />
|
||||
}
|
||||
@@ -40,7 +41,7 @@ type ExperimentalProps = {
|
||||
};
|
||||
export function Experimental({ requestBack, requestClose }: Readonly<ExperimentalProps>) {
|
||||
return (
|
||||
<SettingsSectionPage title="Experimental" requestBack={requestBack} requestClose={requestClose}>
|
||||
<SettingsSectionPage title={t('Settings.experimental')} requestBack={requestBack} requestClose={requestClose}>
|
||||
<Box grow="Yes">
|
||||
<Scroll hideTrack visibility="Hover">
|
||||
<PageContent>
|
||||
@@ -49,10 +50,10 @@ export function Experimental({ requestBack, requestClose }: Readonly<Experimenta
|
||||
variant="Warning"
|
||||
description={
|
||||
<>
|
||||
The features listed below may be unstable or incomplete,{' '}
|
||||
<strong>use at your own risk</strong>.
|
||||
{t('Settings.the_features_listed_below_may_be_unstable_or_incomplete')}{' '}
|
||||
<strong>{t('Settings.use_at_your_own_risk')}</strong>.
|
||||
<br />
|
||||
Please report any new issues potentially caused by these features!
|
||||
{t('Settings.please_report_any_new_issues_potentially_caused_by_these_features')}
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useSetting } from '$state/hooks/settings';
|
||||
import { settingsAtom } from '$state/settings';
|
||||
import { Box, Switch, Text } from 'folds';
|
||||
import { SequenceCardStyle } from '../styles.css';
|
||||
import { t } from 'i18next';
|
||||
|
||||
export function MSC4268HistoryShare() {
|
||||
const [enabledMSC4268Command, setEnabledMSC4268Command] = useSetting(
|
||||
@@ -13,7 +14,7 @@ export function MSC4268HistoryShare() {
|
||||
|
||||
return (
|
||||
<Box direction="Column" gap="100">
|
||||
<Text size="L400">Enable Sharing of Encrypted History</Text>
|
||||
<Text size="L400">{t('Settings.enable_sharing_of_encrypted_history')}</Text>
|
||||
<SequenceCard
|
||||
className={SequenceCardStyle}
|
||||
variant="SurfaceVariant"
|
||||
@@ -21,9 +22,9 @@ export function MSC4268HistoryShare() {
|
||||
gap="100"
|
||||
>
|
||||
<SettingTile
|
||||
title="Enable the /sharehistory command"
|
||||
title={t('Settings.enable_the_sharehistory_command')}
|
||||
focusId="sharehistory-command"
|
||||
description="If enabled, this command will allow users to share encrypted history with other newly joined users, as per MSC4268."
|
||||
description={t('Settings.if_enabled_this_command_will_allow_users_to_share_encrypted_history_with_ot')}
|
||||
after={
|
||||
<Switch
|
||||
variant="Primary"
|
||||
@@ -31,8 +32,8 @@ export function MSC4268HistoryShare() {
|
||||
onChange={setEnabledMSC4268Command}
|
||||
title={
|
||||
enabledMSC4268Command
|
||||
? 'Disable /sharehistory command'
|
||||
: 'Enable /sharehistory command'
|
||||
? t('Settings.disable_sharehistory_command')
|
||||
: t('Settings.enable_sharehistory_command')
|
||||
}
|
||||
/>
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user