-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/wasedatime/wasedatime-web …
…into develop
- Loading branch information
Showing
36 changed files
with
6,360 additions
and
5,970 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { initReactI18next } from "react-i18next" | ||
import i18next from "i18next" | ||
import { getCoreTranslation, getI18nLanguageDetector, getI18nHttpBackend, Lang } from "wasedatime-ui" | ||
import translationEN from "@app/constants/locales/en/translation.json" | ||
import translationJA from "@app/constants/locales/ja/translation.json" | ||
|
||
const resources = { | ||
[Lang.EN]: { | ||
translation: { ...getCoreTranslation(Lang.EN), ...translationEN }, | ||
}, | ||
[Lang.JA]: { | ||
translation: { ...getCoreTranslation(Lang.JA), ...translationJA }, | ||
}, | ||
} | ||
|
||
const detectorOptions = { | ||
order: ["localStorage"], | ||
lookupLocalStorage: "wasedatime-lng", | ||
caches: ["localStorage"], | ||
} | ||
|
||
i18next | ||
.use(getI18nHttpBackend()) | ||
.use(getI18nLanguageDetector()) | ||
.use(initReactI18next) // passes i18n down to react-i18next | ||
.init({ | ||
resources, | ||
fallbackLng: Lang.EN, | ||
keySeparator: ".", | ||
interpolation: { | ||
// react already safes from xss | ||
escapeValue: false, | ||
}, | ||
// Configure the withNamespaces / NamespacesConsumer to | ||
// not render the content until needed namespaces are loaded. | ||
// react: { | ||
// wait: true, | ||
// }, | ||
detection: detectorOptions, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.