Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

js admin locale unification; fix #1857 #1920

Closed
wants to merge 3 commits into from

4 participants

@travisbot

This pull request passes (merged a2321b6 into 0b1de8b).

@ugisozols
Owner

One thing to note - Refinery::I18n won't be optional in Refinery CMS 2.1 so the Refinery.i18n_enabled? check is redundant.

@parndt
Owner
@ugisozols
Owner

We need to discuss this more (Refinery::I18n) but in the end we're on the same page - no need for Refinery.i18n_enabled?.

@travisbot

This pull request passes (merged 46595fa into 0b1de8b).

@parndt
Owner

Merged into a4a3a58 thanks!!

@parndt parndt closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
2  core/app/assets/javascripts/refinery/boot_wym.js.erb
@@ -224,7 +224,7 @@ var wymeditor_boot_options = $.extend({
);
}
}
- , lang: '<%= ::Refinery.i18n_enabled? ? ::Refinery::I18n.current_locale : 'en' %>'
+ , lang: refinery.current_admin_locale
}, custom_wymeditor_boot_options);
WYMeditor.editor.prototype.loadIframe = function(iframe) {
View
2  core/app/assets/javascripts/wymeditor/setup.js.erb
@@ -323,7 +323,7 @@ $.fn.wymeditor = function(options) {
initSkin: true,
loadSkin: true,
- lang: "en",
+ lang: refinery.current_admin_locale,
direction: "ltr",
View
5 core/app/helpers/refinery/admin_helper.rb
@@ -1,4 +1,9 @@
module Refinery
module AdminHelper
+
+ def current_admin_locale
+ ::Refinery.current_admin_locale
+ end
+
end
end
View
6 core/app/views/refinery/admin/_javascripts.html.erb
@@ -1,6 +1,10 @@
+<script type="text/javascript" >
+ var refinery = window.refinery || {};
+ refinery.current_admin_locale = '<%= current_admin_locale %>';
+</script>
<%= javascript_include_tag 'admin' -%>
<%= javascript_include_tag 'refinery/refinery' -%>
-<%= javascript_include_tag 'refinery/wymeditor', "wymeditor/lang/#{::I18n.locale}", "wymeditor/skins/refinery/skin" %>
+<%= javascript_include_tag 'refinery/wymeditor', "wymeditor/lang/#{current_admin_locale}", "wymeditor/skins/refinery/skin" %>
<%= yield :after_javascript_libraries -%>
<% custom_javascripts.each do |js| %>
<%= javascript_include_tag js %>
View
4 core/lib/refinery/core.rb
@@ -114,6 +114,10 @@ def i18n_enabled?
::Refinery::I18n.enabled?
end
+ def current_admin_locale
+ ::I18n.locale
+ end
+
# Returns a Pathname to the root of the Refinery CMS project
def root
@root ||= Pathname.new(File.expand_path('../../../../', __FILE__))
Something went wrong with that request. Please try again.