DrewShirts
DrewShirts

Reputation: 157

How do I use Angular i18n for languages it doesn't appear to support?

I am using Angular i18n for German, English, Spanish, French, Italian, Portuguese, Russian, Ukrainian, Japanese, Korean, and Chinese.

These are all supported locales, but I've been tasked to include translations for Cebuano, Samoan, Tagalog, and Tongan. These do not appear to be supported locales in Angular i18n.

How do I still use Angular i18n with these four locales?

Upvotes: 2

Views: 2119

Answers (1)

Dalorzo
Dalorzo

Reputation: 20024

Angular supports i18n Standard for location | globalization | internationalization. When it comes to number,dates and so fort for names of days, months, etc. Angular relies on $locale service for example in the case of number the property NUMBER_FORMATS.

Here is the list of locations currently supported by angular:

http://cdnjs.com/libraries/angular-i18n/

Here is an example on how to support german locale:

<html ng-app>
 <head>

   <script src="angular.js"></script>
   <script src="i18n/angular-locale_de-de.js"></script>

 </head>
</html>

If you want to dig more into or create your own you can search for NUMBER_FORMATS in any of the CDNs provided above and you will find what angular will use to format your numbers, this is an example:

"NUMBER_FORMATS": {
    "CURRENCY_SYM": "\u20ac",
    "DECIMAL_SEP": ",",
    "GROUP_SEP": ".",
...

Upvotes: 3

Related Questions