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: d60fa736dfb0db80fef1a6d8cbbd386c16a0ed3d4af05bf76205c5f470a0308d
4
- data.tar.gz: ce3fc2c27b75c36958eaefde370ed108b5c18abfd75f841430aebf3925b27b03
3
+ metadata.gz: 81a6dcb2ae02b0dd0a6770219c2b504066dbaf18230d3de3c1774ecf3d1bd09a
4
+ data.tar.gz: c34677b5b73c122f71bb588ea32bff28f3750163ced5b095b640f79b29ae79c8
5
5
  SHA512:
6
- metadata.gz: 4fda4aa5fafa775c907d36b387f57641fafb0aef37035e572e0b5815a18f2930750eb01f4173e91dfc349b8b44dd8d1e76de91c3eb6d9a3076d46053eddf3435
7
- data.tar.gz: 9c3592ad307c795dc76af7efae9fc187b06d7779b3cb4aab32559bc5282f9a4b8896adaec8ace9926f0f773924f68b326e466be68c5b104ba80d071563b2b1bc
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
- puts target_path
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
@@ -1,3 +1,3 @@
1
1
  module AqaraLocalizable
2
- VERSION = '0.0.1'.freeze unless defined? AqaraLocalizable::VERSION
2
+ VERSION = '0.0.3'.freeze unless defined? AqaraLocalizable::VERSION
3
3
  end
@@ -4,7 +4,7 @@ require 'Aqara_localizable'
4
4
  module Pod
5
5
  # hook
6
6
  @HooksManager = HooksManager
7
- @HooksManager.register('Aqara_Localizable', :post_install) do |_, _options|
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
- print('zxfdddddd'+sys.argv[1])
88
-
89
- # DownloadNewLanguage.UpdateSource_language()
90
- # filepath = '../source_language/hit_all_str.xlsx'
91
- #
92
- # platformUniteStrDict = file_util.readXlsxFileToDict(filepath)
93
- # print(len(platformUniteStrDict))
94
- # isIndexLan = False
95
- # if isIndexLan:
96
- # addIndex(platformUniteStrDict)
97
- #
98
- # dirname = '../output_file/ios'
99
- # iosStringListPath = string_repeat_filter.generateIOSStringPathList(dirname)
100
- #
101
- #
102
- # [os.makedirs(os.path.dirname(x)) for x in iosStringListPath if not os.path.exists(os.path.dirname(x))]
103
- #
104
- # # srcList = [cnXml, enXml,knXml,rnXml,twXml,hkXml,geXml,frXml,itXml,esXml]
105
- #
106
- # # se.valueList = [chinese_simp,english,korea,russia,chinese_tw,chinese_hk,german,french,itay,spain]
107
- #
108
- # iosFisList = [open(x,'w') for x in iosStringListPath]
109
- # for k in platformUniteStrDict:
110
- # item = platformUniteStrDict.get(k)
111
- # valueList = item.valueList
112
- # for str,ifis in zip(valueList,iosFisList):
113
- # # print(item.id)
114
- #
115
- # if str == None:
116
- # continue
117
- # if str.__contains__(r'""'):
118
- # str = str.replace(r'""', r'"')
119
- # if str.__contains__(r'\"'):
120
- # str = str.replace(r'\"', r'"')
121
- # if str.__contains__(r'""'):
122
- # str = str.replace(r'""', r'"')
123
- # if str.__contains__(r'"') :
124
- # str = str.replace(r'"', r'\"')
125
- #
126
- # if str.endswith('\\'):
127
- # str = str[0:-1]
128
- #
129
- # if str.endswith('\\'):
130
- # str = str[0:-1]
131
- # iosStr = f'\"{k}\" = \"{str}\";\n'
132
- # ifis.write(iosStr)
133
- #
134
- # for ifs in iosFisList:
135
- # # afis.write('</resources>')
136
- # # afis.close()
137
- # ifs.close()
138
- #
139
- # codePath = f'../../AqaraHome/AqaraHome/Common/Frameworks/LMFramework.bundle'
140
- # zxfcodePath = f'../../AqaraHome_app/AqaraHome/Common/Frameworks/LMFramework.bundle'
141
- # if os.path.exists(codePath):
142
- # copyLocalizedToDestPath(iosStringListPath,codePath)
143
- # elif os.path.exists(zxfcodePath):
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.1
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.1.6
304
+ rubygems_version: 3.3.26
305
305
  signing_key:
306
306
  specification_version: 4
307
307
  summary: AqaraHome 多语言插件