OLD | NEW |
---|---|
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script> | 4 <script> |
5 | 5 |
6 function setUpPage() { | 6 function setUpPage() { |
7 loadTimeData.data = { | 7 loadTimeData.data = { |
8 'allowedByDefault': '<a href="https://google.com">Google!</a>', | 8 'allowedByDefault': '<a href="https://google.com">Google!</a>', |
9 'customAttr': '<a is="action-link">Take action!</a>', | 9 'customAttr': '<a is="action-link">Take action!</a>', |
10 'customTag': "<x-foo>I'm an X, foo!</x-foo>", | 10 'customTag': "<x-foo>I'm an X, foo!</x-foo>", |
(...skipping 17 matching lines...) Expand all Loading... | |
28 I18nBehavior.i18nAdvanced('customAttr', { | 28 I18nBehavior.i18nAdvanced('customAttr', { |
29 attrs: { | 29 attrs: { |
30 is: function(el, val) { | 30 is: function(el, val) { |
31 return el.tagName == 'A' && val == 'action-link'; | 31 return el.tagName == 'A' && val == 'action-link'; |
32 }, | 32 }, |
33 }, | 33 }, |
34 }); | 34 }); |
35 I18nBehavior.i18nAdvanced('customTag', {tags: ['X-FOO']}); | 35 I18nBehavior.i18nAdvanced('customTag', {tags: ['X-FOO']}); |
36 } | 36 } |
37 | 37 |
38 function testI18nDynamic() { | |
39 var locale = 'en'; | |
40 assertEquals("I'm just text, nobody should have a problem with me!", | |
xiyuan
2017/05/31 15:38:41
nit: " -> ' ?
dschuyler
2017/05/31 18:23:16
I could go either way on this, but there does seem
xiyuan
2017/05/31 18:31:50
Both JS style guides (google or chromium) prefer '
| |
41 I18nBehavior.i18nDynamic(locale, 'text')); | |
42 } | |
Dan Beam
2017/05/24 02:08:45
hmmmm, seems like we could make a more comprehensi
dschuyler
2017/05/31 18:23:16
I plan to follow up on this later (tests and the f
| |
43 | |
38 function testI18nExists() { | 44 function testI18nExists() { |
39 assertTrue(I18nBehavior.i18nExists('text')); | 45 assertTrue(I18nBehavior.i18nExists('text')); |
40 assertFalse(I18nBehavior.i18nExists('missingText')); | 46 assertFalse(I18nBehavior.i18nExists('missingText')); |
41 } | 47 } |
42 | 48 |
43 </script> | 49 </script> |
44 </body> | 50 </body> |
45 </html> | 51 </html> |
OLD | NEW |