
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
ember-gettext
Advanced tools
i18n gettext.js wrapper for Ember controllers and Handlebars templates
bower install ember-gettext --save
<script src="./bower_components/gettext.js/dist/gettext.js"></script>
<script src="./bower_components/ember-gettext/lib/ember-gettext.js"></script>
or in your Brocfile if you use ember-cli.
Wherever it suits in your project, load your messages:
Ember.I18n.loadJSON({...});
Your JSON format must be the gettext.js required one
You could do it from your dom
<html lang="fr">
or from javascript
i18n.setLocate('fr');
- Singular forms:
Ember.I18n._t("I like apples.");
Ember.I18n._t("I like {{ fruit }}.", {fruit: "bananas"});
- Plural forms:
You must use a count
parameter to indicate gettext which plural form to choose
Ember.I18n._n("There is {{ count }} apple", "There are {{ count }} apples", { count: 42 });
Ember.I18n._n("There is {{ count }} apple in the {{ where }}", "There are {{ count }} apples in the {{ where }}", { count: 12, where: "fridge" });
- Singular forms:
<p>{{_t "I like apples." }}</p>
<p>{{_t "I like {{ fruit }}." fruit="bananas" }}</p>
- Plural forms:
You must use a count
parameter to indicate gettext which plural form to choose
<p>{{_n "There is {{ count }} apple" "There are {{ count }} apples" count=42 }}</p>
<p>{{_n "There is {{ count }} apple in the {{ where }}" "There are {{ count }} apples in the {{ where }}" count=12 where="fridge" }}</p>
- Binded values
You could of course use binded values to be interpreted and automatically re-rendered
<p>{{_t "Hello {{ firstname }} firstnameBinding="user.firstname" }}</p>
<p>{{_n "There is {{ count }} apple in the {{ where }}" "There are {{ count }} apples in the {{ where }}" countBinding="fruits.count" whereBinding="fruits.container" }}</p>
MIT
FAQs
i18n gettext.js wrapper for Ember controllers and Handlebars templates
The npm package ember-gettext receives a total of 1 weekly downloads. As such, ember-gettext popularity was classified as not popular.
We found that ember-gettext 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.