
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
ember-cli-foreigner
Advanced tools
`ember-cli-foreigner` is a set of helpers and mixins to interface with the [foreigner.js](https://github.com/mirego/foreigner.js) library in Ember.
ember-cli-foreigner
is a set of helpers and mixins to interface with the foreigner.js library in Ember.
npm install ember-cli-foreigner --save-dev
ember g ember-cli-foreigner
ember g locale <locale>
In your app’s config/environment.js
, set the default locale:
var ENV = {
APP: {
defaultLocale: '<locale>'
}
};
You can change the folder where the translations are put by setting the locale prefix:
var ENV = {
modulePrefix: 'your-app',
localePrefix: 'your-app/localizations'
};
The path is relative to modulePrefix
and is set to locales
by default.
To see how to write your locale file, see the foreigner.js README
{{!-- Simple translation --}}
<h1>{{t 'hello_world'}}</h1>
{{!-- Bound interpolated values --}}
<p>{{t 'you_have_x_message' messageCount=messages.length}}</p>
Say you want to translate the placeholder
attribute on the input
helper.
{{input placeholder=(t 'form.input_placeholder')}}
First, you have to include the translateable-attributes
mixin on the Ember.TextField
class:
import TranslateableAttributes from 'ember-cli-foreigner/translateable-attributes';
Ember.TextField.reopen(TranslateableAttributes);
And then you can define your placeholder like this:
{{input placeholderTranslation='form.input_placeholder'}}
The locale property is set on your app’s instance, so to change it you could do something like this in your routes/application.js
:
export default Ember.Route.extend({
actions: {
changeLocale: function(locale) {
var application = this.container.lookup('application:main');
application.set('locale', locale);
// Transitioning to any other route from here should render
// your templates with the new locale’s translations
}
}
});
npm install
bower install
ember server
ember test
ember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.
ember-cli-foreigner
is © 2014-2015 Mirego and may be freely distributed under the New BSD license.
See the LICENSE.md
file.
Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We're a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.
We also love open-source software and we try to give back to the community as much as we can.
FAQs
`ember-cli-foreigner` is a set of helpers and mixins to interface with the [foreigner.js](https://github.com/mirego/foreigner.js) library in Ember.
The npm package ember-cli-foreigner receives a total of 2 weekly downloads. As such, ember-cli-foreigner popularity was classified as not popular.
We found that ember-cli-foreigner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.