From 7ea297842e0381e63ab3faffd60238c29ef0165b Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Tue, 5 Nov 2024 02:39:29 -0500 Subject: [PATCH] Change internal ids of methods from language codes (#807) Some input methods had internal ids that were the same as language codes. This was problematic, for example, for reasons described in downstream task https://phabricator.wikimedia.org/T378865 Here, they are all changed to unique ids that don't conflict with language codes. --- rules/chr/{chr.js => chr-translit.js} | 6 +++--- rules/mh/{mh.js => mh-replace.js} | 6 +++--- rules/mnc/{mnc.js => mnc-scripts.js} | 6 +++--- rules/sjo/{sjo.js => sjo-scripts.js} | 6 +++--- src/jquery.ime.inputmethods.js | 24 ++++++++++++------------ test/jquery.ime.test.fixtures.js | 14 +++++++------- 6 files changed, 31 insertions(+), 31 deletions(-) rename rules/chr/{chr.js => chr-translit.js} (97%) rename rules/mh/{mh.js => mh-replace.js} (93%) rename rules/mnc/{mnc.js => mnc-scripts.js} (96%) rename rules/sjo/{sjo.js => sjo-scripts.js} (96%) diff --git a/rules/chr/chr.js b/rules/chr/chr-translit.js similarity index 97% rename from rules/chr/chr.js rename to rules/chr/chr-translit.js index 11a2b3e06..4e0c42344 100644 --- a/rules/chr/chr.js +++ b/rules/chr/chr-translit.js @@ -1,8 +1,8 @@ ( function ( $ ) { 'use strict'; - var chr = { - id: 'chr', + var chrTranslit = { + id: 'chr-translit', name: 'Cherokee', description: 'Typing Cherokee syllabary from English letters', date: '2023-01-14', @@ -129,5 +129,5 @@ ] }; - $.ime.register( chr ); + $.ime.register( chrTranslit ); }( jQuery ) ); diff --git a/rules/mh/mh.js b/rules/mh/mh-replace.js similarity index 93% rename from rules/mh/mh.js rename to rules/mh/mh-replace.js index 79dfa01ba..1574cc013 100644 --- a/rules/mh/mh.js +++ b/rules/mh/mh-replace.js @@ -9,8 +9,8 @@ ( function ( $ ) { 'use strict'; - var mh = { - id: 'mh', + var mhReplace = { + id: 'mh-replace', name: 'Kajin M̧ajeļ', description: 'Marshallese Language', date: '2013-03-29', @@ -39,5 +39,5 @@ ] }; - $.ime.register( mh ); + $.ime.register( mhReplace ); }( jQuery ) ); diff --git a/rules/mnc/mnc.js b/rules/mnc/mnc-scripts.js similarity index 96% rename from rules/mnc/mnc.js rename to rules/mnc/mnc-scripts.js index 8f2e52ee7..f61214429 100644 --- a/rules/mnc/mnc.js +++ b/rules/mnc/mnc-scripts.js @@ -1,8 +1,8 @@ ( function ( $ ) { 'use strict'; - var manchu = { - id: 'mnc', + var manchuScripts = { + id: 'mnc-scripts', name: 'Manchu Scripts', description: 'Manchu Scripts', date: '2014-4-22', @@ -108,5 +108,5 @@ ] }; - $.ime.register( manchu ); + $.ime.register( manchuScripts ); }( jQuery ) ); diff --git a/rules/sjo/sjo.js b/rules/sjo/sjo-scripts.js similarity index 96% rename from rules/sjo/sjo.js rename to rules/sjo/sjo-scripts.js index 118697577..7f7b79662 100644 --- a/rules/sjo/sjo.js +++ b/rules/sjo/sjo-scripts.js @@ -1,8 +1,8 @@ ( function ( $ ) { 'use strict'; - var sibe = { - id: 'sjo', + var sjoScripts = { + id: 'sjo-scripts', name: 'Sibe Scripts', description: 'Sibe Scripts', date: '2014-4-22', @@ -108,5 +108,5 @@ ] }; - $.ime.register( sibe ); + $.ime.register( sjoScripts ); }( jQuery ) ); diff --git a/src/jquery.ime.inputmethods.js b/src/jquery.ime.inputmethods.js index 01c0f62a2..717d26f02 100755 --- a/src/jquery.ime.inputmethods.js +++ b/src/jquery.ime.inputmethods.js @@ -208,9 +208,9 @@ name: 'Chinook wawa tilde', source: 'rules/chn/chn-tilde.js' }, - 'chr': { + 'chr-translit': { name: 'Cherokee Transliteration', - source: 'rules/chr/chr.js' + source: 'rules/chr/chr-translit.js' }, 'ckb-transliteration-arkbd': { name: 'باشووری', @@ -634,9 +634,9 @@ name: 'Malagasy tilde', source: 'rules/mg/mg-tilde.js' }, - 'mh': { + 'mh-replace': { name: 'Kajin M̧ajeļ', - source: 'rules/mh/mh.js' + source: 'rules/mh/mh-replace.js' }, 'ml-inscript': { name: 'ഇൻസ്ക്രിപ്റ്റ്', @@ -670,9 +670,9 @@ name: 'Traditional Mongolian Ali-gali', source: 'rules/mn/mn-tradali.js' }, - 'mnc': { + 'mnc-scripts': { name: 'ᠮᠠᠨᠵᡠ', - source: 'rules/mnc/mnc.js' + source: 'rules/mnc/mnc-scripts.js' }, 'mnc-ali': { name: 'Manchu Ali-gali', @@ -918,9 +918,9 @@ name: 'විජේසේකර', source: 'rules/si/si-wijesekara.js' }, - 'sjo': { + 'sjo-scripts': { name: 'ᠰᡞᠪᡝ', - source: 'rules/sjo/sjo.js' + source: 'rules/sjo/sjo-scripts.js' }, 'sk-kbd': { name: 'Štandardná', @@ -1240,7 +1240,7 @@ }, chr: { autonym: 'ᏣᎳᎩ', - inputmethods: [ 'chr' ] + inputmethods: [ 'chr-translit' ] }, ckb: { autonym: 'کوردی', @@ -1556,7 +1556,7 @@ }, mh: { autonym: 'Kajin M̧ajeļ', - inputmethods: [ 'mh' ] + inputmethods: [ 'mh-replace' ] }, ml: { autonym: 'മലയാളം', @@ -1568,7 +1568,7 @@ }, mnc: { autonym: 'ᠮᠠᠨᠵᡠ', - inputmethods: [ 'mnc', 'mnc-ali' ] + inputmethods: [ 'mnc-scripts', 'mnc-ali' ] }, mni: { autonym: 'Manipuri', @@ -1716,7 +1716,7 @@ }, sjo: { autonym: 'ᠰᡞᠪᡝ', - inputmethods: [ 'sjo' ] + inputmethods: [ 'sjo-scripts' ] }, sk: { autonym: 'Slovenčina', diff --git a/test/jquery.ime.test.fixtures.js b/test/jquery.ime.test.fixtures.js index 400190126..359ca6781 100644 --- a/test/jquery.ime.test.fixtures.js +++ b/test/jquery.ime.test.fixtures.js @@ -1172,7 +1172,7 @@ var palochkaVariants = { }, { description: 'Cherokee transliteration test', - inputmethod: 'chr', + inputmethod: 'chr-translit', tests: [ { input: 'nah\'na', output: 'ᏀᎾ', description: 'Cherokee nah\'na -> ᏀᎾ' }, { input: 'na\'hna', output: 'ᎾᎿ', description: 'Cherokee na\'hna -> ᎾᎿ' }, @@ -4698,7 +4698,7 @@ var palochkaVariants = { }, { description: 'Kajin M̧ajeļ (Marshallese) test', - inputmethod: 'mh', + inputmethod: 'mh-replace', tests: [ { input: 'Y', output: 'Ū', description: 'Y for Ū in Marshallese' }, { input: 'S', output: 'Ā', description: 'S for Ā in Marshallese' }, @@ -4781,9 +4781,9 @@ var palochkaVariants = { }, { description: 'Manchu mnc test', - inputmethod: 'mnc', + inputmethod: 'mnc-scripts', tests: [ - { input: 'LWE', output: 'ᡀᠸᠧ', description: 'Manchu mnc' } + { input: 'LWE', output: 'ᡀᠸᠧ', description: 'Manchu mnc-scripts' } ] }, { @@ -6010,10 +6010,10 @@ var palochkaVariants = { ] }, { - description: 'Xibe sjo test', - inputmethod: 'sjo', + description: 'Xibe sjo-scripts test', + inputmethod: 'sjo-scripts', tests: [ - { input: 'WER', output: 'ᠸᠧᡰ', description: 'Xibe sjo 〈ᠴᠣᡝ〉' } + { input: 'WER', output: 'ᠸᠧᡰ', description: 'Xibe sjo-scripts 〈ᠴᠣᡝ〉' } ] }, {