wymeditor localization #1857

Closed
keram opened this Issue Aug 4, 2012 · 1 comment

Projects

None yet

2 participants

Contributor
keram commented Aug 4, 2012

hello
I found that wymeditor don't reflect change of language on backend.
That is because all javascript files are cached.
I think best solution would be if we had one global variable for locale and thus instead of this:

// boot_wym.js.erb
...
 , lang: '<%= ::Refinery.i18n_enabled? ? ::Refinery::I18n.current_locale : 'en' %>'
 ...

something like this:

 // admin/_javascripts.html.erb
 ...
 <script>
    window.backend_locale = '<%= ::Refinery.i18n_enabled? ? ::Refinery::I18n.current_locale : 'en' %>';
 </script>
 ...

 // boot_wym.js.erb
 ...
 , lang: window.backend_locale

Then js files could be still cached and we can use this variable also in other situations required localization.
What you think?

I also found a discrepancy in how locale is included to templates.
For example in boot_wym.js.erb is <%= ::Refinery.i18n_enabled? ? ::Refinery::I18n.current_locale : 'en' %>
in admin/_javascripts.html.erb is .."wymeditor/lang/#{::I18n.locale}"
and in setup.js.erb is english hardcoded lang: "en"
How we can unify that?

I can fix this issue if you want.

Owner
parndt commented Aug 29, 2012

@keram yes, we would love if you could fix this please.. sorry for the delay! Could you call it window.refinery_locale please? :)

@parndt parndt closed this in a4a3a58 Sep 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment