cocoapods-aomi-bin 0.1.6 → 0.1.7
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: daeba67369d05792796bf13709af702f4ed8937c74f4a66755fc02160a4cc8e9
|
4
|
+
data.tar.gz: 1f4db6b1b3609a580b14da4b6d548ec17b4fc8d16d06e1ae85f199695c65f088
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d96eb617e47fa8bf0e399d610d8aab68a30b21fac029168a2c4839b4ae3570b839f4f71a1e518a954bff1cb822c635ec1c47d052fad147daa8e9e423930ed5c5
|
7
|
+
data.tar.gz: 94e010fbd073a784cf9a4be53e961dc922b201cd51d69bb35221c301d782b9da500902df86b4f8b0e3d3d4e29f4bbafeefaa20dc689f6e2f8923ec7bc3b28a3f
|
@@ -52,21 +52,24 @@ module Pod
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
def zh_ch_reg
|
56
|
+
/@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
|
57
|
+
end
|
58
|
+
|
55
59
|
def handle_file(file)
|
56
60
|
File.open(file, 'r') do |f|
|
57
61
|
f.each_line do |line|
|
58
|
-
handle_line(file, line) if
|
62
|
+
handle_line(file, line) if zh_ch_reg =~ line
|
59
63
|
end
|
60
64
|
end
|
61
65
|
end
|
62
66
|
|
63
67
|
def handle_line(file, line)
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
fname: File.basename(file) }
|
68
|
+
line.scan(zh_ch_reg) do |str|
|
69
|
+
key = "#{File.basename(file, '.*')}.#{rand(36**8).to_s(36)}"
|
70
|
+
@cn_keys << { key: key, cn: str[2, str.length - 3], en: '', str: str, dirname: File.dirname(file),
|
71
|
+
fname: File.basename(file) }
|
72
|
+
end
|
70
73
|
end
|
71
74
|
end
|
72
75
|
end
|
@@ -148,20 +148,24 @@ module Pod
|
|
148
148
|
str
|
149
149
|
end
|
150
150
|
|
151
|
+
def zh_ch_reg
|
152
|
+
/@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
|
153
|
+
end
|
154
|
+
|
151
155
|
def modify_format_string(file, line)
|
152
156
|
result = line
|
153
|
-
result = handle_modify_line(file, line) if
|
157
|
+
result = handle_modify_line(file, line) if zh_ch_reg =~ line
|
154
158
|
result
|
155
159
|
end
|
156
160
|
|
157
161
|
def handle_modify_line(file, line)
|
158
162
|
result = line
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
163
|
+
line.scan(zh_ch_reg) do |m|
|
164
|
+
key = find_key_by_cn_val(file, m)
|
165
|
+
if key
|
166
|
+
val = format(@modify_format_string, "@\"#{key}\"")
|
167
|
+
result = result.gsub(m, val)
|
168
|
+
end
|
165
169
|
end
|
166
170
|
result
|
167
171
|
end
|