From ae81523aa52412da79e874bc7006c26b550ef5ab Mon Sep 17 00:00:00 2001 From: Aleksandr Kruglov Date: Sat, 15 Jun 2013 02:31:36 +0400 Subject: [PATCH] It maybe worth load pluralizations rules before compile? --- lib/js_locale_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/js_locale_helper.rb b/lib/js_locale_helper.rb index 61847405cf1..3db929bfa77 100644 --- a/lib/js_locale_helper.rb +++ b/lib/js_locale_helper.rb @@ -73,6 +73,7 @@ module JsLocaleHelper def self.compile_message_format(locale, format) ctx = V8::Context.new ctx.load(Rails.root + 'lib/javascripts/messageformat.js') + ctx.load(Rails.root + "lib/javascripts/locale/#{locale}.js") ctx.eval("mf = new MessageFormat('#{locale}');") ctx.eval("mf.precompile(mf.parse(#{format.inspect}))")