@ngdoc overview @name i18n and l10n @sortOrder 520 @description # i18n and l10n Internationalization (i18n) is the process of developing products in such a way that they can be localized for languages and cultures easily. Localization (l10n), is the process of adapting applications and text to enable their usability in a particular cultural or linguistic market. For application developers, internationalizing an application means abstracting all of the strings and other locale-specific bits (such as date or currency formats) out of the application. Localizing an application means providing translations and localized formats for the abstracted bits. ## How does Angular support i18n/l10n? Angular supports i18n/l10n for {@link ng.filter:date date}, {@link ng.filter:number number} and {@link ng.filter:currency currency} filters. Additionally, Angular supports localizable pluralization support through the {@link ng.directive:ngPluralize `ngPluralize` directive}. All localizable Angular components depend on locale-specific rule sets managed by the {@link ng.$locale `$locale` service}. There a few examples that showcase how to use Angular filters with various locale rule sets in the [`i18n/e2e` directory](https://github.com/angular/angular.js/tree/master/i18n/e2e) of the Angular source code. ## What is a locale ID? A locale is a specific geographical, political, or cultural region. The most commonly used locale ID consists of two parts: language code and country code. For example, `en-US`, `en-AU`, and `zh-CN` are all valid locale IDs that have both language codes and country codes. Because specifying a country code in locale ID is optional, locale IDs such as `en`, `zh`, and `sk` are also valid. See the [ICU](http://userguide.icu-project.org/locale) website for more information about using locale IDs. ## Supported locales in Angular Angular separates number and datetime format rule sets into different files, each file for a particular locale. You can find a list of currently supported locales [here](https://github.com/angular/angular.js/tree/master/src/ngLocale) ## Providing locale rules to Angular There are two approaches to providing locale rules to Angular: ### 1. Pre-bundled rule sets You can pre-bundle the desired locale file with Angular by concatenating the content of the locale-specific file to the end of `angular.js` or `angular.min.js` file. For example on *nix, to create an angular.js file that contains localization rules for german locale, you can do the following: `cat angular.js i18n/angular-locale_de-de.js > angular_de-de.js` When the application containing `angular_de-de.js` script instead of the generic angular.js script starts, Angular is automatically pre-configured with localization rules for the german locale. ### 2. Including a locale script in `index.html` You can also include the locale specific js file in the index.html page. For example, if one client requires German locale, you would serve index_de-de.html which will look something like this: ```html
…. …. ``` ### Comparison of the two approaches Both approaches described above require you to prepare different `index.html` pages or JavaScript files for each locale that your app may use. You also need to configure your server to serve the correct file that correspond to the desired locale. The second approach (including the locale JavaScript file in `index.html`) may be slower because an extra script needs to be loaded. ## Caveats Although Angular makes i18n convenient, there are several things you need to be conscious of as you develop your app. ### Currency symbol Angular's {@link ng.filter:currency currency filter} allows you to use the default currency symbol from the {@link ng.$locale locale service}, or you can provide the filter with a custom currency symbol.