Aqara_localizable 0.0.1 → 0.0.3
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: 81a6dcb2ae02b0dd0a6770219c2b504066dbaf18230d3de3c1774ecf3d1bd09a
|
4
|
+
data.tar.gz: c34677b5b73c122f71bb588ea32bff28f3750163ced5b095b640f79b29ae79c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fbb8cc1a89bf10fea55eff789b141bc776a35e4a4807c4be7df1d5fb0561469481dd31a903126a209efdf2a5eb8b63dbc9647ea21f918d93e582c926da5309b
|
7
|
+
data.tar.gz: fec24ebc5ad4806b65fdcfaf1bec1cc98a5034e5abc74362bd5066bf99bf813a39581dde9ea7562e0df2faf63c3b80d4bb8969b727001b1bbc6a989f80848b66
|
@@ -26,9 +26,9 @@ module AqaraLocalizable
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def run
|
29
|
-
puts '
|
29
|
+
puts '如果多语言脚本插件有问题可以找zxf看看'.green
|
30
30
|
target_path = Pathname.new(File.dirname(__FILE__)).realpath.parent.parent
|
31
|
-
|
31
|
+
|
32
32
|
system "cd #{target_path}/script/ios_py_code;python3 ios_sp_str_generator.py #{@project_directory}"
|
33
33
|
# system 'cd /lib/script/ios_py_code;python3 ios_sp_str_generator.py'
|
34
34
|
end
|
@@ -4,7 +4,7 @@ require 'Aqara_localizable'
|
|
4
4
|
module Pod
|
5
5
|
# hook
|
6
6
|
@HooksManager = HooksManager
|
7
|
-
@HooksManager.register('
|
7
|
+
@HooksManager.register('Aqara_localizable', :post_install) do |_, _options|
|
8
8
|
args = ['gen', "--project-directory=#{Config.instance.installation_root}"]
|
9
9
|
|
10
10
|
AqaraLocalizable::Command.run(args)
|
@@ -84,64 +84,63 @@ def getfilter():
|
|
84
84
|
|
85
85
|
|
86
86
|
if __name__ == '__main__':
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
#
|
106
|
-
|
107
|
-
#
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
#
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
#
|
137
|
-
#
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
# copyLocalizedToDestPath(iosStringListPath, zxfcodePath)
|
87
|
+
|
88
|
+
localizable_path = sys.argv[1]
|
89
|
+
|
90
|
+
DownloadNewLanguage.UpdateSource_language()
|
91
|
+
filepath = '../source_language/hit_all_str.xlsx'
|
92
|
+
|
93
|
+
platformUniteStrDict = file_util.readXlsxFileToDict(filepath)
|
94
|
+
print(len(platformUniteStrDict))
|
95
|
+
isIndexLan = False
|
96
|
+
if isIndexLan:
|
97
|
+
addIndex(platformUniteStrDict)
|
98
|
+
|
99
|
+
dirname = '../output_file/ios'
|
100
|
+
iosStringListPath = string_repeat_filter.generateIOSStringPathList(dirname)
|
101
|
+
|
102
|
+
|
103
|
+
[os.makedirs(os.path.dirname(x)) for x in iosStringListPath if not os.path.exists(os.path.dirname(x))]
|
104
|
+
|
105
|
+
# srcList = [cnXml, enXml,knXml,rnXml,twXml,hkXml,geXml,frXml,itXml,esXml]
|
106
|
+
|
107
|
+
# se.valueList = [chinese_simp,english,korea,russia,chinese_tw,chinese_hk,german,french,itay,spain]
|
108
|
+
|
109
|
+
iosFisList = [open(x,'w') for x in iosStringListPath]
|
110
|
+
for k in platformUniteStrDict:
|
111
|
+
item = platformUniteStrDict.get(k)
|
112
|
+
valueList = item.valueList
|
113
|
+
for str,ifis in zip(valueList,iosFisList):
|
114
|
+
# print(item.id)
|
115
|
+
|
116
|
+
if str == None:
|
117
|
+
continue
|
118
|
+
if str.__contains__(r'""'):
|
119
|
+
str = str.replace(r'""', r'"')
|
120
|
+
if str.__contains__(r'\"'):
|
121
|
+
str = str.replace(r'\"', r'"')
|
122
|
+
if str.__contains__(r'""'):
|
123
|
+
str = str.replace(r'""', r'"')
|
124
|
+
if str.__contains__(r'"') :
|
125
|
+
str = str.replace(r'"', r'\"')
|
126
|
+
|
127
|
+
if str.endswith('\\'):
|
128
|
+
str = str[0:-1]
|
129
|
+
|
130
|
+
if str.endswith('\\'):
|
131
|
+
str = str[0:-1]
|
132
|
+
iosStr = f'\"{k}\" = \"{str}\";\n'
|
133
|
+
ifis.write(iosStr)
|
134
|
+
|
135
|
+
for ifs in iosFisList:
|
136
|
+
# afis.write('</resources>')
|
137
|
+
# afis.close()
|
138
|
+
ifs.close()
|
139
|
+
|
140
|
+
codePath = f'{localizable_path}/AqaraHome/Common/Frameworks/LMFramework.bundle'
|
141
|
+
print(f'校对下替换的位置是否正确====={codePath}')
|
142
|
+
if os.path.exists(codePath):
|
143
|
+
copyLocalizedToDestPath(iosStringListPath,codePath)
|
145
144
|
|
146
145
|
|
147
146
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Aqara_localizable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zhaoxifan
|
@@ -146,11 +146,11 @@ files:
|
|
146
146
|
- README.md
|
147
147
|
- bin/Aqaralocalizable
|
148
148
|
- lib/Aqara_localizable.rb
|
149
|
-
- lib/Aqara_localizable/cocoapods_plugin.rb
|
150
149
|
- lib/Aqara_localizable/command.rb
|
151
150
|
- lib/Aqara_localizable/command/command_gen.rb
|
152
151
|
- lib/Aqara_localizable/command/zxf.py
|
153
152
|
- lib/Aqara_localizable/gem_version.rb
|
153
|
+
- lib/cocoapods_plugin.rb
|
154
154
|
- lib/script/git_shell/addPrefix.sh
|
155
155
|
- lib/script/git_shell/android_git_clean.sh
|
156
156
|
- lib/script/git_shell/commit_push.sh
|
@@ -301,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
301
|
- !ruby/object:Gem::Version
|
302
302
|
version: '0'
|
303
303
|
requirements: []
|
304
|
-
rubygems_version: 3.
|
304
|
+
rubygems_version: 3.3.26
|
305
305
|
signing_key:
|
306
306
|
specification_version: 4
|
307
307
|
summary: AqaraHome 多语言插件
|