mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
add fr and nl translations (#4587)
* add fr and nl translations * update fr * fix password label translation * translate country strings * fix double accents * fix Ivory Coast * sort countries * use more performant Collator over localeCompare Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
f5b973e15c
commit
21f7dd5eba
13 changed files with 555 additions and 279 deletions
|
|
@ -66,10 +66,20 @@ async function createI18NDefault() {
|
|||
const files = getAllFiles(ROOT_DIR, i18nFileRegex);
|
||||
const allJson = await Promise.all(files.map(file => fse.readJson(file)));
|
||||
|
||||
const rollup = allJson.reduce((acc, json) => ({
|
||||
...acc,
|
||||
...json,
|
||||
}), {});
|
||||
const rollup = allJson.reduce((acc, json) => {
|
||||
const newKeys = Object.keys(json);
|
||||
|
||||
newKeys.forEach(key => {
|
||||
if (acc[key]) {
|
||||
throw new Error(`i18n key collision: ${key}\n${JSON.stringify(json)}`);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
...acc,
|
||||
...json,
|
||||
};
|
||||
}, {});
|
||||
|
||||
fse.outputFile(i18nDefaultFile, JSON.stringify(rollup));
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue