zendesk_apps_tools 3.8.10 → 3.8.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zendesk_apps_tools/translate.rb +16 -16
- data/lib/zendesk_apps_tools/version.rb +1 -1
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eae6401940c6ae89b9646d1ebae7466a2407e4a4b567670cc4d3282066a4d24b
|
4
|
+
data.tar.gz: 228251bef91f1101b00425c2bdbebf859ea8143b7b33b69666188662637238c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65cf71eff599c088b53cf60a45708a243cea378f38b0b95b9f7c0d219ad013534445215d4c6904a6b85c103ca9997d4fce2e34e9d8b360e6a600bfcaf4afce70
|
7
|
+
data.tar.gz: e47f7143202c46e2aea4ba1a271d4262f7d61ac89d8a1cf00eead6d44f2a1233bfdded0d1f977de50e649df088b5191498f3dbc4659595a770b5c8d5c03f6589
|
@@ -10,8 +10,8 @@ module ZendeskAppsTools
|
|
10
10
|
include Thor::Actions
|
11
11
|
include ZendeskAppsTools::Common
|
12
12
|
|
13
|
-
LOCALE_BASE_ENDPOINT = 'https://
|
14
|
-
LOCALE_ENDPOINT = "#{LOCALE_BASE_ENDPOINT}/
|
13
|
+
LOCALE_BASE_ENDPOINT = 'https://static.zdassets.com/translations'
|
14
|
+
LOCALE_ENDPOINT = "#{LOCALE_BASE_ENDPOINT}/admin/manifest.json"
|
15
15
|
|
16
16
|
desc 'to_yml', 'Create Zendesk translation file from en.json'
|
17
17
|
shared_options(except: [:clean])
|
@@ -45,16 +45,17 @@ module ZendeskAppsTools
|
|
45
45
|
setup_path(options[:path]) if options[:path]
|
46
46
|
app_package = package_name_for_update
|
47
47
|
locale_list
|
48
|
-
|
48
|
+
.map { |locale| fetch_locale_async locale }
|
49
49
|
.each do |locale_thread|
|
50
50
|
locale = locale_thread.value
|
51
51
|
translations = locale['translations']
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
locale_name = locale['locale']
|
53
|
+
if not locale_name.match(/-x-/)
|
54
|
+
write_json(
|
55
|
+
"translations/#{locale_name}.json",
|
56
|
+
nest_translations_hash(translations, "txt.apps.#{app_package}.")
|
57
|
+
)
|
58
|
+
end
|
58
59
|
end
|
59
60
|
say('Translations updated', :green)
|
60
61
|
end
|
@@ -75,11 +76,11 @@ module ZendeskAppsTools
|
|
75
76
|
end
|
76
77
|
|
77
78
|
no_commands do
|
78
|
-
def fetch_locale_async(locale
|
79
|
+
def fetch_locale_async(locale)
|
79
80
|
Thread.new do
|
80
|
-
say("Fetching #{locale['
|
81
|
-
json = Faraday.get("#{locale['
|
82
|
-
json_or_die(json)
|
81
|
+
say("Fetching #{locale['name']}")
|
82
|
+
json = Faraday.get("#{LOCALE_BASE_ENDPOINT}#{locale['path']}").body
|
83
|
+
json_or_die(json)
|
83
84
|
end
|
84
85
|
end
|
85
86
|
|
@@ -168,13 +169,12 @@ module ZendeskAppsTools
|
|
168
169
|
content = read_file(options[:locales])
|
169
170
|
locales = JSON.parse(content)
|
170
171
|
return locales.map do |locale|
|
171
|
-
{ '
|
172
|
+
{ 'name' => locale, 'path' => "/admin/#{locale}.json" }
|
172
173
|
end
|
173
174
|
end
|
174
175
|
|
175
176
|
locale_response = Faraday.get(LOCALE_ENDPOINT)
|
176
|
-
|
177
|
-
return json_or_die(locale_response.body)['locales'] if locale_response.status == 200
|
177
|
+
return json_or_die(locale_response.body)['json'] if locale_response.status == 200
|
178
178
|
if locale_response.status == 401
|
179
179
|
say_error_and_exit 'Authentication failed.'
|
180
180
|
else
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_apps_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James A. Rosen
|
8
8
|
- Kenshiro Nakagawa
|
9
9
|
- Shajith Chacko
|
10
10
|
- Likun Liu
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-
|
14
|
+
date: 2022-08-02 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: thor
|
@@ -65,16 +65,22 @@ dependencies:
|
|
65
65
|
name: sinatra
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- - "
|
68
|
+
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: 1.4.6
|
71
|
+
- - "<"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: 2.3.0
|
71
74
|
type: :runtime
|
72
75
|
prerelease: false
|
73
76
|
version_requirements: !ruby/object:Gem::Requirement
|
74
77
|
requirements:
|
75
|
-
- - "
|
78
|
+
- - ">="
|
76
79
|
- !ruby/object:Gem::Version
|
77
80
|
version: 1.4.6
|
81
|
+
- - "<"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 2.3.0
|
78
84
|
- !ruby/object:Gem::Dependency
|
79
85
|
name: faraday
|
80
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -343,9 +349,9 @@ files:
|
|
343
349
|
- templates/translation.erb.tt
|
344
350
|
homepage: http://github.com/zendesk/zendesk_apps_tools
|
345
351
|
licenses:
|
346
|
-
- Apache
|
352
|
+
- Apache-2.0
|
347
353
|
metadata: {}
|
348
|
-
post_install_message:
|
354
|
+
post_install_message:
|
349
355
|
rdoc_options: []
|
350
356
|
require_paths:
|
351
357
|
- lib
|
@@ -361,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
361
367
|
version: 1.3.6
|
362
368
|
requirements: []
|
363
369
|
rubygems_version: 3.0.3.1
|
364
|
-
signing_key:
|
370
|
+
signing_key:
|
365
371
|
specification_version: 4
|
366
372
|
summary: Tools to help you develop Zendesk Apps.
|
367
373
|
test_files:
|