Migrate translations to keys and switch to Localazy (#26106)
This commit is contained in:
parent
00803950bf
commit
c525b633bd
98 changed files with 2327 additions and 1922 deletions
|
@ -79,6 +79,7 @@ const parseArgs = require("minimist");
|
|||
const Cpx = require("cpx");
|
||||
const chokidar = require("chokidar");
|
||||
const fs = require("fs");
|
||||
const _ = require("lodash");
|
||||
|
||||
const argv = parseArgs(process.argv.slice(2), {});
|
||||
|
||||
|
@ -155,11 +156,11 @@ function genLangFile(lang, dest) {
|
|||
const reactSdkFile = "node_modules/matrix-react-sdk/src/i18n/strings/" + lang + ".json";
|
||||
const riotWebFile = "src/i18n/strings/" + lang + ".json";
|
||||
|
||||
const translations = {};
|
||||
let translations = {};
|
||||
[reactSdkFile, riotWebFile].forEach(function (f) {
|
||||
if (fs.existsSync(f)) {
|
||||
try {
|
||||
Object.assign(translations, JSON.parse(fs.readFileSync(f).toString()));
|
||||
translations = _.merge(translations, JSON.parse(fs.readFileSync(f).toString()));
|
||||
} catch (e) {
|
||||
console.error("Failed: " + f, e);
|
||||
throw e;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue