From 01db9d86284854ba4f902d08eb7f35e12094f7db Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Fri, 9 Aug 2024 23:15:16 +0200 Subject: [PATCH] Add Duala Tilde keyboard Downstream task: https://phabricator.wikimedia.org/T372173 --- rules/dua/dua-tilde.js | 35 ++++++++++++++++++++++++++++++++ src/jquery.ime.inputmethods.js | 8 ++++++++ test/jquery.ime.test.fixtures.js | 21 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 rules/dua/dua-tilde.js diff --git a/rules/dua/dua-tilde.js b/rules/dua/dua-tilde.js new file mode 100644 index 00000000..ee33178f --- /dev/null +++ b/rules/dua/dua-tilde.js @@ -0,0 +1,35 @@ +( function ( $ ) { + 'use strict'; + + var duaTilde = { + id: 'dua-tilde', + name: 'Duala tilde', + description: 'Duala tilde keyboard', + date: '2024-08-09', + URL: 'https://github.com/wikimedia/jquery.ime', + author: 'Amir E. Aharoni', + license: 'GPLv3', + version: '1.0', + maxKeyLength: 2, + patterns: [ + [ '~B', 'Ɓ' ], + [ '~b', 'ɓ' ], + [ '~D', 'Ɗ' ], + [ '~d', 'ɗ' ], + [ '~E', 'Ɛ' ], + [ '~e', 'ɛ' ], + [ '~N', 'Ŋ' ], + [ '~n', 'ŋ' ], + [ '~j', 'ɲ' ], + [ '~J', 'Ɲ' ], + [ '~O', 'Ɔ' ], + [ '~o', 'ɔ' ], + [ '~\\\\', '\u0300' ], // Combining grave accent + [ '~/', '\u0301' ], // Combining acute accent + [ '~\\^', '\u0302' ], // Combining circumflex accent + [ '~v', '\u030C' ] // Combining caron + ] + }; + + $.ime.register( duaTilde ); +}( jQuery ) ); diff --git a/src/jquery.ime.inputmethods.js b/src/jquery.ime.inputmethods.js index e0a8ac1e..94c5c403 100755 --- a/src/jquery.ime.inputmethods.js +++ b/src/jquery.ime.inputmethods.js @@ -244,6 +244,10 @@ name: 'इनस्क्रिप्ट २', source: 'rules/doi/doi-inscript2.js' }, + 'dua-tilde': { + name: 'Duala tilde keyboard', + source: 'rules/dua/dua-tilde.js' + }, 'ee-tilde': { name: 'Ewe Tilde', source: 'rules/ee/ee-tilde.js' @@ -1182,6 +1186,10 @@ autonym: 'डोगरी', inputmethods: [ 'doi-inscript2' ] }, + dua: { + autonym: 'Duálá', + inputmethods: [ 'dua-tilde' ] + }, en: { autonym: 'English', inputmethods: [ 'ipa-sil', 'ipa-x-sampa' ] diff --git a/test/jquery.ime.test.fixtures.js b/test/jquery.ime.test.fixtures.js index 5e96f6a2..a1e8897f 100644 --- a/test/jquery.ime.test.fixtures.js +++ b/test/jquery.ime.test.fixtures.js @@ -1482,6 +1482,27 @@ var palochkaVariants = { { input: '/', output: 'य', description: 'Dogri InScript 2 /' } ] }, + { + description: 'Duala tilde input method test', + inputmethod: 'dua-tilde', + tests: [ + { input: '~b', output: 'ɓ', description: 'Duala tilde ~b' }, + { input: '~B', output: 'Ɓ', description: 'Duala tilde ~B' }, + { input: '~d', output: 'ɗ', description: 'Duala tilde ~d' }, + { input: '~D', output: 'Ɗ', description: 'Duala tilde ~D' }, + { input: '~e', output: 'ɛ', description: 'Duala tilde ~e' }, + { input: '~E', output: 'Ɛ', description: 'Duala tilde ~E' }, + { input: '~n', output: 'ŋ', description: 'Duala tilde ~n' }, + { input: '~N', output: 'Ŋ', description: 'Duala tilde ~N' }, + { input: '~j', output: 'ɲ', description: 'Duala tilde ~j' }, + { input: '~J', output: 'Ɲ', description: 'Duala tilde ~J' }, + { input: '~O', output: 'Ɔ', description: 'Duala tilde ~O' }, + { input: '~o', output: 'ɔ', description: 'Duala tilde ~o' }, + { input: 'Dua~/la~/', output: 'Duálá', description: 'Duala tilde Duálá' }, + { input: 'mule~vdi', output: 'mulědi', description: 'Duala tilde mulědi' }, + { input: 'a~\\o~^', output: 'àô', description: 'Duala tilde àô' }, + ] + }, { description: 'Ewe tilde test', inputmethod: 'ee-tilde',