Last change
on this file since 257 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
File size:
1.1 KB
|
Line | |
---|
1 | define([ |
---|
2 | "dojo/_base/lang", |
---|
3 | "dojo/i18n", |
---|
4 | "dijit/_WidgetBase" |
---|
5 | ], function(lang, di18n, WidgetBase){ |
---|
6 | |
---|
7 | /*===== |
---|
8 | var WidgetBase = dijit._WidgetBase; |
---|
9 | =====*/ |
---|
10 | |
---|
11 | // module: |
---|
12 | // dojox/mobile/i18n |
---|
13 | // summary: |
---|
14 | // An internationalization utility for dojox.mobile-based user |
---|
15 | // applications. |
---|
16 | |
---|
17 | var i18n = lang.getObject("dojox.mobile.i18n", true); |
---|
18 | /*===== |
---|
19 | var i18n = dojox.mobile.i18n; |
---|
20 | =====*/ |
---|
21 | |
---|
22 | i18n.load = function(/*String*/packageName, /*String*/bundleName, /*String?*/locale){ |
---|
23 | // summary: |
---|
24 | // Loads an nls resouce bundle and returns an array of localized |
---|
25 | // resources. |
---|
26 | return i18n.registerBundle(di18n.getLocalization(packageName, bundleName, locale)); |
---|
27 | }; |
---|
28 | |
---|
29 | i18n.registerBundle = function(/*Array*/bundle){ |
---|
30 | // summary: |
---|
31 | // Accumulates the given localized resouces in an array and returns |
---|
32 | // it. |
---|
33 | if(!i18n.bundle){ i18n.bundle = []; } |
---|
34 | return lang.mixin(i18n.bundle, bundle); |
---|
35 | }; |
---|
36 | |
---|
37 | lang.extend(WidgetBase, { |
---|
38 | mblNoConv: false, |
---|
39 | _cv: function(s){ |
---|
40 | if(this.mblNoConv || !i18n.bundle){ return s; } |
---|
41 | return i18n.bundle[lang.trim(s)] || s; |
---|
42 | } |
---|
43 | }); |
---|
44 | |
---|
45 | return i18n; |
---|
46 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.