Comments (1)
Sorry for the slow response. I wasn't aware of this macro in ember-i18n
, and I like the idea a lot. However, I'm not crazy about the syntax used in ember-i18n
, because it doesn't match most computed property macros. Using the example from the documentation above, I would prefer something that looked like this:
import { translationMacro as t } from "ember-i18next";
export default Ember.Component.extend({
// A simple translation.
title: t('user.edit.title'),
followersCount: 1,
count: Ember.computed.alias('followersCount'),
// A translation with interpolations. This computed property
// depends on `count` and will send `{ count: this.get('count') }`
// in to the translation.
followersTitle: t('user.followers.title', 'count')
});
The main difference being that the arguments to the macro are dependent property names rather than an options hash.
I'd be happy to accept a PR that matches the example above. No worries if you don't currently have the time; I can quickly implement it myself before the next release.
from ember-i18next.
Related Issues (20)
- Collaborate with ember-i18n / ember-cli-i18n / ember-intl? HOT 2
- Error with Ember.js 1.13
- Changing the language does not work anymore with Ember.js 1.13 HOT 4
- Provide Ember 2.2.0 Initializer example HOT 2
- Ember Server failing after including ember-18next HOT 3
- Update to i18next 2.X
- Fix Ember.warn Deprecations
- ES2015 Conversion
- Rejected Promise in Init With Missing Locale Files HOT 7
- Ability to use ember-i18next during integration tests HOT 2
- unable to use github version of ember-i18next, broccoli build error HOT 4
- Upgrade Documentation
- Test Helper to Initialize Service
- Mechanism to Configure Other Plugins HOT 1
- incompatible with ember 2.9.0 latest HOT 1
- Variable replacement support for computed properties HOT 1
- Future of this add-on HOT 4
- htmlSafe is now in @ember/template
- Document Expectations for Contributions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-i18next.