angularjsHow can I use AngularJS to localize my application?
AngularJS provides a built-in localization service called
$locale. It can be used to localize your application and make it available in multiple languages.
// set language $locale.id = 'es-MX'; // get localized string var localizedString = $locale.DATETIME_FORMATS.SHORTDAY;
The code above sets the language to Spanish (Mexico), and retrieves the localized string for the first day of the week.
$locale service provides access to multiple localization-related properties, such as
MESSAGES, etc. All of these properties contain localized strings for various elements, such as numbers, dates, times, etc.
$locale.id- Sets the language for the application.
$locale.DATETIME_FORMATS- Contains localized strings for dates and times.
$locale.NUMBER_FORMATS- Contains localized strings for numbers.
$locale.MESSAGES- Contains localized strings for messages.
More of Angularjs
- How can I use Angular to zoom in and out of a div?
- How do I use Angular to zip files?
- How do I use AngularJS to zoom in on an image?
- How do I use Angular Zone to detect and run Angular change detection?
- How do I use Angular with YAML?
- How do I use ui-select in AngularJS?
- How do I integrate an Angular Yandex Map into my software development project?
- How can I use the YouTube API with Angular?
- How do I create a yes/no dialog box using Angular?
- How do I install Yarn using Angular?
See more codes...