mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-30 05:42:44 -08:00
implement localization for General, KeyboardShortcuts, and Persona settings
This commit is contained in:
4 files changed
+81
-37
No files matched your search
+42
-1
@@ -104,7 +104,48 @@
|
||||
"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"
|
||||
"enable_sharehistory_command": "Enable /sharehistory command",
|
||||
"General": {
|
||||
"formatting": "Formatting",
|
||||
"month": "Month",
|
||||
"day_of_the_week": "Day of the Week",
|
||||
"day_of_the_week_sunday_0": "Day of the week (Sunday = 0)",
|
||||
"two_letter_day_name": "Two-letter day name",
|
||||
"short_day_name": "Short day name",
|
||||
"full_day_name": "Full day name",
|
||||
"day_of_the_month": "Day of the Month",
|
||||
"full_month_name": "Full month name",
|
||||
"short_month_name": "Short month name",
|
||||
"the_month": "The month",
|
||||
"two_digit_month": "Two-digit month",
|
||||
"four_digit_year": "Four-digit year",
|
||||
"two_digit_year": "Two-digit year"
|
||||
},
|
||||
"KeyboardShortcuts": {
|
||||
"jump_to_the_highest_priority_unread_room": "Jump to the highest-priority unread room",
|
||||
"go_to_next_unread_room_cycle": "Go to next unread room (cycle)",
|
||||
"go_to_previous_unread_room_cycle": "Go to previous unread room (cycle)",
|
||||
"undo_in_message_editor": "Undo in message editor",
|
||||
"redo_in_message_editor": "Redo in message editor",
|
||||
"bold": "Bold",
|
||||
"italic": "Italic",
|
||||
"underline": "Underline",
|
||||
"keyboard_shortcuts": "Keyboard Shortcuts",
|
||||
"close_keyboard_shortcuts": "Close keyboard shortcuts",
|
||||
"messages": "Messages",
|
||||
"navigation": "Navigation"
|
||||
},
|
||||
"Persona": {
|
||||
"limited_compatibility_with_pluralkit_like_functions": "Limited Compatibility with PluralKit-like functions",
|
||||
"enable_pk_commands": "Enable PK commands",
|
||||
"if_enabled_it_will_enable_a_few_pk_style_commands_currently_verry_limited": "If enabled, it will enable a few pk style commands, currently verry limited",
|
||||
"disable_pk_commands": "disable pk; commands",
|
||||
"enable_pks_commands": "enable pk; commands",
|
||||
"enable_shorthands": "Enable Shorthands",
|
||||
"if_enabled_you_can_use_shorthands_to_use_a_persona_for_one_message_only_eg": "If enabled, you can use shorthands to use a Persona for one message only (eg. '✨:test')",
|
||||
"disable_checking_typed_messages_for_shorthands": "disable checking typed messages for shorthands",
|
||||
"enable_checking_typed_messages_for_shorthands": "enable checking typed messages for shorthands"
|
||||
}
|
||||
},
|
||||
"General": {
|
||||
"continue": "Continue",
|
||||
|
||||
@@ -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 PKCompatSettings() {
|
||||
const [usePKCompat, setUsePKCompat] = useSetting(settingsAtom, 'pkCompat');
|
||||
@@ -11,7 +12,7 @@ export function PKCompatSettings() {
|
||||
|
||||
return (
|
||||
<Box direction="Column" gap="100">
|
||||
<Text size="L400">Limited Compatibility with PluralKit-like functions</Text>
|
||||
<Text size="L400">{t('Settings.Persona.limited_compatibility_with_pluralkit_like_functions')}</Text>
|
||||
<SequenceCard
|
||||
className={SequenceCardStyle}
|
||||
variant="SurfaceVariant"
|
||||
@@ -20,21 +21,21 @@ export function PKCompatSettings() {
|
||||
>
|
||||
<SettingTile
|
||||
focusId="enable-pk-commands"
|
||||
title="Enable PK commands"
|
||||
description="If enabled, it will enable a few pk style commands, currently verry limited"
|
||||
title={t('Settings.Persona.enable_pk_commands')}
|
||||
description={t('Settings.Persona.if_enabled_it_will_enable_a_few_pk_style_commands_currently_verry_limited')}
|
||||
after={
|
||||
<Switch
|
||||
variant="Primary"
|
||||
value={usePKCompat}
|
||||
onChange={setUsePKCompat}
|
||||
title={usePKCompat ? 'disable pk; commands' : 'enable pk; commands'}
|
||||
title={usePKCompat ? t('Settings.Persona.disable_pk_commands') : t('Settings.Persona.enable_pks_commands')}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<SettingTile
|
||||
focusId="enable-pk-shorthands"
|
||||
title="Enable Shorthands"
|
||||
description="If enabled, you can use shorthands to use a Persona for one message only (eg. '✨:test')"
|
||||
title={t('Settings.Persona.enable_shorthands')}
|
||||
description={t('Settings.Persona.if_enabled_you_can_use_shorthands_to_use_a_persona_for_one_message_only_eg')}
|
||||
after={
|
||||
<Switch
|
||||
variant="Primary"
|
||||
@@ -42,8 +43,8 @@ export function PKCompatSettings() {
|
||||
onChange={setUsePmpProxying}
|
||||
title={
|
||||
usePmpProxying
|
||||
? 'disable checking typed messages for shorthands'
|
||||
: 'enable checking typed messages for shorthands'
|
||||
? t('Settings.Persona.disable_checking_typed_messages_for_shorthands')
|
||||
: t('Settings.Persona.enable_checking_typed_messages_for_shorthands')
|
||||
}
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ import { isKeyHotkey } from 'is-hotkey';
|
||||
import { settingsSyncLastSyncedAtom, settingsSyncStatusAtom } from '$hooks/useSettingsSync';
|
||||
import { exportSettingsAsJson, importSettingsFromJson } from '$utils/settingsSync';
|
||||
import { SettingsSectionPage } from '../SettingsSectionPage';
|
||||
import { t } from 'i18next';
|
||||
|
||||
type DateHintProps = {
|
||||
hasChanges: boolean;
|
||||
@@ -75,26 +76,26 @@ function DateHint({ hasChanges, handleReset }: Readonly<DateHintProps>) {
|
||||
>
|
||||
<Menu style={{ maxHeight: '85vh', overflowY: 'auto' }}>
|
||||
<Header size="300" style={{ padding: `0 ${config.space.S200}` }}>
|
||||
<Text size="L400">Formatting</Text>
|
||||
<Text size="L400">{t('Settings.General.formatting')}</Text>
|
||||
</Header>
|
||||
|
||||
<Box direction="Column">
|
||||
<Box style={categoryPadding} direction="Column">
|
||||
<Header size="300">
|
||||
<Text size="L400">Year</Text>
|
||||
<Text size="L400">{t('Settings.General.year')}</Text>
|
||||
</Header>
|
||||
<Box direction="Column" tabIndex={0} gap="100">
|
||||
<Text size="T300">
|
||||
YY
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}
|
||||
Two-digit year
|
||||
{t('Settings.General.two_digit_year')}
|
||||
</Text>{' '}
|
||||
</Text>
|
||||
<Text size="T300">
|
||||
YYYY
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}Four-digit year
|
||||
{': '}{t('Settings.General.four_digit_year')}
|
||||
</Text>
|
||||
</Text>
|
||||
</Box>
|
||||
@@ -102,31 +103,31 @@ function DateHint({ hasChanges, handleReset }: Readonly<DateHintProps>) {
|
||||
|
||||
<Box style={categoryPadding} direction="Column">
|
||||
<Header size="300">
|
||||
<Text size="L400">Month</Text>
|
||||
<Text size="L400">{t('Settings.General.month')}</Text>
|
||||
</Header>
|
||||
<Box direction="Column" tabIndex={0} gap="100">
|
||||
<Text size="T300">
|
||||
M
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}The month
|
||||
{': '}{t('Settings.General.the_month')}
|
||||
</Text>
|
||||
</Text>
|
||||
<Text size="T300">
|
||||
MM
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}Two-digit month
|
||||
{': '}{t('Settings.General.two_digit_month')}
|
||||
</Text>{' '}
|
||||
</Text>
|
||||
<Text size="T300">
|
||||
MMM
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}Short month name
|
||||
{': '}{t('Settings.General.short_month_name')}
|
||||
</Text>
|
||||
</Text>
|
||||
<Text size="T300">
|
||||
MMMM
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}Full month name
|
||||
{': '}{t('Settings.General.full_month_name')}
|
||||
</Text>
|
||||
</Text>
|
||||
</Box>
|
||||
@@ -134,13 +135,13 @@ function DateHint({ hasChanges, handleReset }: Readonly<DateHintProps>) {
|
||||
|
||||
<Box style={categoryPadding} direction="Column">
|
||||
<Header size="300">
|
||||
<Text size="L400">Day of the Month</Text>
|
||||
<Text size="L400">{t('Settings.General.day_of_the_month')}</Text>
|
||||
</Header>
|
||||
<Box direction="Column" tabIndex={0} gap="100">
|
||||
<Text size="T300">
|
||||
D
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}Day of the month
|
||||
{': '}{t('Settings.General.day_of_the_month')}
|
||||
</Text>
|
||||
</Text>
|
||||
<Text size="T300">
|
||||
@@ -153,31 +154,31 @@ function DateHint({ hasChanges, handleReset }: Readonly<DateHintProps>) {
|
||||
</Box>
|
||||
<Box style={categoryPadding} direction="Column">
|
||||
<Header size="300">
|
||||
<Text size="L400">Day of the Week</Text>
|
||||
<Text size="L400">{t('Settings.General.day_of_the_week')}</Text>
|
||||
</Header>
|
||||
<Box direction="Column" tabIndex={0} gap="100">
|
||||
<Text size="T300">
|
||||
d
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}Day of the week (Sunday = 0)
|
||||
{': '}{t('Settings.General.day_of_the_week_sunday_0')}
|
||||
</Text>
|
||||
</Text>
|
||||
<Text size="T300">
|
||||
dd
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}Two-letter day name
|
||||
{': '}{t('Settings.General.two_letter_day_name')}
|
||||
</Text>
|
||||
</Text>
|
||||
<Text size="T300">
|
||||
ddd
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}Short day name
|
||||
{': '}{t('Settings.General.short_day_name')}
|
||||
</Text>
|
||||
</Text>
|
||||
<Text size="T300">
|
||||
dddd
|
||||
<Text as="span" size="Inherit" priority="300">
|
||||
{': '}Full day name
|
||||
{': '}{t('Settings.General.full_day_name')}
|
||||
</Text>
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import { Box, Scroll, Text, config } from 'folds';
|
||||
import { PageContent } from '$components/page';
|
||||
import { SettingsSectionPage } from '../SettingsSectionPage';
|
||||
import { t } from 'i18next';
|
||||
|
||||
type ShortcutEntry = {
|
||||
keys: string;
|
||||
@@ -29,21 +30,21 @@ function formatKey(key: string): string {
|
||||
|
||||
const SHORTCUT_CATEGORIES: ShortcutCategory[] = [
|
||||
{
|
||||
name: 'Navigation',
|
||||
name: t('Settings.KeyboardShortcuts.navigation'),
|
||||
shortcuts: [
|
||||
{ keys: 'Alt+N', description: 'Jump to the highest-priority unread room' },
|
||||
{ keys: 'Alt+Shift+Down', description: 'Go to next unread room (cycle)' },
|
||||
{ keys: 'Alt+Shift+Up', description: 'Go to previous unread room (cycle)' },
|
||||
{ keys: 'Alt+N', description: t('Settings.KeyboardShortcuts.jump_to_the_highest_priority_unread_room') },
|
||||
{ keys: 'Alt+Shift+Down', description: t('Settings.KeyboardShortcuts.go_to_next_unread_room_cycle') },
|
||||
{ keys: 'Alt+Shift+Up', description: t('Settings.KeyboardShortcuts.go_to_previous_unread_room_cycle') },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Messages',
|
||||
name: t('Settings.KeyboardShortcuts.messages'),
|
||||
shortcuts: [
|
||||
{ keys: 'Ctrl+Z / ⌘+Z', description: 'Undo in message editor' },
|
||||
{ keys: 'Ctrl+Shift+Z / ⌘+Shift+Z', description: 'Redo in message editor' },
|
||||
{ keys: 'Ctrl+B / ⌘+B', description: 'Bold' },
|
||||
{ keys: 'Ctrl+I / ⌘+I', description: 'Italic' },
|
||||
{ keys: 'Ctrl+U / ⌘+U', description: 'Underline' },
|
||||
{ keys: 'Ctrl+Z / ⌘+Z', description: t('Settings.KeyboardShortcuts.undo_in_message_editor') },
|
||||
{ keys: 'Ctrl+Shift+Z / ⌘+Shift+Z', description: t('Settings.KeyboardShortcuts.redo_in_message_editor') },
|
||||
{ keys: 'Ctrl+B / ⌘+B', description: t('Settings.KeyboardShortcuts.bold') },
|
||||
{ keys: 'Ctrl+I / ⌘+I', description: t('Settings.KeyboardShortcuts.italic') },
|
||||
{ keys: 'Ctrl+U / ⌘+U', description: t('Settings.KeyboardShortcuts.underline') },
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -112,9 +113,9 @@ type KeyboardShortcutsProps = {
|
||||
export function KeyboardShortcuts({ requestBack, requestClose }: KeyboardShortcutsProps) {
|
||||
return (
|
||||
<SettingsSectionPage
|
||||
title="Keyboard Shortcuts"
|
||||
title={t('Settings.KeyboardShortcuts.keyboard_shortcuts')}
|
||||
titleAs="h1"
|
||||
actionLabel="Close keyboard shortcuts"
|
||||
actionLabel={t('Settings.KeyboardShortcuts.close_keyboard_shortcuts')}
|
||||
requestBack={requestBack}
|
||||
requestClose={requestClose}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user