{{ 'viewOnGithub' | i18n }}

ng-i18n

{{ 'text.moduleDesc' | i18n }}

Download this project as a .zip file Download this project as a tar.gz file

Code Climate Travis-CI Join the chat at https://gitter.im/kevinchappell/ng-i18n

{{ 'about' | i18n }}

{{ 'text.moduleDescLong' | i18n }}

{{ 'usage' | i18n }}

{{ 'usage.intro' | i18n }}

{{ 'label.setup' | i18n }}


angular.module('app', [
  'ngI18n',
  'ngI18nLangSelect'
])

.config(function(I18NProvider) {
    var i18nConfig = {
      // local or remote directory containing language files
      langsDir: 'assets/lang/',
      default: {
        locale: 'en-us',
        name: 'English'
      },
      // locale property should match language filenames
      langs: [{
        locale: 'en-us',
        name: 'English'
      }, {
        locale: 'pt-pt',
        name: 'Portuguese'
      }]
    };
    I18NProvider.config(i18nConfig);
  })
      

{{ 'label.filter' | i18n }}

{{ 'keyInLanguageFile' | i18n }}
{{ 'label.example' | i18n }}
{{ 'label.filterWVariable' | i18n}}
{{ 'args.example' | i18n:app.hotdogCount }}
{{ 'text.stringInFile' | i18n }}:
args.example = I just ate {count} hot dogs
{{ 'label.outputs' | i18n }}:

{{ 'args.example' | i18n:app.hotdogCount }}

{{ 'label.filterWLiveVariable' | i18n}}

{{ 'args.example.2' | i18n:app.secondsSinceOpen }}

{{ 'label.filterWNamedVariable' | i18n}}
{{ 'args.example.3' | i18n:{ person1:'Kevin', person2: 'Jessica' } }}
{{ 'text.stringInFile' | i18n }}:
args.example.3 = {{ 'args.example.3' | i18n:{ person1:'{person1}', person2: '{person2}' } }}
{{ 'label.outputs' | i18n }}:

{{ 'args.example.3' | i18n:{ person1:'Kevin', person2: 'Jessica' } }}

{{ 'label.directive' | i18n }}

{{ 'text.aboutDirective' | i18n }}

<ng-i18n key="theKey" foo="bar" baz="qux"></ng-i18n>
{{ 'label.example' | i18n }} {{ 'label.directiveWNamedVariables' | i18n }}

{{ 'text.directiveNotice' | i18n }}