r103740 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103739‎ | r103740 | r103741 >
Date:09:47, 20 November 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
Narayam keymapping for Punjabi in Gurmukhi script, based on Fedora keyboard layout (phonetic one).
Modified paths:
  • /trunk/extensions/Narayam/Narayam.i18n.php (modified) (history)
  • /trunk/extensions/Narayam/Narayam.php (modified) (history)
  • /trunk/extensions/Narayam/js/ext.narayam.rules.pa-phonetic.js (added) (history)

Diff [purge]

Index: trunk/extensions/Narayam/Narayam.i18n.php
@@ -42,6 +42,7 @@
4343 'narayam-ne-inscript' => 'Nepali InScript',
4444 'narayam-or' => 'Oriya Transliteration',
4545 'narayam-or-inscript' => 'Oriya InScript',
 46+ 'narayam-pa-phonetic' => 'Gurmukhi Punjabi Phonetic',
4647 'narayam-pa-inscript' => 'Gurmukhi Punjabi InScript',
4748 'narayam-sa' => 'Sanskrit Transliteration',
4849 'narayam-sa-inscript' => 'Sanskrit InScript',
Index: trunk/extensions/Narayam/js/ext.narayam.rules.pa-phonetic.js
@@ -0,0 +1,99 @@
 2+/**
 3+ * Phonetic keyboard regular expression rules table for Punjabi
 4+ * @date 2011-11-19
 5+ * Based on http://fedoraproject.org/wiki/I18N/Indic/PunjabiKeyboardLayouts
 6+ */
 7+
 8+ // Normal rules
 9+var rules = [
 10+ ['!', '','੧'],
 11+ ['1', '','1'],
 12+ ['@', '','੨'],
 13+ ['2', '','2'],
 14+ ['#', '','੩'],
 15+ ['3', '','3'],
 16+ ['\\$', '','੪'],
 17+ ['4', '','4'],
 18+ ['5', '','5'],
 19+ ['6', '','6'],
 20+ ['7', '','7'],
 21+ ['8', '','8'],
 22+ ['\\)', '','੯'],
 23+ ['9', '','9'],
 24+ ['\\),', '','੦'],
 25+ ['0', '','0'],
 26+ ['Q', '','ਥ'],
 27+ ['q', '','ਤ'],
 28+ ['w', '','ਾ'],
 29+ ['E', '','ਓ'],
 30+ ['e', '','ੲ'],
 31+ ['r', '','ਰ'],
 32+ ['T', '','ਠ'],
 33+ ['t', '','ਟ'],
 34+ ['Y', '','ੈ'],
 35+ ['y', '','ੇ'],
 36+ ['U', '','ੂ'],
 37+ ['u', '','ੁ'],
 38+ ['I', '','ੀ'],
 39+ ['i', '','ਿ'],
 40+ ['O', '','ੌ'],
 41+ ['o', '','ੋ'],
 42+ ['P', '','ਫ'],
 43+ ['p', '','ਪ'],
 44+ ['\\{', '','('],
 45+ ['\\}', '',')'],
 46+ ['A', '','ਅ'],
 47+ ['a', '','ੳ'],
 48+ ['S', '','ਸ਼'],
 49+ ['s', '','ਸ'],
 50+ ['D', '','ਧ'],
 51+ ['d', '','ਦ'],
 52+ ['F', '','ਢ'],
 53+ ['f', '','ਡ'],
 54+ ['G', '','ਘ'],
 55+ ['g', '','ਗ'],
 56+ ['h', '','ਹ'],
 57+ ['J', '','ਝ'],
 58+ ['j', '','ਜ'],
 59+ ['K', '','ਖ'],
 60+ ['k', '','ਕ'],
 61+ ['L', '','ਲ਼'],
 62+ ['l', '','ਲ'],
 63+ ['\\', '','ਙ'],
 64+ ['\\~', '','?ੱ'],
 65+ ['\\`', '','?੍ '],
 66+ ['Z', '','ਗ਼'],
 67+ ['z', '','ਜ਼'],
 68+ ['X', '','ਯ'],
 69+ ['x', '','ਣ'],
 70+ ['C', '','ਛ'],
 71+ ['c', '','ਚ'],
 72+ ['V', '','ੜ'],
 73+ ['v', '','ਵ'],
 74+ ['B', '','ਭ'],
 75+ ['b', '','ਬ'],
 76+ ['N', '','ਂ'],
 77+ ['n', '','ਨ'],
 78+ ['M', '','ੰ'],
 79+ ['m', '','ਮ'],
 80+ ['\\<', '','ਖ਼'],
 81+ ['\\>', '','ੴ'],
 82+ ['\\.', '','?਼'],
 83+ ['\\?', '','?'],
 84+ ['\\/', '','ਞ'],
 85+ ['%', '','੫'],
 86+ ['\\^', '','੬'],
 87+ ['&', '','੭'],
 88+ ['*', '','੮'],
 89+ ['R', '','੍ਰ'],
 90+ ['H', '','੍ਹ'],
 91+ ['W', '','ਾਂ']
 92+];
 93+
 94+jQuery.narayam.addScheme( 'pa-phonetic', {
 95+ 'namemsg': 'narayam-pa-phonetic',
 96+ 'extended_keyboard': true,
 97+ 'lookbackLength': 0,
 98+ 'keyBufferLength': 0,
 99+ 'rules': rules
 100+} );
Index: trunk/extensions/Narayam/Narayam.php
@@ -96,6 +96,7 @@
9797 ),
9898 'pa' => array(
9999 'pa-inscript' => 'ext.narayam.rules.pa-inscript',
 100+ 'pa-phonetic' => 'ext.narayam.rules.pa-phonetic',
100101 ),
101102 'sa' => array(
102103 'sa' => 'ext.narayam.rules.sa',
@@ -182,6 +183,7 @@
183184 'narayam-or',
184185 'narayam-or-inscript',
185186 'narayam-pa-inscript',
 187+ 'narayam-pa-phonetic',
186188 'narayam-sa',
187189 'narayam-sa-inscript',
188190 'narayam-si-singlish',
@@ -298,6 +300,10 @@
299301 'scripts' => 'js/ext.narayam.rules.pa-inscript.js',
300302 'dependencies' => 'ext.narayam.core',
301303 );
 304+$wgResourceModules['ext.narayam.rules.pa-phonetic'] = $narayamTpl + array(
 305+ 'scripts' => 'js/ext.narayam.rules.pa-phonetic.js',
 306+ 'dependencies' => 'ext.narayam.core',
 307+);
302308 $wgResourceModules['ext.narayam.rules.sa'] = $narayamTpl + array(
303309 'scripts' => 'js/ext.narayam.rules.sa.js',
304310 'dependencies' => 'ext.narayam.core',

Follow-up revisions

RevisionCommit summaryAuthorDate
r104840Escape the * key, change extended_keyboard as false since this is not an exte...santhosh06:18, 1 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   05:30, 25 November 2011

Does * need to be also quoted?

#Comment by Santhosh.thottingal (talk | contribs)   06:19, 1 December 2011

r104840 escaped the * and changed the extended_keyboard as false.

Status & tagging log