cocoapods-aqara-localzedLoader 0.1.18 → 0.1.19
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: e0872fb98493ce6fa9062bc52692dfdc8bcbd887c03dc788db4b487816734063
|
|
4
|
+
data.tar.gz: 56a9a54e72c32ae5bea75440aa77d80e9cde59998dc54d937741fff3fe6f51bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b44fd6f5494b0dff6fc8d0dd84f85d9f3ebe53f53f6ef4e671f9bc77c4bcd3bed22eeb9d875ff3781d6c47e36c72e788173c25c4a5da1a2829d9679928e4284
|
|
7
|
+
data.tar.gz: cb2ce1639ad048231e5f748ece6cf2d3549af6442b4c9849c68dd277ba7dcf0d080c8097c2848249a8a7d9c6c7d7b1f56ef375f9eba836704801ac2becdf49cb
|
|
@@ -11,6 +11,7 @@ class BundleGenerater
|
|
|
11
11
|
"crowdin_space.yml" => { project_id: "85", app_dir: "AqaraSpace" },
|
|
12
12
|
"crowdin.yml" => { project_id: "71", app_dir: "AqaraHome" }
|
|
13
13
|
}.freeze
|
|
14
|
+
SKIP_INFO_PLIST_APP_DIRS = %w[AqaraLife AqaraSpace].freeze
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
# INFO_PLIST_ARRAY = [NSAppleMusicUsageDescription","NSLocalNetworkUsageDescription"]
|
|
@@ -58,6 +59,10 @@ class BundleGenerater
|
|
|
58
59
|
|
|
59
60
|
@@download_Count = 1
|
|
60
61
|
|
|
62
|
+
def self.skip_info_plist?(app_dir)
|
|
63
|
+
SKIP_INFO_PLIST_APP_DIRS.include?(app_dir)
|
|
64
|
+
end
|
|
65
|
+
|
|
61
66
|
def self.resolve_crowdin_project(project_path)
|
|
62
67
|
CROWDIN_PROJECTS.each do |config_name, project_info|
|
|
63
68
|
app_dir = project_info[:app_dir]
|
|
@@ -188,22 +193,24 @@ class BundleGenerater
|
|
|
188
193
|
end
|
|
189
194
|
|
|
190
195
|
#如果是infoplist里的key,就写入指定的文件
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
File.open(file, "a") do |io|
|
|
196
|
-
io.write str
|
|
197
|
-
end
|
|
198
|
-
elsif INFO_PLIST_MAP.has_key?(key.to_sym)
|
|
199
|
-
# puts "---key:#{key}"
|
|
200
|
-
keys = INFO_PLIST_MAP[key.to_sym]
|
|
201
|
-
keys.each do |info_key|
|
|
196
|
+
unless self.skip_info_plist?(app_dir)
|
|
197
|
+
if key === nil
|
|
198
|
+
puts "key值为空,#{stringElement.ios_list}"
|
|
199
|
+
elsif key === "NSAppleMusicUsageDescription" || key === "NSLocalNetworkUsageDescription"
|
|
202
200
|
file = "./#{lang}.lproj/InfoPlist.strings"
|
|
203
|
-
str = %Q|"#{info_key}" = "#{value}";\n|
|
|
204
201
|
File.open(file, "a") do |io|
|
|
205
202
|
io.write str
|
|
206
203
|
end
|
|
204
|
+
elsif INFO_PLIST_MAP.has_key?(key.to_sym)
|
|
205
|
+
# puts "---key:#{key}"
|
|
206
|
+
keys = INFO_PLIST_MAP[key.to_sym]
|
|
207
|
+
keys.each do |info_key|
|
|
208
|
+
file = "./#{lang}.lproj/InfoPlist.strings"
|
|
209
|
+
str = %Q|"#{info_key}" = "#{value}";\n|
|
|
210
|
+
File.open(file, "a") do |io|
|
|
211
|
+
io.write str
|
|
212
|
+
end
|
|
213
|
+
end
|
|
207
214
|
end
|
|
208
215
|
end
|
|
209
216
|
|
|
@@ -226,9 +233,11 @@ class BundleGenerater
|
|
|
226
233
|
# puts "\e[31m 开始校验多语言包格式\e[0m"
|
|
227
234
|
file_til.getLangList.each do |lang|
|
|
228
235
|
localized_file = "./#{lang}.lproj/Localizable.strings"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
236
|
+
unless self.skip_info_plist?(app_dir)
|
|
237
|
+
file = "./#{lang}.lproj/InfoPlist.strings"
|
|
238
|
+
if File.exist?(file)
|
|
239
|
+
system("plutil #{file}")
|
|
240
|
+
end
|
|
232
241
|
end
|
|
233
242
|
if File.exist?(localized_file)
|
|
234
243
|
system("plutil #{localized_file}")
|
|
@@ -260,13 +269,15 @@ class BundleGenerater
|
|
|
260
269
|
FileUtils.cp(path,dest2)
|
|
261
270
|
FileUtils.mv("#{path}",dest,force:true)
|
|
262
271
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
272
|
+
unless self.skip_info_plist?(app_dir)
|
|
273
|
+
info_plist_file = "./#{lang}.lproj/InfoPlist.strings"
|
|
274
|
+
# puts "path::::::#{info_plist_file}"
|
|
275
|
+
if File.exist? info_plist_file
|
|
276
|
+
copy_info_plist = true
|
|
277
|
+
dest = "./#{app_dir}/Resource/#{lang}.lproj"
|
|
278
|
+
FileUtils.mkdir_p dest
|
|
279
|
+
FileUtils.mv("#{info_plist_file}",dest,force:true)
|
|
280
|
+
end
|
|
270
281
|
end
|
|
271
282
|
# FileUtils.rm_rf (File.dirname(path))
|
|
272
283
|
end
|
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.1.
|
|
4
|
+
version: 0.1.19
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- zhaoxifan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|