Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-i18n

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-i18n

Simple Internationalization support for ember-cli apps.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65
increased by6400%
Maintainers
1
Weekly downloads
 
Created
Source

Ember CLI i18n

Build

About

Simple Internationalization support for ember-cli apps.

Install

npm install ember-cli-i18n --save-dev

Usage

Translate

Configuration

In your app's config/environment.js you'll need to set ENV.APP.defaultLocale to a country code:

var ENV = {
  APP: {
    defaultLocale: 'en'
  }
};
Locale Files

Generate a new locale file:

ember g locale en

The file will be added to `app/locales'

app/
└── locales
    └── en.js

The content export a single POJO:

export default {
  home: {
    title: 'Welcome'
  }
};
Interpolation

You can add keys for interpolation

export default {
  age: 'You are %@1 years old.'
};

The rules for interpolation follow the same from [Ember.String.fmt](http://emberjs.com/api/classes/Ember.String.html#method_fmt)

Helper

You can access the translations in your app with the t helper:

{{t 'home.title'}}

Computed properties for the path are also supported:

{{t age}}

If the value has interpolation keys you can pass those values:

{{t colors colorOne colorTwo}}

Authors

We are very thankful for the many contributors

Versioning

This library follows Semantic Versioning

Want to help?

Please do! We are always looking to improve this gem. Please see our Contribution Guidelines on how to properly submit issues and pull requests.

DockYard, Inc © 2014

@dockyard

Licensed under the MIT license

Keywords

FAQs

Package last updated on 23 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc