Localization
Language
The plug-in widgets can be fully localized via custom resource files. By default, US English and Spanish resource files are available. However, other languages can be supported by specifying additional language files. The following Javascript shows an example configuration for Japanese using a custom resource file and default country code for Japan.
var Accumulus = { resourcesUrl : 'https://myResources/', global: { defaultLanguage : 'ja-JP', localize : false, defaultCountryCode : 'JPN' } };
Note: If a default translation is not available, a language resource .json file needs to be present at the configured custom resource URL location within the “js/lang” folder. For example, https://myResources/js/lang/ja-JP.json. The .json file needs to contain the required translations. A full example containing all labels and messages can be found at: https://ajax.accumulus.com/accumulus-widgets-2.2/js/lang/en-US.json.
Currency
In addition to specifying a language, the currency formate can also be localized. A currency format library available at https://code.google.com/p/jquery-formatcurrency is utilized to accomplish this. Below is an example configuration for Japanese Yen formatting.
<script src="js/jquery.formatCurrency-1.4.0.js"></script> <script type="text/javascript" src="js/i18n/jquery.formatCurrency.ja-JP.js"></script> var Accumulus = { resourcesUrl : 'https://myResources/', global: { currencyFormat : 'ja-JP' } };
To use a different currency, you need to include the respective format currency file and specify the currencyFormat configuration parameter. A full list of supported currency formats is available here.