js_erb 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/js_erb/controller.rb +1 -1
- data/lib/js_erb/version.rb +1 -1
- metadata +2 -2
data/lib/js_erb/controller.rb
CHANGED
@@ -53,7 +53,7 @@ module JsErb
|
|
53
53
|
#
|
54
54
|
def compile_locales
|
55
55
|
Dir.glob("#{JsErb.config['path']['locales']}/*.yml").each do |file|
|
56
|
-
name = File.basename(file, '.
|
56
|
+
name = File.basename(file, '.yml')
|
57
57
|
content = YAML.load(ERB.new(File.read(file)).result)
|
58
58
|
File.open(File.join(JsErb.config['path']['compiled'], 'locales', "#{name}.js"), "wb") do |f|
|
59
59
|
f.write("window.i18n = {t:function(key){for(var i in i18n.$){ return eval('i18n.$.'+i+'[\"'+key.replace(/\\./g, '\"][\"')+'\"]') }}, $:#{content.to_json} };")
|
data/lib/js_erb/version.rb
CHANGED