diff --git a/src/App.tsx b/src/App.tsx index aa5f731..70ccf58 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -10,12 +10,11 @@ import SysInfoContext, { } from "./contexts/SysInfoContext"; import LightModeContext, { lightModeSettingsKey } from "./contexts/LightModeContext"; import { checkNewVersion } from "./contexts/RyzenControllerAppContext"; -import LocaleContext, { getTranslation, localeSettingsKey } from "./contexts/LocaleContext"; +import LocaleContext, { localeSettingsKey } from "./contexts/LocaleContext"; import LocaleSelectorModal from "./components/LocaleSelectorModal"; const si = window.require("systeminformation"); const electronSettings = window.require("electron-settings"); - type AppState = { sysinfo: SysInfoState; lightMode: { @@ -25,7 +24,6 @@ type AppState = { locale: { is: AvailableLanguages; change(to: AvailableLanguages): void; - getTranslation(id: string, fallback?: string, variables?: Record): string; }; }; @@ -52,7 +50,6 @@ class App extends React.Component<{}, AppState> { locale: { is: this.getLatestLocale(), change: this.changeLocale.bind(this), - getTranslation: getTranslation, }, }; diff --git a/src/components/LocaleSelectorModal.tsx b/src/components/LocaleSelectorModal.tsx index b0fbc3f..e6029a0 100644 --- a/src/components/LocaleSelectorModal.tsx +++ b/src/components/LocaleSelectorModal.tsx @@ -1,13 +1,15 @@ import * as React from "react"; import LocaleContext, { getTranslation } from "../contexts/LocaleContext"; +const localeSelectorModalTitle = getTranslation("app.localeSelectorModalTitle", "Change language"); + export default function LocaleSelectorModal() { return ( {locale => (
-

{getTranslation("app.localeSelectorModalTitle", "Change language")}

+

{localeSelectorModalTitle}

- + {presetNames.map(presetName => { return (