guard-i18next 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/guard/i18next.rb +2 -7
- data/lib/guard/i18next/version.rb +1 -1
- metadata +1 -1
data/lib/guard/i18next.rb
CHANGED
@@ -8,10 +8,8 @@ module Guard
|
|
8
8
|
|
9
9
|
DEFAULT_OPTIONS = {
|
10
10
|
:output => Pathname.pwd.join('app', 'assets', 'javascripts', 'i18n'),
|
11
|
-
:namespace => '(global || window).Locales'
|
12
11
|
}
|
13
12
|
|
14
|
-
|
15
13
|
# Initialize Guard::i18next
|
16
14
|
#
|
17
15
|
# @param [Array<Guard::Watcher>] watchers the watchers in the Guard block
|
@@ -39,14 +37,11 @@ module Guard
|
|
39
37
|
locale = YAML.load(input.read)
|
40
38
|
input.close
|
41
39
|
|
42
|
-
locale_key = locale.keys[0]
|
43
|
-
content = locale[locale_key]
|
44
40
|
File.open(options[:output] + "/#{filename}.json", "w") do |f|
|
45
|
-
|
46
|
-
f.puts "#{options[:namespace]} = #{options[:namespace]} != null ? #{options[:namespace]} : {}"
|
47
|
-
f.puts options[:namespace] + "[#{locale_key}] = " + content.to_json
|
41
|
+
f.puts locale.to_json
|
48
42
|
end
|
49
43
|
end
|
50
44
|
end
|
45
|
+
|
51
46
|
end
|
52
47
|
end
|