Skip to content

Commit

Permalink
yoroi-extension: change the way languages in translation are handled
Browse files Browse the repository at this point in the history
Created a new LANGUAGES_IN_TRANSLATION array to store all languages that
are mid-translation and should not be added to production build. This
way we avoid language specific imports in BaseProfileStore.js

Signed-off-by: Mateusz Albecki <mateusz.albecki@outlook.com>
  • Loading branch information
matalbec committed Oct 26, 2021
1 parent 1e4920f commit d0790af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions packages/yoroi-extension/app/i18n/translations.js
Expand Up @@ -104,3 +104,8 @@ export const LANGUAGES: Array<LanguageType> = [
svg: TurkishFlag
},
];

// add any languages that're mid-translation here. They won't be added to production build.
export const LANGUAGES_IN_TRANSLATION: Array<LanguageType> = [

];
6 changes: 2 additions & 4 deletions packages/yoroi-extension/app/stores/base/BaseProfileStore.js
Expand Up @@ -7,7 +7,7 @@ import Request from '../lib/LocalizedRequest';
import environment from '../../environment';
import { THEMES } from '../../styles/utils';
import type { Theme } from '../../styles/utils';
import { LANGUAGES } from '../../i18n/translations';
import { LANGUAGES, LANGUAGES_IN_TRANSLATION } from '../../i18n/translations';
import type { LanguageType } from '../../i18n/translations';
import type { SetCustomUserThemeRequest } from '../../api/localStorage/index';
import { unitOfAccountDisabledValue } from '../../types/unitOfAccountType';
Expand All @@ -31,9 +31,7 @@ export default class BaseProfileStore
LANGUAGE_OPTIONS: Array<LanguageType> = [
...LANGUAGES,
...(!environment.isProduction()
? [
// add any language that's mid-translation here
]
? LANGUAGES_IN_TRANSLATION
: []),
];

Expand Down

0 comments on commit d0790af

Please sign in to comment.