Skip to content

recipher/ember-cli-i18next

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

ember-cli-i18next

Wrap i18next for Ember apps

Installation

From within your Ember CLI application, run:

npm install --save-dev ember-cli-i18next

Usage

Create your i18next locales files in your project and add them to the build in your Brocfile.js:

var locales = pickFiles('locales', {
  srcDir: '/'
, destDir: '/locales'
});

module.exports = mergeTrees([ locales, app.toTree() ]);

In a template, use the t helper to :

{{t 'my.key'}}

In your controllers and routes, access the i18n object:

// /controllers/test.js

export default Ember.Controller.extend({
  actions: {
    test: function() {
      var i18n = this.get('i18n');
      var test = i18n.get('my.key');

      // Or
      var alternative = i18n.t('my.key');
    }
  }
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

Maintainers

About

Ember CLI addon to wrap i18next

Resources

Stars

Watchers

Forks

Packages

No packages published