mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Move languageNames and scriptNames data to the individual locale files instead of always loading them via locales.json (re: #7994)
This commit is contained in:
@@ -10,6 +10,8 @@ const prettyStringify = require('json-stringify-pretty-compact');
|
||||
const shell = require('shelljs');
|
||||
const YAML = require('js-yaml');
|
||||
|
||||
const languageNames = require('./language_names.js');
|
||||
|
||||
const fieldSchema = require('../data/presets/schema/field.json');
|
||||
const presetSchema = require('../data/presets/schema/preset.json');
|
||||
const deprecated = require('../data/deprecated.json');
|
||||
@@ -805,9 +807,18 @@ function writeEnJson(tstrings) {
|
||||
}
|
||||
|
||||
let enjson = core;
|
||||
['presets', 'imagery', 'community', 'languageNames', 'scriptNames'].forEach(function(prop) {
|
||||
if (enjson.en[prop]) {
|
||||
console.error(`Error: Reserved property '${prop}' already exists in core strings`);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
enjson.en.presets = tstrings;
|
||||
enjson.en.imagery = imagery.en.imagery;
|
||||
enjson.en.community = community.en;
|
||||
enjson.en.languageNames = languageNames.languageNamesInLanguageOf('en');
|
||||
enjson.en.scriptNames = languageNames.scriptNamesInLanguageOf('en');
|
||||
|
||||
return fs.writeFileSync('dist/locales/en.json', JSON.stringify(enjson, null, 4));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user