-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ukrainian translation by Matronium and worked around firefox bu…
…g related to proxies
- Loading branch information
1 parent
7b6ffd6
commit b600253
Showing
3 changed files
with
216 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,18 @@ const langRequested = window.location.search.substring(1).split('&')[0] | |
const langEnforce = langRequested ? [langRequested] : null | ||
|
||
export async function loadL10n() { | ||
const langs = ['cs', 'de', 'en', 'es', 'ko', 'pt', 'zhcn', 'zhtw', 'fr'] | ||
const l10nDataList = await Promise.all([ | ||
...langs.map(lang => | ||
const langs = ['cs', 'de', 'en', 'es', 'ko', 'pt', 'zhcn', 'zhtw', 'fr', 'uk'] | ||
const [l10nDataList, i18nBuilderMod] = await Promise.all([ | ||
Promise.all(langs.map(lang => | ||
fetch(`./scripts/l10n/${lang}.json`) | ||
.then(res => res.json()) | ||
.catch(err => { | ||
throw Error(`Fail to load ${lang} lang data.\n\n${err.message}`) | ||
}) | ||
), | ||
)), | ||
import("https://unpkg.com/@aurium/[email protected]") // parallel loading | ||
]) | ||
const i18nBuilder = l10nDataList.pop().default | ||
const i18nBuilder = i18nBuilderMod.default | ||
const l10nData = {} | ||
langs.forEach((lang, i) => l10nData[lang] = l10nDataList[i]) | ||
window.i18n = i18nBuilder(l10nData, langEnforce) | ||
|
Oops, something went wrong.