cocoapods-aqara-localzedLoader 0.0.8 → 0.0.9
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: 70f7cdf4029ec8ec4a7a1b0f49700e141507fa80073509d21835b0c82e71ff94
|
4
|
+
data.tar.gz: 7d0dc878df2a7e977e0555adcb1a6b8e130f7b477c5cb984cc1d4ccc2221b8e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be02d3c670ea91b1883c6b2b4f45f2006d5abed9e867eeaa15fca706f56d997ae029e6f8d016996d2e8df57f172299fb8e0b60eb54832af6976ca52afdd57018
|
7
|
+
data.tar.gz: cb182f9cbc60eb5810d6736f8e34923b0f2dcb950c6d305f5bea1474af33e15775379d2c502107811d216a15bc83305006b42bbc60bc3be5d0bd3c71143038b6
|
data/Gemfile.lock
CHANGED
@@ -52,11 +52,17 @@ class BundleGenerater
|
|
52
52
|
@@download_Count = 1
|
53
53
|
|
54
54
|
def self.downloadxls(project_path)
|
55
|
+
if @@download_Count > 10
|
56
|
+
puts "当前无网络,程序即将退出。"
|
57
|
+
exit(1)
|
58
|
+
end
|
55
59
|
if @@download_Count > 1
|
56
|
-
|
60
|
+
base = 2
|
61
|
+
sleep_time = base * (2 ** (@@download_Count - 2))
|
62
|
+
puts "等待#{sleep_time}秒后重试..."
|
63
|
+
sleep sleep_time
|
57
64
|
end
|
58
65
|
puts "当前进行第#{@@download_Count}次尝试下载多语言文件"
|
59
|
-
#Open3.capture3("cd #{File.dirname(__FILE__)};python3 DownloadNewLanguage.py #{project_path}")
|
60
66
|
system "cd #{File.dirname(__FILE__)};python3 DownloadNewLanguage.py #{project_path}"
|
61
67
|
@@download_Count = @@download_Count + 1
|
62
68
|
end
|
@@ -72,7 +78,6 @@ class BundleGenerater
|
|
72
78
|
until File.exist?(f_path)
|
73
79
|
self.downloadxls(project_path)
|
74
80
|
end
|
75
|
-
|
76
81
|
# 读取excel到内存
|
77
82
|
file_til = File_util.new
|
78
83
|
hash = file_til.read_excel f_path
|
@@ -93,18 +98,26 @@ class BundleGenerater
|
|
93
98
|
|
94
99
|
end
|
95
100
|
|
101
|
+
errors = []
|
96
102
|
#生成资源文件
|
97
103
|
hash.each do |key, stringElement|
|
98
|
-
|
104
|
+
expected_count = nil
|
99
105
|
stringElement.langHash.each do |lang, value|
|
100
106
|
# puts "#{lang}:#{value}"
|
101
107
|
next if lang.downcase === "selfkey" or value === nil or value === " " or value === ""
|
102
108
|
value = self.handleValue value,stringElement
|
103
|
-
value.scan(/%@/)
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
109
|
+
current_count = value.scan(/%@/).size
|
110
|
+
|
111
|
+
if expected_count.nil?
|
112
|
+
expected_count = current_count
|
113
|
+
elsif current_count != expected_count
|
114
|
+
errors << {
|
115
|
+
key: key,
|
116
|
+
lang: lang,
|
117
|
+
expected: expected_count,
|
118
|
+
actual: current_count
|
119
|
+
}
|
120
|
+
next
|
108
121
|
end
|
109
122
|
str = %Q|"#{key}" = "#{value}";\n|
|
110
123
|
localized_file = "./#{lang}.lproj/Localizable.strings"
|
@@ -138,6 +151,17 @@ class BundleGenerater
|
|
138
151
|
end
|
139
152
|
end
|
140
153
|
|
154
|
+
#判读是否有多语言出现不同语种%@数量不匹配,出现后中断打包
|
155
|
+
if errors.any?
|
156
|
+
puts "以下 key 的 %@ 在不同语种的数量存在不一致,让产品交互速度改后再打包:\n".red
|
157
|
+
errors.each do |err|
|
158
|
+
puts "key: #{err[:key]} | 语言: #{err[:lang]} | 实际: #{err[:actual]} | 应为: #{err[:expected]}".red
|
159
|
+
end
|
160
|
+
exit(1)
|
161
|
+
else
|
162
|
+
puts "✅ 所有 key 的 %@ 在不同语种保持数量一致".green
|
163
|
+
end
|
164
|
+
|
141
165
|
#验证导出的多语言包格式是否正确
|
142
166
|
puts '开始校验多语言包格式'.red
|
143
167
|
# puts "\e[31m 开始校验多语言包格式\e[0m"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-aqara-localzedLoader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zhaoxifan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|