From c54c2bbe331fba0bd35e8edd8f3dc0edca815ed0 Mon Sep 17 00:00:00 2001 From: Rye Date: Sat, 30 May 2026 00:22:32 +0200 Subject: [PATCH] implement localization for settings and experimental features --- public/locales/en.json | 25 +++++++++++++++++-- src/app/components/AccountDataEditor.tsx | 17 +++++++------ .../experimental/BandwithSavingEmojis.tsx | 7 +++--- .../settings/experimental/Experimental.tsx | 15 +++++------ .../experimental/MSC4268HistoryShare.tsx | 11 ++++---- 5 files changed, 50 insertions(+), 25 deletions(-) diff --git a/public/locales/en.json b/public/locales/en.json index 1a8a0483a..7ef9d0421 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -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" } } diff --git a/src/app/components/AccountDataEditor.tsx b/src/app/components/AccountDataEditor.tsx index 131ae7fab..953ccbfd6 100644 --- a/src/app/components/AccountDataEditor.tsx +++ b/src/app/components/AccountDataEditor.tsx @@ -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} > - Account Data + {t('DevTools.account_data')} } > - Save + {t('General.save')} @@ -166,7 +167,7 @@ function AccountDataEdit({ - JSON Content + {t('DevTools.json_content')} - Account Data + {t('DevTools.account_data')} - JSON Content + {t('DevTools.json_content')} } > - Developer Tools + {t('DevTools.developer_tools')} diff --git a/src/app/features/settings/experimental/BandwithSavingEmojis.tsx b/src/app/features/settings/experimental/BandwithSavingEmojis.tsx index 6240f2369..89f0a28f2 100644 --- a/src/app/features/settings/experimental/BandwithSavingEmojis.tsx +++ b/src/app/features/settings/experimental/BandwithSavingEmojis.tsx @@ -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 ( - Save Bandwidth for Sticker and Emoji Images + {t('Settings.save_bandwidth_for_sticker_and_emoji_images')} } diff --git a/src/app/features/settings/experimental/Experimental.tsx b/src/app/features/settings/experimental/Experimental.tsx index 330412185..c12456aad 100644 --- a/src/app/features/settings/experimental/Experimental.tsx +++ b/src/app/features/settings/experimental/Experimental.tsx @@ -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 ( - Personas (Per-Message Profiles) + {t('Settings.personas_per_message_profiles')} } @@ -40,7 +41,7 @@ type ExperimentalProps = { }; export function Experimental({ requestBack, requestClose }: Readonly) { return ( - + @@ -49,10 +50,10 @@ export function Experimental({ requestBack, requestClose }: Readonly - The features listed below may be unstable or incomplete,{' '} - use at your own risk. + {t('Settings.the_features_listed_below_may_be_unstable_or_incomplete')}{' '} + {t('Settings.use_at_your_own_risk')}.
- Please report any new issues potentially caused by these features! + {t('Settings.please_report_any_new_issues_potentially_caused_by_these_features')} } /> diff --git a/src/app/features/settings/experimental/MSC4268HistoryShare.tsx b/src/app/features/settings/experimental/MSC4268HistoryShare.tsx index 27c868d19..b130193d2 100644 --- a/src/app/features/settings/experimental/MSC4268HistoryShare.tsx +++ b/src/app/features/settings/experimental/MSC4268HistoryShare.tsx @@ -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 ( - Enable Sharing of Encrypted History + {t('Settings.enable_sharing_of_encrypted_history')} }