cocoapods-aomi-bin 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 761d8708d5a6a58529721f57a03176cc6b304a299d73786da206eb2a891b55d6
|
4
|
+
data.tar.gz: b74e89002309aa292a591e0a37af7cc2f02bb0064ee517d12cd86cfc03e17936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a7eddbb8207315d61bda960964b0c051903f8d54c851959383a073a32786b2738a1b0eaf3e2c52ccf56db59fb6869f118b77ea4296ad0b71529f69966f8036f
|
7
|
+
data.tar.gz: d7e57971be1d7f009f5699c43ebd72a9191949cc30c051e3776592d72f5ec831bc0cb568933c4991bb746832079b36db1dcb15ad3f5212b3ab617d0e316136dc
|
@@ -33,16 +33,15 @@ module Pod
|
|
33
33
|
@modify_file_type = argv.option('modify-file-type', 'm,h')
|
34
34
|
@modify_format_string = argv.option('modify-format-string', 'NSLocalizedString(%s, @"")')
|
35
35
|
@key_map = {}
|
36
|
-
@cn_key_map = {}
|
37
36
|
super
|
38
37
|
end
|
39
38
|
|
40
39
|
def run
|
41
40
|
read_csv_file
|
42
41
|
if @key_map.keys.length.positive?
|
43
|
-
write_en_strings
|
44
|
-
write_zh_cn_strings
|
45
|
-
write_zh_hk_strings
|
42
|
+
# write_en_strings
|
43
|
+
# write_zh_cn_strings
|
44
|
+
# write_zh_hk_strings
|
46
45
|
handle_modify_source if @modify_source_flag
|
47
46
|
else
|
48
47
|
UI.puts "获取中英文映射文件失败, 检查参数--csv-file=xx是否正常\n".red
|
@@ -110,7 +109,10 @@ module Pod
|
|
110
109
|
|
111
110
|
def find_key_by_cn_val(val)
|
112
111
|
cn_key = val[2, val.length - 3]
|
113
|
-
@
|
112
|
+
index = @key_map.values.find_index do |obj|
|
113
|
+
/^#{cn_key}$/ =~ obj[:zh]
|
114
|
+
end
|
115
|
+
@key_map.values[index][:key] if index
|
114
116
|
end
|
115
117
|
|
116
118
|
def read_csv_file
|
@@ -118,10 +120,7 @@ module Pod
|
|
118
120
|
Dir.glob(path).each do |p|
|
119
121
|
CSV.foreach(p) do |row|
|
120
122
|
key = row[@key_col]
|
121
|
-
unless key =~ /[\u4e00-\u9fa5]/
|
122
|
-
@key_map[key] = { zh: row[@cn_col], en: row[@en_col] }
|
123
|
-
@cn_key_map[row[@cn_col]] = key
|
124
|
-
end
|
123
|
+
@key_map[key] = { key: key, zh: row[@cn_col], en: row[@en_col] } unless key =~ /[\u4e00-\u9fa5]/
|
125
124
|
end
|
126
125
|
end
|
127
126
|
end
|