Pyrogenesis  trunk
JSInterface_L10n.h
Go to the documentation of this file.
1 /* Copyright (C) 2017 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INCLUDED_JSINTERFACE_L10N
19 #define INCLUDED_JSINTERFACE_L10N
20 
23 
24 /**
25  * Namespace for the functions of the JavaScript interface for
26  * internationalization and localization.
27  *
28  * This namespace defines JavaScript interfaces to functions defined in L10n and
29  * related helper functions.
30  *
31  * @sa http://trac.wildfiregames.com/wiki/Internationalization_and_Localization
32  */
33 namespace JSI_L10n
34 {
35  /**
36  * Registers the functions of the JavaScript interface for
37  * internationalization and localization into the specified JavaScript
38  * context.
39  *
40  * @param ScriptInterface JavaScript context where RegisterScriptFunctions()
41  * registers the functions.
42  *
43  * @sa GuiScriptingInit()
44  */
46 
47  /**
48  * Returns the translation of the specified string to the
49  * @link L10n::GetCurrentLocale() current locale@endlink.
50  *
51  * This is a JavaScript interface to L10n::Translate().
52  *
53  * @param pCxPrivate JavaScript context.
54  * @param sourceString String to translate to the current locale.
55  * @return Translation of @p sourceString to the current locale, or
56  * @p sourceString if there is no translation available.
57  */
58  std::wstring Translate(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::wstring& sourceString);
59 
60  /**
61  * Returns the translation of the specified string to the
62  * @link L10n::GetCurrentLocale() current locale@endlink in the specified
63  * context.
64  *
65  * This is a JavaScript interface to L10n::TranslateWithContext().
66  *
67  * @param pCxPrivate JavaScript context.
68  * @param context Context where the string is used. See
69  * http://www.gnu.org/software/gettext/manual/html_node/Contexts.html
70  * @param sourceString String to translate to the current locale.
71  * @return Translation of @p sourceString to the current locale in the
72  * specified @p context, or @p sourceString if there is no
73  * translation available.
74  */
75  std::wstring TranslateWithContext(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& context, const std::wstring& sourceString);
76 
77  /**
78  * Returns the translation of the specified string to the
79  * @link L10n::GetCurrentLocale() current locale@endlink based on the
80  * specified number.
81  *
82  * This is a JavaScript interface to L10n::TranslatePlural().
83  *
84  * @param pCxPrivate JavaScript context.
85  * @param singularSourceString String to translate to the current locale,
86  * in English’ singular form.
87  * @param pluralSourceString String to translate to the current locale, in
88  * English’ plural form.
89  * @param number Number that determines the required form of the translation
90  * (or the English string if no translation is available).
91  * @return Translation of the source string to the current locale for the
92  * specified @p number, or either @p singularSourceString (if
93  * @p number is 1) or @p pluralSourceString (if @p number is not 1)
94  * if there is no translation available.
95  */
96  std::wstring TranslatePlural(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::wstring& singularSourceString, const std::wstring& pluralSourceString, int number);
97 
98  /**
99  * Returns the translation of the specified string to the
100  * @link L10n::GetCurrentLocale() current locale@endlink in the specified
101  * context, based on the specified number.
102  *
103  * This is a JavaScript interface to L10n::TranslatePluralWithContext().
104  *
105  * @param pCxPrivate JavaScript context.
106  * @param context Context where the string is used. See
107  * http://www.gnu.org/software/gettext/manual/html_node/Contexts.html
108  * @param singularSourceString String to translate to the current locale,
109  * in English’ singular form.
110  * @param pluralSourceString String to translate to the current locale, in
111  * English’ plural form.
112  * @param number Number that determines the required form of the translation
113  * (or the English string if no translation is available). *
114  * @return Translation of the source string to the current locale in the
115  * specified @p context and for the specified @p number, or either
116  * @p singularSourceString (if @p number is 1) or
117  * @p pluralSourceString (if @p number is not 1) if there is no
118  * translation available.
119  */
120  std::wstring TranslatePluralWithContext(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& context, const std::wstring& singularSourceString, const std::wstring& pluralSourceString, int number);
121 
122  /**
123  * Translates a text line by line to the
124  * @link L10n::GetCurrentLocale() current locale@endlink.
125  *
126  * TranslateLines() is helpful when you need to translate a plain text file
127  * after you load it.
128  *
129  * This is a JavaScript interface to L10n::TranslateLines().
130  *
131  * @param pCxPrivate JavaScript context.
132  * @param sourceString Text to translate to the current locale.
133  * @return Line by line translation of @p sourceString to the current
134  * locale. Some of the lines in the returned text may be in English
135  * because there was not translation available for them.
136  */
137  std::wstring TranslateLines(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::wstring& sourceString);
138 
139  /**
140  * Translate each of the strings of a JavaScript array to the
141  * @link L10n::GetCurrentLocale() current locale@endlink.
142  *
143  * This is a helper function that loops through the items of the input array
144  * and calls L10n::Translate() on each of them.
145  *
146  * @param pCxPrivate JavaScript context.
147  * @param sourceArray JavaScript array of strings to translate to the
148  * current locale.
149  * @return Item by item translation of @p sourceArray to the current locale.
150  * Some of the items in the returned array may be in English because
151  * there was not translation available for them.
152  */
153  std::vector<std::wstring> TranslateArray(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::vector<std::wstring>& sourceArray);
154 
155  /**
156  * Returns the specified date converted to the local timezone using the specified date format.
157  *
158  * This is a JavaScript interface to
159  * L10n::FormatMillisecondsIntoDateString().
160  *
161  * @param pCxPrivate JavaScript context.
162  * @param milliseconds Date specified as a UNIX timestamp in milliseconds
163  * (not seconds). If you have a JavaScript @c ​Date object, you can
164  * use @c ​Date.getTime() to obtain the UNIX time in milliseconds.
165  * @param formatString Date format string defined using ICU date formatting
166  * symbols. Usually, you internationalize the format string and
167  * get it translated before you pass it to
168  * FormatMillisecondsIntoDateString().
169  * @return String containing the specified date with the specified date
170  * format.
171  *
172  * @sa http://en.wikipedia.org/wiki/Unix_time
173  * @sa https://sites.google.com/site/icuprojectuserguide/formatparse/datetime?pli=1#TOC-Date-Field-Symbol-Table
174  */
175  std::wstring FormatMillisecondsIntoDateStringLocal(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), UDate milliseconds, const std::wstring& formatString);
176 
177  /**
178  * Returns the specified date in GMT using the specified date format.
179  *
180  * This is a JavaScript interface to
181  * L10n::FormatMillisecondsIntoDateString().
182  *
183  * @param pCxPrivate JavaScript context.
184  * @param milliseconds Date specified as a UNIX timestamp in milliseconds
185  * (not seconds). If you have a JavaScript @c ​Date object, you can
186  * use @c ​Date.getTime() to obtain the UNIX time in milliseconds.
187  * @param formatString Date format string defined using ICU date formatting
188  * symbols. Usually, you internationalize the format string and
189  * get it translated before you pass it to
190  * FormatMillisecondsIntoDateString().
191  * @return String containing the specified date with the specified date
192  * format.
193  *
194  * @sa http://en.wikipedia.org/wiki/Unix_time
195  * @sa https://sites.google.com/site/icuprojectuserguide/formatparse/datetime?pli=1#TOC-Date-Field-Symbol-Table
196  */
197  std::wstring FormatMillisecondsIntoDateStringGMT(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), UDate milliseconds, const std::wstring& formatString);
198 
199  /**
200  * Returns the specified floating-point number as a string, with the number
201  * formatted as a decimal number using the
202  * @link L10n::GetCurrentLocale() current locale@endlink.
203  *
204  * This is a JavaScript interface to L10n::FormatDecimalNumberIntoString().
205  *
206  * @param pCxPrivate JavaScript context.
207  * @param number Number to format.
208  * @return Decimal number formatted using the current locale.
209  */
210  std::wstring FormatDecimalNumberIntoString(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), double number);
211 
212  /**
213  * Returns an array of supported locale codes sorted alphabetically.
214  *
215  * A locale code is a string such as "de" or "pt_BR".
216  *
217  * If yours is a development copy (the ‘config/dev.cfg’ file is found in the
218  * virtual filesystem), the output array may include the special “long”
219  * locale code.
220  *
221  * This is a JavaScript interface to L10n::GetSupportedLocaleBaseNames().
222  *
223  * @param pCxPrivate JavaScript context.
224  * @return Array of supported locale codes.
225  *
226  * @sa GetSupportedLocaleDisplayNames()
227  * @sa GetAllLocales()
228  * @sa GetCurrentLocale()
229  *
230  * @sa http://trac.wildfiregames.com/wiki/Implementation_of_Internationalization_and_Localization#LongStringsLocale
231  */
232  std::vector<std::string> GetSupportedLocaleBaseNames(ScriptInterface::CxPrivate* UNUSED(pCxPrivate));
233 
234  /**
235  * Returns an array of supported locale names sorted alphabetically by
236  * locale code.
237  *
238  * A locale code is a string such as "de" or "pt_BR".
239  *
240  * If yours is a development copy (the ‘config/dev.cfg’ file is found in the
241  * virtual filesystem), the output array may include the special “Long
242  * Strings” locale name.
243  *
244  * This is a JavaScript interface to L10n::GetSupportedLocaleDisplayNames().
245  *
246  * @param pCxPrivate JavaScript context.
247  * @return Array of supported locale codes.
248  *
249  * @sa GetSupportedLocaleBaseNames()
250  *
251  * @sa http://trac.wildfiregames.com/wiki/Implementation_of_Internationalization_and_Localization#LongStringsLocale
252  */
253  std::vector<std::wstring> GetSupportedLocaleDisplayNames(ScriptInterface::CxPrivate* UNUSED(pCxPrivate));
254 
255  /**
256  * Returns the code of the current locale.
257  *
258  * A locale code is a string such as "de" or "pt_BR".
259  *
260  * This is a JavaScript interface to L10n::GetCurrentLocaleString().
261  *
262  * @param pCxPrivate JavaScript context.
263  *
264  * @sa GetSupportedLocaleBaseNames()
265  * @sa GetAllLocales()
266  * @sa ReevaluateCurrentLocaleAndReload()
267  */
268  std::string GetCurrentLocale(ScriptInterface::CxPrivate* UNUSED(pCxPrivate));
269 
270  /**
271  * Returns an array of locale codes supported by ICU.
272  *
273  * A locale code is a string such as "de" or "pt_BR".
274  *
275  * This is a JavaScript interface to L10n::GetAllLocales().
276  *
277  * @param pCxPrivate JavaScript context.
278  * @return Array of supported locale codes.
279  *
280  * @sa GetSupportedLocaleBaseNames()
281  * @sa GetCurrentLocale()
282  *
283  * @sa http://www.icu-project.org/apiref/icu4c/classicu_1_1Locale.html#a073d70df8c9c8d119c0d42d70de24137
284  */
285  std::vector<std::string> GetAllLocales(ScriptInterface::CxPrivate* UNUSED(pCxPrivate));
286 
287  /**
288  * Returns the code of the recommended locale for the current user that the
289  * game supports.
290  *
291  * “That the game supports” means both that a translation file is available
292  * for that locale and that the locale code is either supported by ICU or
293  * the special “long” locale code.
294  *
295  * The mechanism to select a recommended locale follows this logic:
296  * 1. First see if the game supports the specified locale,\n
297  * @p configLocale.
298  * 2. Otherwise, check the system locale and see if the game supports\n
299  * that locale.
300  * 3. Else, return the default locale, ‘en_US’.
301  *
302  * This is a JavaScript interface to L10n::GetDictionaryLocale(std::string).
303  *
304  * @param pCxPrivate JavaScript context.
305  * @param configLocale Locale to check for support first. Pass an empty
306  * string to check the system locale directly.
307  * @return Code of a locale that the game supports.
308  *
309  * @sa http://trac.wildfiregames.com/wiki/Implementation_of_Internationalization_and_Localization#LongStringsLocale
310  */
311  std::string GetDictionaryLocale(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& configLocale);
312 
313  /**
314  * Returns an array of paths to files in the virtual filesystem that provide
315  * translations for the specified locale code.
316  *
317  * This is a JavaScript interface to L10n::GetDictionariesForLocale().
318  *
319  * @param pCxPrivate JavaScript context.
320  * @param locale Locale code.
321  * @return Array of paths to files in the virtual filesystem that provide
322  * translations for @p locale.
323  */
324  std::vector<std::wstring> GetDictionariesForLocale(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& locale);
325 
326  /**
327  * Returns the ISO-639 language code of the specified locale code.
328  *
329  * For example, if you specify the ‘en_US’ locate, it returns ‘en’.
330  *
331  * This is a JavaScript interface to L10n::GetLocaleLanguage().
332  *
333  * @param pCxPrivate JavaScript context.
334  * @param locale Locale code.
335  * @return Language code.
336  *
337  * @sa http://www.icu-project.org/apiref/icu4c/classicu_1_1Locale.html#af36d821adced72a870d921ebadd0ca93
338  */
339  std::string GetLocaleLanguage(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& locale);
340 
341  /**
342  * Returns the programmatic code of the entire locale without keywords.
343  *
344  * This is a JavaScript interface to L10n::GetLocaleBaseName().
345  *
346  * @param pCxPrivate JavaScript context.
347  * @param locale Locale code.
348  * @return Locale code without keywords.
349  *
350  * @sa http://www.icu-project.org/apiref/icu4c/classicu_1_1Locale.html#a4c1acbbdf95dc15599db5f322fa4c4d0
351  */
352  std::string GetLocaleBaseName(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& locale);
353 
354  /**
355  * Returns the ISO-3166 country code of the specified locale code.
356  *
357  * For example, if you specify the ‘en_US’ locate, it returns ‘US’.
358  *
359  * This is a JavaScript interface to L10n::GetLocaleCountry().
360  *
361  * @param pCxPrivate JavaScript context.
362  * @param locale Locale code.
363  * @return Country code.
364  *
365  * @sa http://www.icu-project.org/apiref/icu4c/classicu_1_1Locale.html#ae3f1fc415c00d4f0ab33288ceadccbf9
366  */
367  std::string GetLocaleCountry(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& locale);
368 
369  /**
370  * Returns the ISO-15924 abbreviation script code of the specified locale code.
371  *
372  * This is a JavaScript interface to L10n::GetLocaleScript().
373  *
374  * @param pCxPrivate JavaScript context.
375  * @param locale Locale code.
376  * @return Script code.
377  *
378  * @sa http://www.icu-project.org/apiref/icu4c/classicu_1_1Locale.html#a5e0145a339d30794178a1412dcc55abe
379  */
380  std::string GetLocaleScript(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& locale);
381 
382 
383  std::wstring GetFallbackToAvailableDictLocale(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& locale);
384 
385  /**
386  * Returns @c true if the current locale is the special “Long Strings”
387  * locale. It returns @c false otherwise.
388  *
389  * This is a JavaScript interface to L10n::UseLongStrings().
390  *
391  * @param pCxPrivate JavaScript context. *
392  * @return Whether the current locale is the special “Long Strings”
393  * (@c true) or not (@c false).
394  */
396 
397  /**
398  * Returns @c true if the locale is supported by both ICU and the game. It
399  * returns @c false otherwise.
400  *
401  * It returns @c true if both of these conditions are true:
402  * 1. ICU has resources for that locale (which also ensures it’s a valid\n
403  * locale string).
404  * 2. Either a dictionary for language_country or for language is\n
405  * available.
406  *
407  * This is a JavaScript interface to L10n::ValidateLocale(const std::string&).
408  *
409  * @param pCxPrivate JavaScript context.
410  * @param locale Locale to check.
411  * @return Whether @p locale is supported by both ICU and the game (@c true)
412  * or not (@c false).
413  */
414  bool ValidateLocale(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& locale);
415 
416  /**
417  * Saves the specified locale in the game configuration file.
418  *
419  * The next time that the game starts, the game uses the locale in the
420  * configuration file if there are translation files available for it.
421  *
422  * SaveLocale() checks the validity of the specified locale with
423  * ValidateLocale(). If the specified locale is not valid, SaveLocale()
424  * returns @c false and does not save the locale to the configuration file.
425  *
426  * This is a JavaScript interface to L10n::SaveLocale().
427  *
428  * @param pCxPrivate JavaScript context.
429  * @param locale Locale to save to the configuration file.
430  * @return Whether the specified locale is valid (@c true) or not
431  * (@c false).
432  */
433  bool SaveLocale(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& locale);
434 
435  /**
436  * Determines the best, supported locale for the current user, makes it the
437  * current game locale and reloads the translations dictionary with
438  * translations for that locale.
439  *
440  * To determine the best locale, ReevaluateCurrentLocaleAndReload():
441  * 1. Checks the user game configuration.
442  * 2. If the locale is not defined there, it checks the system locale.
443  * 3. If none of those locales are supported by the game, the default\n
444  * locale, ‘en_US’, is used.
445  *
446  * This is a JavaScript interface to L10n::ReevaluateCurrentLocaleAndReload().
447  *
448  * @param pCxPrivate JavaScript context.
449  *
450  * @sa GetCurrentLocale()
451  */
453 }
454 
455 #endif
std::wstring Translate(ScriptInterface::CxPrivate *pCxPrivate, const std::wstring &sourceString)
Returns the translation of the specified string to the current locale.
Definition: JSInterface_L10n.cpp:27
std::wstring TranslateWithContext(ScriptInterface::CxPrivate *pCxPrivate, const std::string &context, const std::wstring &sourceString)
Returns the translation of the specified string to the current locale in the specified context...
Definition: JSInterface_L10n.cpp:33
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
Definition: code_annotation.h:38
std::vector< std::string > GetAllLocales(ScriptInterface::CxPrivate *pCxPrivate)
Returns an array of locale codes supported by ICU.
Definition: JSInterface_L10n.cpp:109
std::string GetDictionaryLocale(ScriptInterface::CxPrivate *pCxPrivate, const std::string &configLocale)
Returns the code of the recommended locale for the current user that the game supports.
Definition: JSInterface_L10n.cpp:114
std::wstring FormatDecimalNumberIntoString(ScriptInterface::CxPrivate *pCxPrivate, double number)
Returns the specified floating-point number as a string, with the number formatted as a decimal numbe...
Definition: JSInterface_L10n.cpp:84
std::wstring GetFallbackToAvailableDictLocale(ScriptInterface::CxPrivate *pCxPrivate, const std::string &locale)
Definition: JSInterface_L10n.cpp:66
std::string GetLocaleCountry(ScriptInterface::CxPrivate *pCxPrivate, const std::string &locale)
Returns the ISO-3166 country code of the specified locale code.
Definition: JSInterface_L10n.cpp:134
void RegisterScriptFunctions(ScriptInterface &ScriptInterface)
Registers the functions of the JavaScript interface for internationalization and localization into th...
Definition: JSInterface_L10n.cpp:160
std::vector< std::string > GetSupportedLocaleBaseNames(ScriptInterface::CxPrivate *pCxPrivate)
Returns an array of supported locale codes sorted alphabetically.
Definition: JSInterface_L10n.cpp:89
std::string GetLocaleScript(ScriptInterface::CxPrivate *pCxPrivate, const std::string &locale)
Returns the ISO-15924 abbreviation script code of the specified locale code.
Definition: JSInterface_L10n.cpp:139
void ReevaluateCurrentLocaleAndReload(ScriptInterface::CxPrivate *pCxPrivate)
Determines the best, supported locale for the current user, makes it the current game locale and relo...
Definition: JSInterface_L10n.cpp:154
std::wstring TranslatePlural(ScriptInterface::CxPrivate *pCxPrivate, const std::wstring &singularSourceString, const std::wstring &pluralSourceString, int number)
Returns the translation of the specified string to the current locale based on the specified number...
Definition: JSInterface_L10n.cpp:39
std::wstring TranslateLines(ScriptInterface::CxPrivate *pCxPrivate, const std::wstring &sourceString)
Translates a text line by line to the current locale.
Definition: JSInterface_L10n.cpp:51
std::wstring FormatMillisecondsIntoDateStringLocal(ScriptInterface::CxPrivate *pCxPrivate, UDate milliseconds, const std::wstring &formatString)
Returns the specified date converted to the local timezone using the specified date format...
Definition: JSInterface_L10n.cpp:72
std::string GetCurrentLocale(ScriptInterface::CxPrivate *pCxPrivate)
Returns the code of the current locale.
Definition: JSInterface_L10n.cpp:99
bool ValidateLocale(ScriptInterface::CxPrivate *pCxPrivate, const std::string &locale)
Returns true if the locale is supported by both ICU and the game.
Definition: JSInterface_L10n.cpp:144
std::wstring TranslatePluralWithContext(ScriptInterface::CxPrivate *pCxPrivate, const std::string &context, const std::wstring &singularSourceString, const std::wstring &pluralSourceString, int number)
Returns the translation of the specified string to the current locale in the specified context...
Definition: JSInterface_L10n.cpp:45
std::vector< std::wstring > GetSupportedLocaleDisplayNames(ScriptInterface::CxPrivate *pCxPrivate)
Returns an array of supported locale names sorted alphabetically by locale code.
Definition: JSInterface_L10n.cpp:94
Definition: ScriptInterface.h:99
bool SaveLocale(ScriptInterface::CxPrivate *pCxPrivate, const std::string &locale)
Saves the specified locale in the game configuration file.
Definition: JSInterface_L10n.cpp:149
std::string GetLocaleLanguage(ScriptInterface::CxPrivate *pCxPrivate, const std::string &locale)
Returns the ISO-639 language code of the specified locale code.
Definition: JSInterface_L10n.cpp:124
Abstraction around a SpiderMonkey JSContext.
Definition: ScriptInterface.h:71
std::vector< std::wstring > GetDictionariesForLocale(ScriptInterface::CxPrivate *pCxPrivate, const std::string &locale)
Returns an array of paths to files in the virtual filesystem that provide translations for the specif...
Definition: JSInterface_L10n.cpp:119
bool UseLongStrings(ScriptInterface::CxPrivate *pCxPrivate)
Returns true if the current locale is the special “Long Strings” locale.
Definition: JSInterface_L10n.cpp:104
std::vector< std::wstring > TranslateArray(ScriptInterface::CxPrivate *pCxPrivate, const std::vector< std::wstring > &sourceArray)
Translate each of the strings of a JavaScript array to the current locale.
Definition: JSInterface_L10n.cpp:57
Namespace for the functions of the JavaScript interface for internationalization and localization...
Definition: JSInterface_L10n.h:33
std::string GetLocaleBaseName(ScriptInterface::CxPrivate *pCxPrivate, const std::string &locale)
Returns the programmatic code of the entire locale without keywords.
Definition: JSInterface_L10n.cpp:129
std::wstring FormatMillisecondsIntoDateStringGMT(ScriptInterface::CxPrivate *pCxPrivate, UDate milliseconds, const std::wstring &formatString)
Returns the specified date in GMT using the specified date format.
Definition: JSInterface_L10n.cpp:78