wycats / rake-pipeline-web-filters

MIT License
116 stars 34 forks source link

filters for parsing i18n yml to js for Ember.String.loc or i18n-js #38

Closed randym closed 11 years ago

randym commented 12 years ago

Came across a need for this in travis-ci. If you think it would be useful for the rest of the community please feel free to merge.

It takes yml files and parses them out into js using syntax appropriate for Ember.STRINGS (for using loc) or i18n.translations (for using i18n-js) based on a use_i18n_js option.

ahawkins commented 12 years ago

+1. I did this in Iridium. I didn't even know this PR requested.

ppcano commented 12 years ago

I am in favor of having a i18n convention on EmberJS, otherwise each APP will implement it on different ways. I have been using a similar approach with rake-pipeline and i18n.

wagenet commented 11 years ago

@twinturbo How does this compare to what you did? Might be nice to have something in RPWF.

ahawkins commented 11 years ago

@wagenet see source here: https://github.com/radiumsoftware/iridium/blob/master/lib/rake-pipeline-web-filters/i18n_filter.rb

match "locales/**/*.ym" do
  i18n "locales.js"
end

Very simple filter and straight to the point. The destination could be configurable (something other than I18n.translations).

randym commented 11 years ago

While I have no basis to comment on the Worth noting that Ember.STRING and Ember.string.loc output was a bit of a PITA. I' be very happy to see EmberJS incorporate i18n-js from fnando as it would greatly simplify this filter.

randym commented 11 years ago

moving this into a separate gem.

ahawkins commented 11 years ago

Hmm. This can be in the gem. I think some sort of functionality like this is useful. I'll just try out irdiums implementation in a pr On Nov 23, 2012 6:06 AM, "Randy Morgan (@morgan_randy)" < notifications@github.com> wrote:

moving this into a separate gem.

— Reply to this email directly or view it on GitHubhttps://github.com/wycats/rake-pipeline-web-filters/pull/38#issuecomment-10649932.

randym commented 11 years ago

rake-pipeline-i18n-filters released last week. https://rubygems.org/gems/rake-pipeline-i18n-filters