Consistently use parentheses in Chinese-script autonyms (#148)

Addresses #141.

Co-authored-by: Kartik Mistry <kartikm@users.noreply.github.com>
This commit is contained in:
Amir E. Aharoni
2021-03-08 14:25:27 +02:00
committed by GitHub
parent a73375d0df
commit 349589fc1f
3 changed files with 14 additions and 5 deletions

View File

@@ -104,7 +104,7 @@ languages:
# FIXME cdo will be modified later to split to Latin and Chinese more cleanly
cdo: [Latn, [AS], Mìng-dĕ̤ng-ngṳ̄]
cdo-latn: [Latn, [AS], Mìng-dĕ̤ng-ngṳ̄ Bàng-uâ-cê]
cdo-hani: [Hani, [AS], 閩東語漢字]
cdo-hani: [Hani, [AS], 閩東語漢字]
ce: [Cyrl, [EU], нохчийн]
ceb: [Latn, [AS], Cebuano]
ch: [Latn, [PA], Chamoru]
@@ -121,7 +121,7 @@ languages:
chy: [Latn, [AM], Tsetsêhestâhese]
ciw: [Latn, [AM], Ojibwemowin]
cjy: [cjy-hant]
cjy-hans: [Hans, [AS], 晋语(简化字)]
cjy-hans: [Hans, [AS], 晋语(简化字]
cjy-hant: [Hant, [AS], 晉語]
ckb: [Arab, [ME], کوردی]
ckt: [Cyrl, [AS], ԓыгъоравэтԓьэн]

View File

@@ -652,7 +652,7 @@
[
"AS"
],
"閩東語漢字"
"閩東語漢字"
],
"ce": [
"Cyrl",
@@ -721,7 +721,7 @@
[
"AS"
],
"晋语(简化字)"
"晋语(简化字"
],
"cjy-hant": [
"Hant",

View File

@@ -110,7 +110,8 @@ describe( 'languagedata', function () {
} );
it( 'autonyms', function () {
var autonyms;
var autonyms, chineseScriptLanguages, i,
languagesWithParentheses = [];
// Add a language in run time.
// This is done early to make sure that it doesn't break other functions.
languageData.addLanguage( 'qqq', {
@@ -130,6 +131,14 @@ describe( 'languagedata', function () {
assert.deepEqual( [ 'de', 'fi', 'gn', 'hu' ].sort( languageData.sortByAutonym ), [
'gn', 'de', 'hu', 'fi'
], 'Languages are correctly sorted by autonym' );
chineseScriptLanguages = languageData.getLanguagesInScripts( [ 'Hans', 'Hant', 'Hani' ] );
for ( i = 0; i < chineseScriptLanguages.length; ++i ) {
if ( languageData.getAutonym( chineseScriptLanguages[i] ).match( /[()]/ ) ) {
languagesWithParentheses.push( chineseScriptLanguages[i] );
}
}
assert.deepEqual( languagesWithParentheses, [], 'Chinese script languages\' autonyms don\'t have Western parentheses' );
} );
it( 'regions and groups', function () {
var languagesAM;