angularjs i18n and L10n language translation

angularjs i18n and L10n language translation

The i18n stand for Internationalization. This is the process to developing a product for global languages.

The L10n stand for Localization. This is the process to developing a product for particular cultural or languages.
How does Angular support i18n/l10n?

In Angularjs, The i18n and L10n are supporting  to filters to the date, number and currency.

The en-US, en-AU etc. are all valid locale Ids that contain the both language code and country code(for example en is language code and US is a country code.).

The code sample as give below.

<!doctype html>
  <meta charset="utf-8">
  <script src="//"></script>
  <script src="//"></script>
    var app = angular.module('app', ['pascalprecht.translate']);

app.config(function($translateProvider) {

    $translateProvider.translations('en', {
        title: 'clicked on english language',
        name: '',
        button_lan_en: 'english',
        button_lan_de: 'german'

    $translateProvider.translations('de', {
        title: 'clicked on deutsch language',
        name: '',
        button_lan_en: 'english',
        button_lan_de: 'deutsch'


app.controller('i18ncontroller', function($scope, $translate) {

    $scope.changeCurrentLang = function(key) {


<body ng-app="app">
  <div class="row">
    <h1>i18n and L10n angularjs language translation </h1>
        <h2 translate="title"></h2>
      <div ng-controller="i18ncontroller">
        <button ng-click="changeCurrentLang('en')" translate="button_lan_en">English language</button>
        <button ng-click="changeCurrentLang('de')" translate="button_lan_de">German language</button>

Output look like below display Image.


Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - and
My Books - Google Amazon and Flipkart Book Store!

You Might Also Like
Post a Comment Powered by Blogger.
ASK Questions
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book