FIX: missing translations when "en" set as fallbackLocale

FIX: missing translations when “en” set as fallbackLocale

When a plugin registers a language and sets fallbackLocale=“en”, fallback strings were missing. This commit strips any duplicate “:en” symbols when loading merged translations.

diff --git a/lib/js_locale_helper.rb b/lib/js_locale_helper.rb
index 21fba98..377d11e 100644
--- a/lib/js_locale_helper.rb
+++ b/lib/js_locale_helper.rb
@@ -86,7 +86,7 @@ module JsLocaleHelper
   end
 
   def self.load_translations_merged(*locales)
-    locales = locales.compact
+    locales = locales.uniq.compact
     @loaded_merges ||= {}
     @loaded_merges[locales.join('-')] ||= begin
       all_translations = {}

GitHub sha: da64b90d

2 Likes