-
Notifications
You must be signed in to change notification settings - Fork 601
/
Copy pathcore-runtime.js
51 lines (43 loc) · 1.45 KB
/
core-runtime.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
define([
"./common/create-error",
"./common/format-message",
"./common/format-message-to-parts",
"./common/parts/join",
"./common/parts/push",
"./common/runtime-key",
"./common/validate/parameter-presence",
"./common/validate/parameter-type",
"./common/validate/parameter-type/string",
"./util/regexp/escape",
"./util/string/pad"
], function( createError, formatMessage, formatMessageToParts, partsJoin, partsPush, runtimeKey,
validateParameterPresence, validateParameterType, validateParameterTypeString, regexpEscape,
stringPad ) {
function Globalize( locale ) {
if ( !( this instanceof Globalize ) ) {
return new Globalize( locale );
}
validateParameterPresence( locale, "locale" );
validateParameterTypeString( locale, "locale" );
this._locale = locale;
}
Globalize.locale = function( locale ) {
validateParameterTypeString( locale, "locale" );
if ( arguments.length ) {
this._locale = locale;
}
return this._locale;
};
Globalize._createError = createError;
Globalize._formatMessage = formatMessage;
Globalize._formatMessageToParts = formatMessageToParts;
Globalize._partsJoin = partsJoin;
Globalize._partsPush = partsPush;
Globalize._regexpEscape = regexpEscape;
Globalize._runtimeKey = runtimeKey;
Globalize._stringPad = stringPad;
Globalize._validateParameterPresence = validateParameterPresence;
Globalize._validateParameterTypeString = validateParameterTypeString;
Globalize._validateParameterType = validateParameterType;
return Globalize;
});