-
Notifications
You must be signed in to change notification settings - Fork 184
Conversation
What I see as a must have is a convention on where translation files should be stored within ember-cli project. Following rails way it can be |
651e837
to
a05cfba
Compare
great work @chrmod ! Personally I think the path to
|
👍 |
Can you take a look at #156 ? If we end up dropping support for Ember 1.9+ in the Ember-I18n v2.x series, do we need to do something to the |
}, | ||
|
||
afterInstall: function() { | ||
return this.addBowerPackageToProject('ember-i18n', '2.2.2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be more generic so we don't have to change this every time we release a new version?
Alternatively, it might be time to write a script to bump versions everywhere.
] | ||
} | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hoping to get #161 merged today. That removes the dependency on CLDR.js and adds a new lib/i18n-plurals.js
. I suspect this will need to be
included: function(app) {
this._super.included(app);
this.app.import(app.bowerDirectory + '/ember-i18n/lib/i18n.js', {
exports: {
'ember-i18n': [
'default'
]
}
});
this.app.import(app.bowerDirectory + '/ember-i18n/lib/i18n-plurals.js');
}
(The pluralization is still an optional separate add-on, but it comes after the core I18n definition.)
a05cfba
to
2b66efe
Compare
2b66efe
to
1a64372
Compare
}, | ||
|
||
afterInstall: function() { | ||
return this.addBowerPackageToProject('ember-i18n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without any version specified, bower.json will be updated to most recent one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now it asks me to choose from:
conflict Unable to find suitable version for ember-i18n
1) ember-i18n 2.2.2
2) ember-i18n ~2.9.0
[?] Answer: 1
It ignored my selected option and wrote ~2.9.0
to my bower file.
It reproduces after:
rm -rf bower_components/ember-i18n/
bower cache clean
ember generate ember-i18n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results:
grep ember-i18n bower.json
"ember-i18n": "~2.9.0"
cat bower_components/ember-i18n/VERSION
2.2.2
# bower.json disagrees
ls bower_components/ember-i18n/lib/
i18n.js
# no ember-addon/ folder :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tricky. What do we do with 3.0.0-beta1? Do we need to hardcode a version string in here? If so, I would prefer something like "~2"
for the 2.x branch and "~3"
for the 3.x branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@givanse if bower askes you to choose a version it means some of your dependencies requires different version. To make bower auto choose the your version of choice you must list it in "resolutions"
property of bower.json. In the end you app will use the version it finds in bower_components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jamesarosen @givanse please note that while we have addon code in ember-i18n repository, the ember-cli will use to separate copies of ember-i18n, potentially in different version.
To use ember-i18n in the application, it must be listed in bower.json as dependecy.
Next an addon code need to include this bower dependency to ember-cli build. To make it happen addon must be listed as dev-dependecy in package.json (ember-cli automatically scans all node packages for addon code).
It may happen that you will have a different version of ember-i18n in your node_modules directory then in bower_components directory. Apparantly it is the way those things are working if the addon code shares the same repository as library. We can ofcouse separate those competences, but it does not make much sense for me as ember-i18n cannot be used outside of ember.
@jamesarosen please take a look now |
Can you try updating this to 3.0.0-beta2? If we can get that working, I'd very much like to ship this as part of 3.0.0 :) |
@jamesarosen Have tested this setup with 2.9.0 and current master (3.0.0-beta.2) on top of Ember 1.8 with Handlebars 1.3. Both simple translations and pluralization worked well. |
EmberENV: { | ||
FEATURES: { | ||
I18N_COMPILE_WITHOUT_HANDLEBARS: true, | ||
I18N_TRANSLATE_HELPER_SPAN: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These flags are no longer necessary.
Guys, is there any update where this PR could be merged or further processed to get ember-i18n working with ember CLI? |
+1 |
+1 Would definitely love to see this integrated as soon as possible. Let me know how I can be of assistance! |
Given that there's discussion happening in the PR linked above (on Dockyard's ember-cli-i18n project) about merging/collaborating/something with an existing ember-cli-supporting project, I can see why @jamesarosen and/or @chrmod aren't pushing this forward at the moment. It sort of looks to me like this particular branch could be minimally usable if it's rebased and the extraneous configuration flags removed? I have a hack day coming at work on Monday (9 February), so I can try to get a working branch based on this then, if nobody has done it sooner. |
I'm finally working on an Ember-CLI-based project, so I may be able to pick this back up. I'd really like to get it in for v3.0. |
Is there somethink i/we could help you with? some taks/issues etc? |
I've got a fork of this branch rebased and tweaked in #192. |
So does this mean that this PR can be closed now? |
@jamesarosen please see my comments #192 (comment). The work of @pjmorse is absolutely functional as a minimal addon. If we can improve something it is a README. It seems to me that people that want to use this addon do not feel very comoftable with ember-cli and that is why there are some many questions and misconception about how the addon is suppose to work. Key to improve the addon is to make people use it and this will happen as soon PS. I've sent you an email to your zendesk inbox but received delivery error. I think we can talk this subject trough, here is my email: krzysztof(dot)modras(at)gmail(dot)com - let talk via skype or hangout, ok? |
guess this one can be closed now |
It is very simple ember-cli support that uses addon mechanism.
When used in ember-cli project it:
To use it in ember-cli project:
Implements issue: #129