mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-17 14:23:38 +02:00
override/extend languages data, thanks @bgo-eiu
closes #9241 closes #9242
This commit is contained in:
@@ -64,6 +64,10 @@ _Breaking developer changes, which may affect downstream projects or sites that
|
||||
* Fix some boundary lines (and preset) not hidden by the map features filter ([#9171], thanks [@k-yle])
|
||||
* Fix iD using invalid user selected imagery ([#8732], thanks [@renancleyson-dev])
|
||||
* Make osmose QA service work again by upgrading API calls to the newest API version ([#9208])
|
||||
#### :earth_asia: Localization
|
||||
* Add native labels for various South Asian languages ([#9241], thanks [@bgo-eiu])
|
||||
* Correct and add country-specific languages for Pakistan ([#9242], thanks [@bgo-eiu])
|
||||
* Add Ladin as a country-specific language used in Italy
|
||||
#### :rocket: Presets
|
||||
* Disable taginfo suggestions for the `via` field ([#9140], thanks [@k-yle])
|
||||
* Treat `surface=chipseal` as a paved surface ([#9139], thanks [@k-yle])
|
||||
@@ -97,6 +101,8 @@ _Breaking developer changes, which may affect downstream projects or sites that
|
||||
[#9208]: https://github.com/openstreetmap/iD/issues/9208
|
||||
[#9227]: https://github.com/openstreetmap/iD/issues/9227
|
||||
[#9293]: https://github.com/openstreetmap/iD/issues/9293
|
||||
[#9241]: https://github.com/openstreetmap/iD/pull/9241
|
||||
[#9242]: https://github.com/openstreetmap/iD/pull/9242
|
||||
[@furkanmutlu]: https://github.com/furkanmutlu
|
||||
[@JackNUMBER]: https://github.com/JackNUMBER
|
||||
[@aaditya0000]: https://github.com/aaditya0000
|
||||
|
||||
+10
-4
@@ -58,8 +58,10 @@
|
||||
"bez": {"nativeName": "Hibena"},
|
||||
"bfd": {},
|
||||
"bfq": {},
|
||||
"bft": {"nativeName": "بلتی"},
|
||||
"bg": {"nativeName": "български"},
|
||||
"bgn": {},
|
||||
"bha": {"nativeName": "भरीयाटी"},
|
||||
"bho": {},
|
||||
"bi": {},
|
||||
"bik": {},
|
||||
@@ -75,7 +77,7 @@
|
||||
"bqi": {},
|
||||
"br": {"nativeName": "brezhoneg"},
|
||||
"bra": {},
|
||||
"brh": {},
|
||||
"brh": {"nativeName": "براہوئی"},
|
||||
"brx": {"nativeName": "बर’"},
|
||||
"bs": {"nativeName": "bosanski"},
|
||||
"bs-Cyrl": {"base": "bs", "script": "Cyrl"},
|
||||
@@ -292,6 +294,7 @@
|
||||
"kkj": {"nativeName": "kakɔ"},
|
||||
"kl": {"nativeName": "kalaallisut"},
|
||||
"kln": {"nativeName": "Kalenjin"},
|
||||
"kls": {"nativeName": "Kal'as'amondr"},
|
||||
"km": {"nativeName": "ខ្មែរ"},
|
||||
"kmb": {},
|
||||
"kn": {"nativeName": "ಕನ್ನಡ"},
|
||||
@@ -442,8 +445,6 @@
|
||||
"osa": {},
|
||||
"ota": {},
|
||||
"pa": {"nativeName": "ਪੰਜਾਬੀ"},
|
||||
"pa-Arab": {"base": "pa", "script": "Arab"},
|
||||
"pa-Guru": {"base": "pa", "script": "Guru"},
|
||||
"pag": {},
|
||||
"pal": {},
|
||||
"pam": {},
|
||||
@@ -459,6 +460,7 @@
|
||||
"pi": {},
|
||||
"pl": {"nativeName": "polski"},
|
||||
"pms": {},
|
||||
"pnb": {"nativeName": "پنجابی"},
|
||||
"pnt": {},
|
||||
"pon": {},
|
||||
"pqm": {},
|
||||
@@ -499,6 +501,7 @@
|
||||
"sba": {},
|
||||
"sbp": {"nativeName": "Ishisangu"},
|
||||
"sc": {"nativeName": "sardu"},
|
||||
"scl": {"nativeName": "ݜݨیاٗ"},
|
||||
"scn": {},
|
||||
"sco": {},
|
||||
"sd": {"nativeName": "سنڌي"},
|
||||
@@ -516,6 +519,7 @@
|
||||
"sga": {},
|
||||
"sgs": {},
|
||||
"sh": {},
|
||||
"shg": {"nativeName": "хуг̌ну̊н зив"},
|
||||
"shi": {"nativeName": "ⵜⴰⵛⵍⵃⵉⵜ"},
|
||||
"shi-Latn": {"base": "shi", "script": "Latn"},
|
||||
"shi-Tfng": {"base": "shi", "script": "Tfng"},
|
||||
@@ -524,6 +528,7 @@
|
||||
"si": {"nativeName": "සිංහල"},
|
||||
"sid": {},
|
||||
"sk": {"nativeName": "slovenčina"},
|
||||
"skr": {"nativeName": "سرائیکی"},
|
||||
"sl": {"nativeName": "slovenščina"},
|
||||
"slh": {},
|
||||
"sli": {},
|
||||
@@ -589,7 +594,7 @@
|
||||
"tr": {"nativeName": "Türkçe"},
|
||||
"tru": {},
|
||||
"trv": {},
|
||||
"trw": {},
|
||||
"trw": {"nativeName": "توروالی"},
|
||||
"ts": {},
|
||||
"tsd": {},
|
||||
"tsi": {},
|
||||
@@ -632,6 +637,7 @@
|
||||
"wal": {},
|
||||
"war": {},
|
||||
"was": {},
|
||||
"wbl": {"nativeName": "وخی"},
|
||||
"wbp": {},
|
||||
"wo": {"nativeName": "Wolof"},
|
||||
"wuu": {},
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
"iq": ["ar", "en", "ckb", "az-Arab", "fa", "lrc", "syr"],
|
||||
"ir": ["fa", "az-Arab", "mzn", "glk", "ckb", "sdh", "tk", "lrc", "ar", "bal", "rmt", "bqi", "luz", "lki", "bgn", "prd", "hy", "ps", "ka", "gbz", "kk-Arab"],
|
||||
"is": ["is", "da"],
|
||||
"it": ["it", "en", "fr", "sc", "de", "vec", "nap", "lij", "scn", "sdc", "sl", "fur", "egl", "ca", "el", "lmo", "pms", "hr", "rgn"],
|
||||
"it": ["it", "en", "fr", "sc", "de", "vec", "nap", "lij", "scn", "sdc", "sl", "fur", "egl", "ca", "el", "lmo", "pms", "hr", "rgn", "lld"],
|
||||
"je": ["en"],
|
||||
"jm": ["en", "jam"],
|
||||
"jo": ["ar", "en"],
|
||||
@@ -181,7 +181,7 @@
|
||||
"pf": ["fr", "ty", "zh-Hant"],
|
||||
"pg": ["tpi", "en", "ho"],
|
||||
"ph": ["en", "fil", "es", "ceb", "ilo", "hil", "bik", "war", "fbl", "pam", "pag", "mdh", "tsg", "zh-Hant", "cps", "krj", "bto", "hnn", "tbw", "bku"],
|
||||
"pk": ["ur", "pa-Arab", "en", "lah", "ps", "sd", "skr", "bal", "brh", "hno", "fa", "bgn", "hnd", "tg-Arab", "gju", "bft", "kvx", "khw", "mvy", "gjk", "kxp", "ks", "trw", "btv"],
|
||||
"pk": ["ur", "en", "ps", "sd", "skr", "bal", "brh", "hno", "fa", "bgn", "hnd", "gju", "bft", "kvx", "khw", "mvy", "gjk", "kxp", "ks", "trw", "btv", "pnb", "scl", "trw", "kls"],
|
||||
"pl": ["pl", "en", "de", "ru", "szl", "be", "uk", "csb", "sli", "lt"],
|
||||
"pm": ["fr", "en"],
|
||||
"pn": ["en"],
|
||||
|
||||
@@ -5,6 +5,7 @@ const prettyStringify = require('json-stringify-pretty-compact');
|
||||
const shell = require('shelljs');
|
||||
const YAML = require('js-yaml');
|
||||
const fetch = require('node-fetch');
|
||||
const lodash = require('lodash');
|
||||
|
||||
const languageNames = require('./language_names.js');
|
||||
|
||||
@@ -70,6 +71,7 @@ function buildData() {
|
||||
|
||||
let territoryLanguages = generateTerritoryLanguages();
|
||||
fs.writeFileSync('data/territory_languages.json', prettyStringify(territoryLanguages, { maxLength: 9999 }) );
|
||||
|
||||
writeEnJson();
|
||||
|
||||
const languageInfo = languageNames.langNamesInNativeLang;
|
||||
@@ -166,6 +168,11 @@ function generateTerritoryLanguages() {
|
||||
}).map(langCode => langCode.replace('_', '-'));
|
||||
});
|
||||
|
||||
// override/adjust some territory languages which are not included in CLDR data
|
||||
territoryLanguages.pk.push('pnb', 'scl', 'trw', 'kls'); // https://github.com/openstreetmap/iD/pull/9242
|
||||
lodash.pull(territoryLanguages.pk, 'pa-Arab', 'lah', 'tg-Arab'); // - " -
|
||||
territoryLanguages.it.push('lld'); // https://en.wikipedia.org/wiki/Ladin_language
|
||||
|
||||
return territoryLanguages;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ let referencedScripts = [];
|
||||
|
||||
function getLangNamesInNativeLang() {
|
||||
// manually add languages we want that aren't in CLDR
|
||||
// see for example https://github.com/openstreetmap/iD/pull/9241/
|
||||
let unordered = {
|
||||
'oc': {
|
||||
nativeName: 'Occitan'
|
||||
@@ -30,6 +31,36 @@ function getLangNamesInNativeLang() {
|
||||
'zh_pinyin': {
|
||||
base: 'zh',
|
||||
script: 'Latn'
|
||||
},
|
||||
'bft': {
|
||||
nativeName: 'بلتی'
|
||||
},
|
||||
'bha': {
|
||||
nativeName: 'भरीयाटी'
|
||||
},
|
||||
'brh': {
|
||||
nativeName: 'براہوئی'
|
||||
},
|
||||
'kls': {
|
||||
nativeName: 'Kal\'as\'amondr'
|
||||
},
|
||||
'pnb': {
|
||||
nativeName: 'پنجابی'
|
||||
},
|
||||
'scl': {
|
||||
nativeName: 'ݜݨیاٗ'
|
||||
},
|
||||
'shg': {
|
||||
nativeName: 'хуг̌ну̊н зив'
|
||||
},
|
||||
'skr': {
|
||||
nativeName: 'سرائیکی'
|
||||
},
|
||||
'trw': {
|
||||
nativeName: 'توروالی'
|
||||
},
|
||||
'wbl': {
|
||||
nativeName: 'وخی'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -69,6 +100,10 @@ function getLangNamesInNativeLang() {
|
||||
unordered[code] = {};
|
||||
});
|
||||
|
||||
// delete codes which should not be used
|
||||
delete unordered['pa-Arab']; // https://github.com/openstreetmap/iD/pull/9241/
|
||||
delete unordered['pa-Guru']; // - " -
|
||||
|
||||
let ordered = {};
|
||||
Object.keys(unordered).sort().forEach(key => ordered[key] = unordered[key]);
|
||||
return ordered;
|
||||
|
||||
Reference in New Issue
Block a user