web_translate_it 2.4.12 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/wti +3 -3
- data/history.md +20 -0
- data/lib/web_translate_it/configuration.rb +1 -1
- data/lib/web_translate_it/translation_file.rb +8 -3
- data/lib/web_translate_it/util/array_util.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f01930a3c46a7521f57e14caa623d495f37d81f1e392ceee1d11716e53366f69
|
4
|
+
data.tar.gz: 24f554f5a22af0333e19adbcd846e1e100d789d06be261b28a943851307e5c57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65aa66ec8c8b70c937c18de52857e8d2a54835847b147ea2b9c8e07e761ea8ef262b1af6db87be42ee6b41c36b94eaee1748f677e36dacb453e27e84e4710f7d
|
7
|
+
data.tar.gz: 47d4c899f44bb80f04d695a0365fe2acd9948b3cfac8eec936ce9df44c846a4659fcbd34e1023aab686ac2b51ec3ed39f0e68ff84e3852484745ae905b058533
|
data/bin/wti
CHANGED
@@ -40,7 +40,7 @@ command_options = case command
|
|
40
40
|
wti pull [filename] - Pull target language file(s)
|
41
41
|
[options] are:
|
42
42
|
EOS
|
43
|
-
opt :locale, "ISO code of locale(s) to pull", type: :string
|
43
|
+
opt :locale, "ISO code of locale(s) to pull, space-separated", type: :string
|
44
44
|
opt :all, "Pull all files"
|
45
45
|
opt :force, "Force pull (bypass conditional requests to WTI)"
|
46
46
|
opt :config, "Path to a configuration file", short: "-c", default: ".wti"
|
@@ -52,7 +52,7 @@ EOS
|
|
52
52
|
wti push [filename] - Push master language file(s)
|
53
53
|
[options] are:
|
54
54
|
EOS
|
55
|
-
opt :locale, "ISO code of locale(s) to push", type: :string
|
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
58
|
opt :low_priority, "WTI will process this file with a low priority"
|
@@ -97,7 +97,7 @@ EOS
|
|
97
97
|
end
|
98
98
|
when "status"
|
99
99
|
Optimist::options do
|
100
|
-
banner "wti status - Fetch and display project statistics"
|
100
|
+
banner "wti status - Fetch and display project statistics.\nReturns 100 if untranslated segments exist in project\nReturns 101 if unproofread segments exist in project."
|
101
101
|
opt :config, "Path to a configuration file", short: "-c", default: ".wti"
|
102
102
|
opt :debug, "Display debug information"
|
103
103
|
end
|
data/history.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
## Version 2.5.0 / 2021-11-15
|
2
|
+
|
3
|
+
* Display files that are being updated on WebTranslateIt but are not ready to be downloaded by a `*`.
|
4
|
+
|
5
|
+
``` bash
|
6
|
+
~/Desktop/test% wti pull
|
7
|
+
# Pulling files on test 3
|
8
|
+
*cs-CZ.de.yml | 65a7fc8..65a7fc8 Skipped
|
9
|
+
en.yml | ffd8096..ffd8096 Skipped
|
10
|
+
i18nextv4.de.json | 142aca7..142aca7 Skipped
|
11
|
+
*cs-CZ.yml | 42c32a3..42c32a3 Skipped
|
12
|
+
de.yml | 9dda491..9dda491 Skipped
|
13
|
+
test.de.json | 48a9c13..48a9c13 Skipped
|
14
|
+
test.de.txt | 8f305f3..8f305f3 Skipped
|
15
|
+
test.json | 7a9478f..7a9478f Skipped
|
16
|
+
i18nextv4.json | 84d6cdf..8776cb3 OK
|
17
|
+
test.txt | 8f305f3..7a1a5db OK
|
18
|
+
```
|
19
|
+
* Improve help on `wti status` documentation.
|
20
|
+
|
1
21
|
## Version 2.4.12 / 2021-06-30
|
2
22
|
|
3
23
|
* Add ability to pass project API token as an ENV variable. You can run:
|
@@ -71,7 +71,7 @@ module WebTranslateIt
|
|
71
71
|
if project_file['name'].nil? or project_file['name'].strip == ''
|
72
72
|
puts "File #{project_file['id']} not set up"
|
73
73
|
else
|
74
|
-
self.files.push TranslationFile.new(project_file['id'], project_file['name'], project_file['locale_code'], self.api_key, project_file['updated_at'], project_file['hash_file'], project_file['master_project_file_id'])
|
74
|
+
self.files.push TranslationFile.new(project_file['id'], project_file['name'], project_file['locale_code'], self.api_key, project_file['updated_at'], project_file['hash_file'], project_file['master_project_file_id'], project_file['fresh'])
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
@@ -12,9 +12,9 @@ module WebTranslateIt
|
|
12
12
|
require 'time'
|
13
13
|
require 'fileutils'
|
14
14
|
|
15
|
-
attr_accessor :id, :file_path, :locale, :api_key, :updated_at, :remote_checksum, :master_id
|
15
|
+
attr_accessor :id, :file_path, :locale, :api_key, :updated_at, :remote_checksum, :master_id, :fresh
|
16
16
|
|
17
|
-
def initialize(id, file_path, locale, api_key, updated_at = nil, remote_checksum = "", master_id = nil)
|
17
|
+
def initialize(id, file_path, locale, api_key, updated_at = nil, remote_checksum = "", master_id = nil, fresh = nil)
|
18
18
|
self.id = id
|
19
19
|
self.file_path = file_path
|
20
20
|
self.locale = locale
|
@@ -22,6 +22,7 @@ module WebTranslateIt
|
|
22
22
|
self.updated_at = updated_at
|
23
23
|
self.remote_checksum = remote_checksum
|
24
24
|
self.master_id = master_id
|
25
|
+
self.fresh = fresh
|
25
26
|
end
|
26
27
|
|
27
28
|
# Fetch a language file.
|
@@ -40,7 +41,11 @@ module WebTranslateIt
|
|
40
41
|
success = true
|
41
42
|
tries ||= 3
|
42
43
|
display = []
|
43
|
-
|
44
|
+
if self.fresh
|
45
|
+
display.push(self.file_path)
|
46
|
+
else
|
47
|
+
display.push("*#{self.file_path}")
|
48
|
+
end
|
44
49
|
display.push "#{StringUtil.checksumify(self.local_checksum.to_s)}..#{StringUtil.checksumify(self.remote_checksum.to_s)}"
|
45
50
|
if !File.exist?(self.file_path) or force or self.remote_checksum != self.local_checksum
|
46
51
|
begin
|
@@ -1,6 +1,10 @@
|
|
1
1
|
class ArrayUtil
|
2
2
|
def self.to_columns(arr)
|
3
|
-
|
3
|
+
if arr[0][0] == "*"
|
4
|
+
"*#{StringUtil.backward_truncate(arr[0][1..-1])} | #{arr[1]} #{arr[2]}\n"
|
5
|
+
else
|
6
|
+
" #{StringUtil.backward_truncate(arr[0])} | #{arr[1]} #{arr[2]}\n"
|
7
|
+
end
|
4
8
|
end
|
5
9
|
|
6
10
|
def self.chunk(arr, pieces=2)
|
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.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edouard Briere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|