Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
ember-cli-pod-translations
Advanced tools
An addon to compile your locale files inside pods.
$ ember install ember-cli-pod-translations
Create translation files for your components, controllers or routes
For example, we could create an english file app/pods/components/x-foo/translations.en.json
{
"hello_world": "Hello World"
}
Then a french file app/pods/components/x-foo/translations.fr.json
:
{
"hello_world": "Bonjour le monde"
}
Extend your component, controller or route with the Localizable
mixin
NOTE: This is required for both the JS and template usage
// app/pods/components/x-foo/component.js
import Ember from 'ember';
import Localizable from 'ember-cli-pod-translations/mixins/localizable';
import translations from './translations';
export default Ember.Component.extend(Localizable(translations));
Use your translations in your Ember object
// app/pods/components/x-foo/component.js
import Ember from 'ember';
import Localizable from 'ember-cli-pod-translations/mixins/localizable';
import translations from './translations';
export default Ember.Component.extend(Localizable(translations), {
helloString: computed(function() {
return this.localTranslation('hello_world');
})
});
Use your translations in your template
{{!-- app/pods/components/x-foo/template.hbs --}}
{{local-t localizablePrefix 'hello_world'}}
You can also use a "raw" translation which is not wrapped in a SafeString for ember-moment for example:
{{moment-format date (local-t-raw localizablePrefix 'date_format')}}
$ git clone https://github.com/mirego/ember-cli-pod-translations
$ cd ember-cli-pod-translations
$ yarn install
$ ember serve
Visit your app at http://localhost:4200.
$ npm test # Runs `ember try:each` to test the addon against multiple Ember versions
$ ember test
$ ember test --server
$ ember build
For more information on using ember-cli, visit https://ember-cli.com/.
ember-cli-pod-translations
is © 2017 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
An addon to compile your locale files inside pods.
The npm package ember-cli-pod-translations receives a total of 0 weekly downloads. As such, ember-cli-pod-translations popularity was classified as not popular.
We found that ember-cli-pod-translations 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.