common shared translations

This commit is contained in:
Brandon Thomas committed 2022-02-16 00:38:29 -05:00
1 parent edcaca3c65
commit b03cbf8a80
4 files changed
+7 -7

No files matched your search

@@ -115,7 +115,7 @@ interface DeepDictionary {
// Merge two deep dictionaries.
// On ties, give preference to the first one.
function MergeDeepDictionary(dictA: Resource, dictB: DeepDictionary) : DeepDictionary {
function MergeDeepDictionary(dictA: DeepDictionary, dictB: DeepDictionary) : DeepDictionary {
let output : DeepDictionary = {};
let keys = new Set(Object.keys(dictA).concat(Object.keys(dictB)));
+2 -2
View File
@@ -13,7 +13,7 @@ import { SessionWrapper } from '@storyteller/components/src/session/SessionWrapp
import { DetectLocale, DetectLocaleIsOk } from '@storyteller/components/src/api/locale/DetectLocale';
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import { TRANSLATIONS } from './_i18n/Translations'
import { STORYTELLER_MERGED_TRANSLATIONS } from './_i18n/StorytellerTranslations'
i18n
.use(initReactI18next) // passes i18n down to react-i18next
@@ -21,7 +21,7 @@ i18n
// the translations
// (tip move them in a JSON file and import them,
// or even better, manage them via a UI: https://react.i18next.com/guides/multiple-translation-files#manage-your-translations-with-a-management-gui)
resources: TRANSLATIONS as any,
resources: STORYTELLER_MERGED_TRANSLATIONS as any,
//lng: 'en', // if you're using a language detector, do not define the lng option
fallbackLng: 'en',
@@ -66,6 +66,6 @@ const STORYTELLER_TRANSLATIONS : any = {
},
}
const TRANSLATIONS = MergeDeepDictionary(STORYTELLER_TRANSLATIONS, COMMON_TRANSLATIONS);
const STORYTELLER_MERGED_TRANSLATIONS = MergeDeepDictionary(STORYTELLER_TRANSLATIONS, COMMON_TRANSLATIONS);
export { TRANSLATIONS }
export { STORYTELLER_MERGED_TRANSLATIONS }
@@ -56,14 +56,14 @@ function TopNavSessionButton(props: Props) {
await logoutHandler();
props.closeHamburgerAction();
}}
>{t('coreUi.topNav.logout')}</button>;
>{t('common.logout')}</button>;
} else {
sessionLink = (
<Link
to="/signup"
className="button is-danger is-pulled-right"
onClick={() => props.closeHamburgerAction()}
>{t('coreUi.topNav.signUpLogin')}</Link>
>{t('common.signUpLogin')}</Link>
);
}