web_translate_it 2.7.3 → 2.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/wti +2 -2
- data/history.md +8 -0
- data/lib/web_translate_it/command_line.rb +3 -2
- data/lib/web_translate_it/translation_file.rb +4 -4
- data/lib/web_translate_it.rb +0 -1
- data/readme.md +0 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d28dda70be5e71eeb61a269cceedb3f1406640b4e5526bed6f33d239d1b8527
|
4
|
+
data.tar.gz: 670de23342b5adbbe052373c918a5b757438d42051c51bd9e7b2dc97c23e78bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a7cc04fe367c0b4541b48f1dc08ecda4deedc9891dd4f92f1622060aac4f46cbe6cd0867791f319893e69f2ad50c604684a70c1071168f6b28fbe7d99631315
|
7
|
+
data.tar.gz: 22800578ddbe6ccadd5231ede8fc6bdb9a743692eb17235eff3174c3c1d241a5cc1bcf7bf95096572ced08ac71308ed333625b08a700b657457380489b7f82ea
|
data/bin/wti
CHANGED
@@ -55,7 +55,7 @@ when 'push'
|
|
55
55
|
opt :locale, 'ISO code of locale(s) to push, space-separated', type: :string
|
56
56
|
opt :target, 'Upload all target files'
|
57
57
|
opt :force, 'Force push (bypass conditional requests to WTI)'
|
58
|
-
opt :low_priority, '
|
58
|
+
opt :low_priority, 'Deprecated: option to process this file with a low priority'
|
59
59
|
opt :merge, 'Force WTI to merge this file'
|
60
60
|
opt :ignore_missing, 'Force WTI to not obsolete missing strings'
|
61
61
|
opt :minor, 'Minor Changes. When pushing a master file, prevents target translations to be flagged as `to_verify`.'
|
@@ -67,7 +67,7 @@ when 'push'
|
|
67
67
|
when 'add'
|
68
68
|
Optimist.options do
|
69
69
|
banner 'wti add filename - Create and push a new master language file'
|
70
|
-
opt :low_priority, '
|
70
|
+
opt :low_priority, 'Deprecated: option to process this file with a low priority'
|
71
71
|
opt :config, 'Path to a configuration file', short: '-c', default: '.wti'
|
72
72
|
opt :debug, 'Display debug information'
|
73
73
|
end
|
data/history.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## Version 2.7.5 / 2022-11-17
|
2
|
+
|
3
|
+
* wti now works with `multipart_post = 2.0.0` AND `multipart_post >= 2.2.0`.
|
4
|
+
|
5
|
+
## Version 2.7.4 / 2022-11-01
|
6
|
+
|
7
|
+
* Remove `low-priority` argument as in `wti push --low-priority` and `wti add --low-priority`. All the file imports in WebTranslateIt.com are now top priority.
|
8
|
+
|
1
9
|
## Version 2.7.3 / 2022-10-28
|
2
10
|
|
3
11
|
* Relax dependency on `multipart_post`. Also made sure that wti works with `multipart_post >= 2.0.0 and < 2.3`.
|
@@ -101,6 +101,7 @@ module WebTranslateIt
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def push # rubocop:todo Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
|
104
|
+
puts 'The `--low-priority` option in `wti push --low-priority` was removed and does nothing' if command_options.low_priority
|
104
105
|
complete_success = true
|
105
106
|
$stdout.sync = true
|
106
107
|
before_push_hook
|
@@ -115,7 +116,7 @@ module WebTranslateIt
|
|
115
116
|
puts "Couldn't find any local files registered on WebTranslateIt to push."
|
116
117
|
else
|
117
118
|
files.each do |file|
|
118
|
-
success = file.upload(http, command_options[:merge], command_options.ignore_missing, command_options.label, command_options
|
119
|
+
success = file.upload(http, command_options[:merge], command_options.ignore_missing, command_options.label, command_options[:minor], command_options.force)
|
119
120
|
complete_success = false unless success
|
120
121
|
end
|
121
122
|
end
|
@@ -161,7 +162,7 @@ module WebTranslateIt
|
|
161
162
|
if to_add.any?
|
162
163
|
to_add.each do |param|
|
163
164
|
file = TranslationFile.new(nil, param.gsub(/ /, '\\ '), nil, configuration.api_key)
|
164
|
-
success = file.create(http
|
165
|
+
success = file.create(http)
|
165
166
|
complete_success = false unless success
|
166
167
|
end
|
167
168
|
else
|
@@ -87,7 +87,7 @@ module WebTranslateIt
|
|
87
87
|
# rubocop:todo Metrics/ParameterLists
|
88
88
|
# rubocop:todo Metrics/MethodLength
|
89
89
|
# rubocop:todo Metrics/AbcSize
|
90
|
-
def upload(http_connection, merge = false, ignore_missing = false, label = nil,
|
90
|
+
def upload(http_connection, merge = false, ignore_missing = false, label = nil, minor_changes = false, force = false, rename_others = false, destination_path = nil) # rubocop:todo Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/MethodLength, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
91
91
|
success = true
|
92
92
|
tries ||= 3
|
93
93
|
display = []
|
@@ -96,7 +96,7 @@ module WebTranslateIt
|
|
96
96
|
if File.exist?(file_path)
|
97
97
|
if force || (remote_checksum != local_checksum)
|
98
98
|
File.open(file_path) do |file|
|
99
|
-
params = {'file' => ::Multipart::Post::UploadIO.new(file, 'text/plain', file.path), 'merge' => merge, 'ignore_missing' => ignore_missing, 'label' => label, '
|
99
|
+
params = {'file' => ::Multipart::Post::UploadIO.new(file, 'text/plain', file.path), 'merge' => merge, 'ignore_missing' => ignore_missing, 'label' => label, 'minor_changes' => minor_changes}
|
100
100
|
params['name'] = destination_path unless destination_path.nil?
|
101
101
|
params['rename_others'] = rename_others
|
102
102
|
request = Net::HTTP::Put::Multipart.new(api_url, params)
|
@@ -139,7 +139,7 @@ module WebTranslateIt
|
|
139
139
|
# Note that the request might or might not eventually be acted upon, as it might be disallowed when processing
|
140
140
|
# actually takes place. This is due to the fact that language file imports are handled by background processing.
|
141
141
|
#
|
142
|
-
def create(http_connection
|
142
|
+
def create(http_connection) # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
|
143
143
|
success = true
|
144
144
|
tries ||= 3
|
145
145
|
display = []
|
@@ -147,7 +147,7 @@ module WebTranslateIt
|
|
147
147
|
display.push "#{StringUtil.checksumify(local_checksum.to_s)}..[ ]"
|
148
148
|
if File.exist?(file_path)
|
149
149
|
File.open(file_path) do |file|
|
150
|
-
request = Net::HTTP::Post::Multipart.new(api_url_for_create, {'name' => file_path, 'file' => Multipart::Post::UploadIO.new(file, 'text/plain', file.path)
|
150
|
+
request = ::Net::HTTP::Post::Multipart.new(api_url_for_create, {'name' => file_path, 'file' => Multipart::Post::UploadIO.new(file, 'text/plain', file.path)})
|
151
151
|
WebTranslateIt::Util.add_fields(request)
|
152
152
|
display.push Util.handle_response(http_connection.request(request))
|
153
153
|
puts ArrayUtil.to_columns(display)
|
data/lib/web_translate_it.rb
CHANGED
data/readme.md
CHANGED
@@ -99,7 +99,6 @@ Append `--help` for each command for more information. For instance:
|
|
99
99
|
-l, --locale=<s> ISO code of locale(s) to push
|
100
100
|
-t, --target Upload all target files
|
101
101
|
-f, --force Force push (bypass conditional requests to WTI)
|
102
|
-
-o, --low-priority WTI will process this file with a low priority
|
103
102
|
-m, --merge Force WTI to merge this file
|
104
103
|
-i, --ignore-missing Force WTI to not obsolete missing strings
|
105
104
|
-n, --minor Minor Changes. When pushing a master file, prevents
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_translate_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edouard Briere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
|
-
rubygems_version: 3.3.
|
117
|
+
rubygems_version: 3.3.21
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: A CLI tool to sync locale files with WebTranslateIt.com.
|