|
|
@@ -91,6 +91,7 @@ const EDITORTHEME_LABEL_MAP: EditorThemeToLabel = {
|
|
|
|
|
|
const ThemeSelector = memo(({ onClickBefore }: {onClickBefore: () => void}): JSX.Element => {
|
|
|
|
|
|
+ const { t } = useTranslation();
|
|
|
const { data: editorSettings, update } = useEditorSettings();
|
|
|
const selectedTheme = editorSettings?.theme ?? DEFAULT_THEME;
|
|
|
|
|
|
@@ -106,7 +107,7 @@ const ThemeSelector = memo(({ onClickBefore }: {onClickBefore: () => void}): JSX
|
|
|
), [update, selectedTheme]);
|
|
|
|
|
|
return (
|
|
|
- <Selector header="Theme" onClickBefore={onClickBefore} items={listItems} />
|
|
|
+ <Selector header={t('page_edit.theme', 'Theme')} onClickBefore={onClickBefore} items={listItems} />
|
|
|
);
|
|
|
});
|
|
|
ThemeSelector.displayName = 'ThemeSelector';
|
|
|
@@ -125,6 +126,7 @@ const KEYMAP_LABEL_MAP: KeyMapModeToLabel = {
|
|
|
|
|
|
const KeymapSelector = memo(({ onClickBefore }: {onClickBefore: () => void}): JSX.Element => {
|
|
|
|
|
|
+ const { t } = useTranslation();
|
|
|
const { data: editorSettings, update } = useEditorSettings();
|
|
|
const selectedKeymapMode = editorSettings?.keymapMode ?? DEFAULT_KEYMAP;
|
|
|
|
|
|
@@ -144,7 +146,7 @@ const KeymapSelector = memo(({ onClickBefore }: {onClickBefore: () => void}): JS
|
|
|
|
|
|
|
|
|
return (
|
|
|
- <Selector header="Keymap" onClickBefore={onClickBefore} items={listItems} />
|
|
|
+ <Selector header={t('page_edit.keymap', 'Keymap')} onClickBefore={onClickBefore} items={listItems} />
|
|
|
);
|
|
|
});
|
|
|
KeymapSelector.displayName = 'KeymapSelector';
|
|
|
@@ -154,6 +156,7 @@ const TYPICAL_INDENT_SIZE = [2, 4];
|
|
|
|
|
|
const IndentSizeSelector = memo(({ onClickBefore }: {onClickBefore: () => void}): JSX.Element => {
|
|
|
|
|
|
+ const { t } = useTranslation();
|
|
|
const { data: currentIndentSize, mutate: mutateCurrentIndentSize } = useCurrentIndentSize();
|
|
|
|
|
|
const listItems = useMemo(() => (
|
|
|
@@ -167,7 +170,7 @@ const IndentSizeSelector = memo(({ onClickBefore }: {onClickBefore: () => void})
|
|
|
), [currentIndentSize, mutateCurrentIndentSize]);
|
|
|
|
|
|
return (
|
|
|
- <Selector header="Indent" onClickBefore={onClickBefore} items={listItems} />
|
|
|
+ <Selector header={t('page_edit.indent', 'Indent')} onClickBefore={onClickBefore} items={listItems} />
|
|
|
);
|
|
|
});
|
|
|
IndentSizeSelector.displayName = 'IndentSizeSelector';
|
|
|
@@ -260,6 +263,8 @@ type OptionStatus = typeof OptionsStatus[keyof typeof OptionsStatus];
|
|
|
|
|
|
export const OptionsSelector = ({ collapsed }: {collapsed?: boolean}): JSX.Element => {
|
|
|
|
|
|
+ const { t } = useTranslation();
|
|
|
+
|
|
|
const [dropdownOpen, setDropdownOpen] = useState(false);
|
|
|
|
|
|
const [status, setStatus] = useState<OptionStatus>(OptionsStatus.Home);
|
|
|
@@ -282,7 +287,7 @@ export const OptionsSelector = ({ collapsed }: {collapsed?: boolean}): JSX.Eleme
|
|
|
<span className="material-symbols-outlined py-0 fs-5"> settings </span>
|
|
|
{
|
|
|
collapsed ? <></>
|
|
|
- : <label className="ms-1 me-1">Editor Config</label>
|
|
|
+ : <label className="ms-1 me-1">{t('page_edit.editor_config', 'Editor Config')}</label>
|
|
|
}
|
|
|
</DropdownToggle>
|
|
|
<DropdownMenu container="body">
|
|
|
@@ -290,21 +295,25 @@ export const OptionsSelector = ({ collapsed }: {collapsed?: boolean}): JSX.Eleme
|
|
|
status === OptionsStatus.Home && (
|
|
|
<div className="d-flex flex-column">
|
|
|
<label className="text-muted ms-3">
|
|
|
- Editor Config
|
|
|
+ {t('page_edit.editor_config', 'Editor Config')}
|
|
|
</label>
|
|
|
<hr className="my-1" />
|
|
|
- <ChangeStateButton onClick={() => setStatus(OptionsStatus.Theme)} header="Theme" data={EDITORTHEME_LABEL_MAP[editorSettings.theme ?? ''] ?? ''} />
|
|
|
+ <ChangeStateButton
|
|
|
+ onClick={() => setStatus(OptionsStatus.Theme)}
|
|
|
+ header={t('page_edit.theme', 'Theme')}
|
|
|
+ data={EDITORTHEME_LABEL_MAP[editorSettings.theme ?? ''] ?? ''}
|
|
|
+ />
|
|
|
<hr className="my-1" />
|
|
|
<ChangeStateButton
|
|
|
onClick={() => setStatus(OptionsStatus.Keymap)}
|
|
|
- header="Keymap"
|
|
|
+ header={t('page_edit.keymap', 'Keymap')}
|
|
|
data={KEYMAP_LABEL_MAP[editorSettings.keymapMode ?? ''] ?? ''}
|
|
|
/>
|
|
|
<hr className="my-1" />
|
|
|
<ChangeStateButton
|
|
|
disabled={isIndentSizeForced}
|
|
|
onClick={() => setStatus(OptionsStatus.Indent)}
|
|
|
- header="Indent"
|
|
|
+ header={t('page_edit.indent', 'Indent')}
|
|
|
data={currentIndentSize.toString() ?? ''}
|
|
|
/>
|
|
|
<hr className="my-1" />
|