Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

wymeditor localization #1857

Closed
keram opened this Issue · 1 comment

2 participants

@keram

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.

@parndt
Owner

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.