Skip to content

Commit

Permalink
Merge branch 'main' into l10n_main
Browse files Browse the repository at this point in the history
  • Loading branch information
jgresham authored Apr 22, 2024
2 parents cfde0b6 + 81cf4c0 commit e5a20a5
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 3 deletions.
13 changes: 13 additions & 0 deletions src/main/i18nMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import enTranslations from '../../assets/locales/en/translation.json';
import enUpdater from '../../assets/locales/en/updater.json';
import enWindowMenu from '../../assets/locales/en/windowMenu.json';

import csDialog from '../../assets/locales/cs/dialog.json';
import csNotifications from '../../assets/locales/cs/notifications.json';
import csTranslations from '../../assets/locales/cs/translation.json';
import csUpdater from '../../assets/locales/cs/updater.json';
import csWindowMenu from '../../assets/locales/cs/windowMenu.json';

import esDialog from '../../assets/locales/es/dialog.json';
import esNotifications from '../../assets/locales/es/notifications.json';
import esTranslations from '../../assets/locales/es/translation.json';
Expand Down Expand Up @@ -68,6 +74,13 @@ i18n.use(I18nextCLILanguageDetector).init({
updater: enUpdater,
dialog: enDialog,
},
cs: {
translation: csTranslations,
notifications: csNotifications,
windowMenu: csWindowMenu,
updater: csUpdater,
dialog: csDialog,
},
es: {
translation: esTranslations,
notifications: esNotifications,
Expand Down
2 changes: 1 addition & 1 deletion src/main/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class MenuBuilder {
}

buildMenu(): Menu {
logger.info('Building menu. Current Lang is : ', i18nMain.language);
logger.info(`Building menu. Current Lang is : ${i18nMain.language}`);
if (
process.env.NODE_ENV === 'development' ||
process.env.DEBUG_PROD === 'true'
Expand Down
6 changes: 5 additions & 1 deletion src/main/state/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ export const getSettings = (): Settings => {
export const setLanguage = (languageCode: string) => {
logger.info(`Setting language to ${languageCode}`);
store.set(`${SETTINGS_KEY}.${APP_LANGUAGE_KEY}`, languageCode);
logger.info(`App language is ${store.get(SETTINGS_KEY, APP_LANGUAGE_KEY)}`);
logger.info(
`App language is ${JSON.stringify(
store.get(SETTINGS_KEY, APP_LANGUAGE_KEY),
)}`,
);
};

export const setNativeThemeSetting = (theme: ThemeSetting) => {
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/LanguageSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ const LanguageSelect = ({ onChange, language }: LanguageSelectProps) => {
};
return (
// language list, useful for inputting to auto-translators
// "es", "de", "fr", "ja", "ru", "vi", "zh"
// "es", "cs", "de", "fr", "ja", "ru", "vi", "zh"
<Select
value={language}
options={[
{ label: 'English', value: 'en' },
{ label: 'Español', value: 'es' },
{ label: 'Chinese', value: 'zh' },
{ label: 'Czech', value: 'cs' },
{ label: 'French', value: 'fr' },
{ label: 'German', value: 'de' },
{ label: 'Japanese', value: 'ja' },
Expand Down
1 change: 1 addition & 0 deletions src/renderer/Presentational/StorybookLanguageSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const StorybookLanguageSelect = () => {
value={sLang}
options={[
{ label: 'English', value: 'en' },
{ label: 'Czech', value: 'cs' },
{ label: 'Chinese', value: 'zh' },
{ label: 'Español', value: 'es' },
{ label: 'French', value: 'fr' },
Expand Down
9 changes: 9 additions & 0 deletions src/renderer/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import enGenericComponents from '../../assets/locales/en/genericComponents.json'
import enSystemRequirements from '../../assets/locales/en/systemRequirements.json';
import enTranslations from '../../assets/locales/en/translation.json';

import csGenericComponents from '../../assets/locales/cs/genericComponents.json';
import csSystemRequirements from '../../assets/locales/cs/systemRequirements.json';
import csTranslations from '../../assets/locales/cs/translation.json';

import esGenericComponents from '../../assets/locales/es/genericComponents.json';
import esSystemRequirements from '../../assets/locales/es/systemRequirements.json';
import esTranslations from '../../assets/locales/es/translation.json';
Expand Down Expand Up @@ -66,6 +70,11 @@ i18n
systemRequirements: enSystemRequirements,
genericComponents: enGenericComponents,
},
cs: {
translation: csTranslations,
systemRequirements: csSystemRequirements,
genericComponents: csGenericComponents,
},
es: {
translation: esTranslations,
systemRequirements: esSystemRequirements,
Expand Down

0 comments on commit e5a20a5

Please sign in to comment.