chore(layout): use i18n for options

This commit is contained in:
Elian Doran 2025-12-09 22:58:16 +02:00
parent a45c1a1dc8
commit 876e8f843a
No known key found for this signature in database
3 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,4 @@
import { t } from "./i18n";
import options from "./options"; import options from "./options";
interface ExperimentalFeature { interface ExperimentalFeature {
@ -9,8 +10,8 @@ interface ExperimentalFeature {
export const experimentalFeatures = [ export const experimentalFeatures = [
{ {
id: "new-layout", id: "new-layout",
name: "New Layout", name: t("experimental_features.new_layout_name"),
description: "Try out the new layout for a more modern look and improved usability.", description: t("experimental_features.new_layout_description"),
} }
] as const satisfies ExperimentalFeature[]; ] as const satisfies ExperimentalFeature[];

View File

@ -1096,6 +1096,12 @@
"vacuuming_database": "Vacuuming database...", "vacuuming_database": "Vacuuming database...",
"database_vacuumed": "Database has been vacuumed" "database_vacuumed": "Database has been vacuumed"
}, },
"experimental_features": {
"title": "Experimental Options",
"disclaimer": "These options are experimental and may cause instability. Use with caution.",
"new_layout_name": "New Layout",
"new_layout_description": "Try out the new layout for a more modern look and improved usability. Subject to heavy change in the upcoming releases."
},
"fonts": { "fonts": {
"theme_defined": "Theme defined", "theme_defined": "Theme defined",
"fonts": "Fonts", "fonts": "Fonts",

View File

@ -182,8 +182,8 @@ function ExperimentalOptions() {
const [ enabledExperimentalFeatures, setEnabledExperimentalFeatures ] = useTriliumOptionJson<string[]>("experimentalFeatures"); const [ enabledExperimentalFeatures, setEnabledExperimentalFeatures ] = useTriliumOptionJson<string[]>("experimentalFeatures");
return ( return (
<OptionsSection title="Experimental Options"> <OptionsSection title={t("experimental_features.title")}>
<FormText>These options are experimental and may cause instability. Use with caution.</FormText> <FormText>{t("experimental_features.disclaimer")}</FormText>
<CheckboxList <CheckboxList
values={experimentalFeatures} values={experimentalFeatures}
@ -192,5 +192,5 @@ function ExperimentalOptions() {
currentValue={enabledExperimentalFeatures} onChange={setEnabledExperimentalFeatures} currentValue={enabledExperimentalFeatures} onChange={setEnabledExperimentalFeatures}
/> />
</OptionsSection> </OptionsSection>
) );
} }