Index: trunk/phase3/js2/mwEmbed/tests/testLangEn.js |
— | — | @@ -1,16 +0,0 @@ |
2 | | -/* a simple language tester replacements |
3 | | - */ |
4 | | - |
5 | | -loadGM({ |
6 | | - //test msg with English words to see whats going on |
7 | | - 'test_plural_msg' : '{{PLURAL:$1|one|other}}', |
8 | | - //sample real world msgs: |
9 | | - 'undelete_short' : 'Undelete {{PLURAL:$1|one edit|$1 edits}}', |
10 | | - 'category-subcat-count' : "fish {{PLURAL:$2|This {{PLURAL:$1|fistsub|$1 secondsub}} category has only the following subcategory.|This category has the following {{PLURAL:$1|subcategory|$1 subcategories}}, out of $2 total.}}" |
11 | | -}); |
12 | | - |
13 | | -$mw.lang.loadRS({ |
14 | | - 'PLURAL' : { "one":1 } |
15 | | -}); |
16 | | - |
17 | | -//need to run through script-loader |
\ No newline at end of file |
Index: trunk/phase3/js2/mwEmbed/tests/testLangRU.js |
— | — | @@ -1,29 +0,0 @@ |
2 | | -/* a simple language tester replacements |
3 | | - |
4 | | - */ |
5 | | - |
6 | | -loadGM({ |
7 | | - //test msg with english words to see whats going on |
8 | | - 'test_plural_msg' : '{{PLURAL:$1|one|few|many}}', |
9 | | - //sample real world msgs: |
10 | | - 'undelete_short' : 'Восстановить $1 {{PLURAL:$1|правку|правки|правок}}' |
11 | | -}); |
12 | | -$mw.lang.loadRS({ |
13 | | - 'PLURAL' : |
14 | | - { |
15 | | - "one":[{"mod":10,"is":1},{"mod":100,"not":11}], |
16 | | - "few":[{"mod":10,"is":"2-4"},{"mod":100,"not":"12-14"}], |
17 | | - "many":[{"mod":10,"is":0}, |
18 | | - "or", |
19 | | - {"mod":10,"is":"5-9"}, |
20 | | - "or", |
21 | | - {"mod":100,"is":"11-14"} |
22 | | - ] |
23 | | - } |
24 | | -}); |
25 | | -/* |
26 | | -one 1, 21, 31, 41, 51, 61... |
27 | | -few 2-4, 22-24, 32-34... |
28 | | -many 0, 5-20, 25-30, 35-40... |
29 | | -other 1.31, 2.31, 5.31... |
30 | | -*/ |
Index: trunk/phase3/js2/mwEmbed/tests/testLang.html |
— | — | @@ -2,15 +2,178 @@ |
3 | 3 | <head> |
4 | 4 | <title>Test Plural Conversions (should match php) </title> |
5 | 5 | <script type="text/javascript" src="../mv_embed.js"></script> |
6 | | -<script type="text/javascript" src="testLangEn.js"></script> |
7 | 6 | <style> |
8 | 7 | td{ |
9 | 8 | border:solid thin black; |
10 | 9 | } |
11 | 10 | </style> |
12 | 11 | <script type="text/javascript" > |
13 | | - var langKey = 'en'; |
| 12 | +//shortLangKey is an array of at least one language from every group in cldrConverter.php |
| 13 | +var shortLangKey = ['en','az', 'da', 'pt']; |
| 14 | + |
| 15 | +//longlangKey is every language we have a much more verbose test |
| 16 | +var longLangKey = [ |
| 17 | + //no plurals, there are no rules |
| 18 | + 'az','fa','hu','ja','ko','my to','tr','vi','yo','zh', |
| 19 | + 'bo','dz','id','jv ka','km','kn','ms','th', |
| 20 | + |
| 21 | + /* |
| 22 | + 'zero' => 0, |
| 23 | + 'one' => 1, |
| 24 | + 'two' => 2, |
| 25 | + //n mod 100 in 3..10 |
| 26 | + 'few' => array( 'mod' => 100, 'is'=>'3-10' ), |
| 27 | + //n mod 100 in 11..99 |
| 28 | + 'many' => array( 'mod' => 100, 'is'=>'11-99') |
| 29 | + */ |
| 30 | + 'ar', |
| 31 | + |
| 32 | + /* |
| 33 | + 'one' => 1 |
| 34 | + */ |
| 35 | + 'da','de','el','en','eo','es','et','fi','fo','gl', |
| 36 | + 'he','iw','it','nb','nl','nn','no','pt_PT','sv', |
| 37 | + 'af','bg','bn','ca','eu','fur','fy','gu','ha', |
| 38 | + 'is','ku','lb','ml','mr','nah','ne','om','or', |
| 39 | + 'pa','pap','ps','so','sq','sw','ta','te','tk', |
| 40 | + 'ur','zu','mn','gsw', |
| 41 | + |
| 42 | + /* |
| 43 | + 'one'=> '0-1' |
| 44 | + */ |
| 45 | + 'pt','am','bh','fil','tl','guw','hi','ln','mg','nso','ti','wa', |
| 46 | + |
| 47 | + /* |
| 48 | + 'one' => array( 'is'=>'0-2', 'not' => 2) |
| 49 | + */ |
| 50 | + 'fr', |
| 51 | + |
| 52 | + /* |
| 53 | + 'zero' => 0, |
| 54 | + //n mod 10 is 1 and n mod 100 is not 11 |
| 55 | + 'one'=>array( |
| 56 | + array( 'mod' => 10, 'is' => 1 ), |
| 57 | + //AND |
| 58 | + array( 'mod' => 100, 'not' => 11) |
| 59 | + ) |
| 60 | + */ |
| 61 | + 'lv', |
| 62 | + |
| 63 | + /* |
| 64 | + 'one' => 1, |
| 65 | + 'two' => 2 |
| 66 | + */ |
| 67 | + 'ga','se','sma','smi','smj','smn','sms', |
| 68 | + |
| 69 | + |
| 70 | + /* |
| 71 | + 'one' => 1, |
| 72 | + //n is 0 OR n is not 1 AND n mod 100 in 1..19 |
| 73 | + 'few' => array( |
| 74 | + 'or'=> array( |
| 75 | + array( 'is' => 0), |
| 76 | + array( |
| 77 | + array( 'not' => 1), |
| 78 | + //and |
| 79 | + array( 'mod' => 100, 'is'=>'1-19') |
| 80 | + ) |
| 81 | + ) |
| 82 | + ) |
| 83 | + */ |
| 84 | + 'ro','mo', |
| 85 | + |
| 86 | + |
| 87 | + /* |
| 88 | + //n mod 10 is 1 and n mod 100 not in 11..19 |
| 89 | + 'one' => array( |
| 90 | + array( 'mod'=>10, 'is'=> 1 ), |
| 91 | + array( 'mod'=> 100, 'not'=> '11-19') |
| 92 | + ), |
| 93 | + //n mod 10 in 2..9 and n mod 100 not in 11..19 |
| 94 | + 'few' => array( |
| 95 | + array( 'mod'=> 10, 'is'=> '2-9' ), |
| 96 | + array( 'mod'=> 100, 'not' => '11-19') |
| 97 | + ), |
| 98 | + */ |
| 99 | + 'lt', |
| 100 | + |
| 101 | + |
| 102 | + /* |
| 103 | + //n mod 10 is 1 and n mod 100 is not 11 |
| 104 | + 'one' => array( |
| 105 | + array( 'mod' => 10, 'is' => 1), |
| 106 | + array( 'mod' => 100, 'not' => 11) |
| 107 | + ), |
| 108 | + //n mod 10 in 2..4 and n mod 100 not in 12..14 |
| 109 | + 'few' => array( |
| 110 | + array( 'mod' => 10, 'is' => '2-4'), |
| 111 | + array( 'mod' => 100, 'not' => '12-14') |
| 112 | + ), |
| 113 | + //n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14 |
| 114 | + 'many' => array( |
| 115 | + 'or'=>array( |
| 116 | + array( 'mod'=> 10, 'is' => 0), |
| 117 | + array( 'mod'=> 10, 'is' => '5-9'), |
| 118 | + array( 'mod'=> 100, 'is' => '11-14') |
| 119 | + ) |
| 120 | + ), |
| 121 | + */ |
| 122 | + 'hr','ru','sr','uk','be','bs','sh', |
| 123 | + |
| 124 | + |
| 125 | + /* |
| 126 | + 'one' => 1, |
| 127 | + 'few' => array( |
| 128 | + //n mod 10 in 2..4 |
| 129 | + array( 'mod' => 10, 'is' => '2-4'), |
| 130 | + //and n mod 100 not in 12..14 |
| 131 | + array( 'mod' => 100, 'not'=> '12-14'), |
| 132 | + //and n mod 100 not in 22..24 |
| 133 | + array( 'mod' => 100, 'in' => '22-24') |
| 134 | + ) |
| 135 | + */ |
| 136 | + 'pl', |
| 137 | + |
| 138 | + /* |
| 139 | + 'one' => array( 'mod'=>100, 'is' => 1 ), |
| 140 | + 'two' => array( 'mod'=>100, 'is' => 2 ), |
| 141 | + 'few' => array( 'mod'=>100, 'is' => '3-4') |
| 142 | + */ |
| 143 | + 'sl', |
| 144 | + |
| 145 | + |
| 146 | + /* |
| 147 | + 'one' => 1, |
| 148 | + //n is 0 or n mod 100 in 2..10 |
| 149 | + 'few' => array( |
| 150 | + array( 'is' => 0 ), |
| 151 | + 'or', |
| 152 | + array( 'mod' => 100, 'is' => '2-10') |
| 153 | + ), |
| 154 | + //n mod 100 in 11..19 |
| 155 | + 'many' => array( 'mod'=>100, 'is' => '11-19') |
| 156 | + */ |
| 157 | + 'mt', |
| 158 | + |
| 159 | + /* |
| 160 | + 'one' => array('mod' => 10, 'is' => '1') |
| 161 | + */ |
| 162 | + 'mk', |
| 163 | + |
| 164 | + /* |
| 165 | + 'one' => 1, |
| 166 | + 'two' => 2, |
| 167 | + //n is 8 or n is 11 |
| 168 | + 'many' => array( |
| 169 | + array( 'is' => 8 ), |
| 170 | + array( 'is' => 11 ) |
| 171 | + )*/ |
| 172 | + 'cy' |
| 173 | +]; |
| 174 | + |
14 | 175 | js2AddOnloadHook( function(){ |
| 176 | + //do mauall script loaders calls to test multiple languages: |
| 177 | + |
15 | 178 | //build table output: |
16 | 179 | var o = '<table>'; |
17 | 180 | var msgTestSet = { |
Index: trunk/phase3/js2/mwEmbed/tests/testLang.js |
— | — | @@ -0,0 +1,17 @@ |
| 2 | +/* a simple language tester replacements |
| 3 | + */ |
| 4 | + |
| 5 | +loadGM({ |
| 6 | + //test msg with English words to see whats going on |
| 7 | + 'test_plural_msg' : '{{PLURAL:$1|one|other}}', |
| 8 | + //sample real world msgs: |
| 9 | + 'undelete_short' : 'Undelete {{PLURAL:$1|one edit|$1 edits}}', |
| 10 | + 'category-subcat-count' : "fish {{PLURAL:$2|This {{PLURAL:$1|fistsub|$1 secondsub}} category has only the following subcategory.|This category has the following {{PLURAL:$1|subcategory|$1 subcategories}}, out of $2 total.}}" |
| 11 | +}); |
| 12 | + |
| 13 | +$mw.lang.loadRS({ |
| 14 | + 'PLURAL' : { "one":1 } |
| 15 | +}); |
| 16 | + |
| 17 | +//define a class by the name of this file: |
| 18 | +$mw.testLang = {}; |
\ No newline at end of file |
Property changes on: trunk/phase3/js2/mwEmbed/tests/testLang.js |
___________________________________________________________________ |
Name: svn:mergeinfo |
1 | 19 | + /branches/REL1_15/phase3/js2/mwEmbed/tests/testLangEn.js:51646 |
Name: svn:eol-style |
2 | 20 | + native |
Index: trunk/phase3/js2/mwEmbed/php/languages/cldrConverter.php |
— | — | @@ -76,11 +76,13 @@ |
77 | 77 | 'one' => 1, |
78 | 78 | //n is 0 OR n is not 1 AND n mod 100 in 1..19 |
79 | 79 | 'few' => array( |
80 | | - array( 'is' => 0), |
81 | | - 'or', |
82 | | - array( |
83 | | - array( 'not' => 1), |
84 | | - array( 'mod' => 100, 'is'=>'1-19') |
| 80 | + 'or'=> array( |
| 81 | + array( 'is' => 0), |
| 82 | + array( |
| 83 | + array( 'not' => 1), |
| 84 | + //and |
| 85 | + array( 'mod' => 100, 'is'=>'1-19') |
| 86 | + ) |
85 | 87 | ) |
86 | 88 | ) |
87 | 89 | ) |
— | — | @@ -113,11 +115,11 @@ |
114 | 116 | ), |
115 | 117 | //n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14 |
116 | 118 | 'many' => array( |
117 | | - array( 'mod'=> 10, 'is' => 0), |
118 | | - 'or', |
119 | | - array( 'mod'=> 10, 'is' => '5-9'), |
120 | | - 'or', |
121 | | - array( 'mod'=> 100, 'is' => '11-14') |
| 119 | + 'or'=>array( |
| 120 | + array( 'mod'=> 10, 'is' => 0), |
| 121 | + array( 'mod'=> 10, 'is' => '5-9'), |
| 122 | + array( 'mod'=> 100, 'is' => '11-14') |
| 123 | + ) |
122 | 124 | ), |
123 | 125 | ) |
124 | 126 | ), |
Index: trunk/phase3/js2/mwEmbed/binPlayers/cortado/cortado-ovt-stripped-0.5.0.jar |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -59,9 +59,10 @@ |
60 | 60 | * |
61 | 61 | * Right now the PHP AutoLoader only reads this mv_embed.js file. |
62 | 62 | * In the future we could have multiple lcPath calls that PHP reads |
63 | | - * (if our autoloading class list becomes too long) just have to add those |
64 | | - * files to the jsAutoLoader file list. |
65 | | - * (ie extensions that want to use the autoloader) |
| 63 | + * (if our autoloading class list becomes too long) |
| 64 | + * or |
| 65 | + * we could support direct file requests to the script loader instead |
| 66 | + * of shared class names read from a central location. |
66 | 67 | */ |
67 | 68 | lcPaths({ |
68 | 69 | "mv_embed" : "mv_embed.js", |
— | — | @@ -75,8 +76,10 @@ |
76 | 77 | "$j.Jcrop" : "libClipEdit/Jcrop/js/jquery.Jcrop.js", |
77 | 78 | "$j.fn.simpleUploadForm" : "libAddMedia/simpleUploadForm.js", |
78 | 79 | |
79 | | - "$mw.proxy" : "libMwApi/mw.proxy.js", |
| 80 | + "$mw.proxy" : "libMwApi/mw.proxy.js", |
80 | 81 | |
| 82 | + "$mw.testLang" : "tests/testLang.js", |
| 83 | + |
81 | 84 | "ctrlBuilder" : "skins/ctrlBuilder.js", |
82 | 85 | "kskinConfig" : "skins/kskin/kskin.js", |
83 | 86 | "mvpcfConfig" : "skins/mvpcf/mvpcf.js", |