locraft 1.6.5 → 1.6.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 753e103518e93778506565a15194db9e626c9594
|
4
|
+
data.tar.gz: 6e1c2cf4d5a4e879bfba2243632196c6cf841c28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e07a1ca62f5e9d7d8f88330d1992ae6b01259a86c58542e0fd00d5adcaeb7eeef786e53b969d1547c3ed790619eacaec7db8ecbf04c1e707d721a3efe4f2ead
|
7
|
+
data.tar.gz: baf9460c770a6ac3c9cf19200fdc5d41f5b212639a2871f8c4fd0ac6fa811bee8a9faef1c76a155c375f75b6ae0148f5b6b9a66496054d99853e20cc78f0464d
|
@@ -6,8 +6,8 @@ module Locraft
|
|
6
6
|
!@config.relative_plist_destination.nil?
|
7
7
|
end
|
8
8
|
|
9
|
-
def destination_dir_for(
|
10
|
-
"#{@config.relative_plist_destination}/#{
|
9
|
+
def destination_dir_for(_, lang_code)
|
10
|
+
"#{@config.relative_plist_destination}/#{lang_code}.lproj"
|
11
11
|
end
|
12
12
|
|
13
13
|
def valid_localization?(l)
|
@@ -15,7 +15,7 @@ module Locraft
|
|
15
15
|
def generate(localizations_hash)
|
16
16
|
@config.langs.each do |lang, lang_code|
|
17
17
|
localizations = localizations_hash[lang].select { |l| valid_localization?(l) }
|
18
|
-
destination_dir = destination_dir_for(lang_code)
|
18
|
+
destination_dir = destination_dir_for(lang, lang_code)
|
19
19
|
file = "#{destination_dir}/#{strings_file}"
|
20
20
|
mkdir_p destination_dir unless Dir.exist?(destination_dir)
|
21
21
|
File.open(file, 'w+') do |f|
|
@@ -37,8 +37,8 @@ module Locraft
|
|
37
37
|
Utils.resource_file('strings_template.txt')
|
38
38
|
end
|
39
39
|
|
40
|
-
def destination_dir_for(
|
41
|
-
"#{@config.relative_strings_destination}/#{
|
40
|
+
def destination_dir_for(_, lang_code)
|
41
|
+
"#{@config.relative_strings_destination}/#{lang_code}.lproj"
|
42
42
|
end
|
43
43
|
|
44
44
|
def strings_file
|
@@ -6,8 +6,9 @@ module Locraft
|
|
6
6
|
Utils.resource_file('xml_strings_template.txt')
|
7
7
|
end
|
8
8
|
|
9
|
-
def destination_dir_for(lang)
|
10
|
-
|
9
|
+
def destination_dir_for(lang, lang_code)
|
10
|
+
comp = @config.default_lang == lang ? 'values' : "values-#{lang_code}"
|
11
|
+
"#{@config.relative_strings_destination}/#{comp}"
|
11
12
|
end
|
12
13
|
|
13
14
|
def strings_line_with(localization)
|
@@ -21,4 +22,4 @@ module Locraft
|
|
21
22
|
puts "xml strings file generated: [#{f}]"
|
22
23
|
end
|
23
24
|
end
|
24
|
-
end
|
25
|
+
end
|
data/lib/locraft/version.rb
CHANGED