From 96c5a6361d4300799ea6e34c8e2b7f1fa59d204c Mon Sep 17 00:00:00 2001 From: Winston Sung Date: Tue, 19 Nov 2024 22:39:27 +0800 Subject: [PATCH] List zh-pinyin-transliteration IME in zh-* languages Also renamed from zh-pinyin-transliteration to zh-latn-pinyin-transliteration to reflect the input method is for zh-latn-pinyin, not zh-hans or zh-hant. Bug: #813 Change-Id: Ib9bd97f48845b4f3dc7a47d0d55fccb9b734e0f5 --- ...n.js => zh-latn-pinyin-transliteration.js} | 10 ++--- src/jquery.ime.inputmethods.js | 40 +++++++++++++++++-- test/jquery.ime.test.fixtures.js | 2 +- 3 files changed, 42 insertions(+), 10 deletions(-) rename rules/zh/{zh-pinyin-transliteration.js => zh-latn-pinyin-transliteration.js} (83%) diff --git a/rules/zh/zh-pinyin-transliteration.js b/rules/zh/zh-latn-pinyin-transliteration.js similarity index 83% rename from rules/zh/zh-pinyin-transliteration.js rename to rules/zh/zh-latn-pinyin-transliteration.js index 9cfe0ae7..05c8803e 100644 --- a/rules/zh/zh-pinyin-transliteration.js +++ b/rules/zh/zh-latn-pinyin-transliteration.js @@ -1,10 +1,10 @@ ( function ( $ ) { 'use strict'; - var zhPinyinTransliteration = { - id: 'zh-pinyin-transliteration', - name: '拼音符号输入法', - description: 'Mandarin PinYin Transliteration input method', + var zhLatnPinyinTransliteration = { + id: 'zh-latn-pinyin-transliteration', + name: '拼音符号输入法 / 拼音符號輸入法', + description: 'Mandarin Pinyin Transliteration input method', date: '2018-12-28', URL: 'http://github.com/wikimedia/jquery.ime', author: 'Yuping Zuo', @@ -56,5 +56,5 @@ ] }; - $.ime.register( zhPinyinTransliteration ); + $.ime.register( zhLatnPinyinTransliteration ); }( jQuery ) ); diff --git a/src/jquery.ime.inputmethods.js b/src/jquery.ime.inputmethods.js index b8035a29..94cee281 100755 --- a/src/jquery.ime.inputmethods.js +++ b/src/jquery.ime.inputmethods.js @@ -1078,9 +1078,9 @@ name: 'Yorùbá tilde', source: 'rules/yo/yo-tilde.js' }, - 'zh-pinyin-transliteration': { - name: '拼音符号输入法', - source: 'rules/zh/zh-pinyin-transliteration.js' + 'zh-latn-pinyin-transliteration': { + name: '拼音符号输入法 / 拼音符號輸入法', + source: 'rules/zh/zh-latn-pinyin-transliteration.js' } } ); /* eslint-disable quote-props */ @@ -1856,7 +1856,39 @@ }, zh: { autonym: '中文', - inputmethods: [ 'zh-pinyin-transliteration' ] + inputmethods: [ 'zh-latn-pinyin-transliteration' ] + }, + 'zh-cn': { + autonym: '中文(中国大陆)', + inputmethods: [ 'zh-latn-pinyin-transliteration' ] + }, + 'zh-hans': { + autonym: '中文(简体)', + inputmethods: [ 'zh-latn-pinyin-transliteration' ] + }, + 'zh-hant': { + autonym: '中文(繁體)', + inputmethods: [ 'zh-latn-pinyin-transliteration' ] + }, + 'zh-hk': { + autonym: '中文(香港)', + inputmethods: [ 'zh-latn-pinyin-transliteration' ] + }, + 'zh-mo': { + autonym: '中文(澳門)', + inputmethods: [ 'zh-latn-pinyin-transliteration' ] + }, + 'zh-my': { + autonym: '中文(马来西亚)', + inputmethods: [ 'zh-latn-pinyin-transliteration' ] + }, + 'zh-sg': { + autonym: '中文(新加坡)', + inputmethods: [ 'zh-latn-pinyin-transliteration' ] + }, + 'zh-tw': { + autonym: '中文(臺灣)', + inputmethods: [ 'zh-latn-pinyin-transliteration' ] } } ); }( jQuery ) ); diff --git a/test/jquery.ime.test.fixtures.js b/test/jquery.ime.test.fixtures.js index 5b5af7f0..55ed14c9 100644 --- a/test/jquery.ime.test.fixtures.js +++ b/test/jquery.ime.test.fixtures.js @@ -7190,7 +7190,7 @@ var palochkaVariants = { }, { description: 'Chinese Pinyin test', - inputmethod: 'zh-pinyin-transliteration', + inputmethod: 'zh-latn-pinyin-transliteration', tests: [ { input: 'wen2', output: 'wén', description: 'Chinese Pinyin wén' }, { input: 'lv3', output: 'lǚ', description: 'Chinese Pinyin lǚ' },