zendesk_apps_tools 3.8.9 → 3.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/zendesk_apps_tools/translate.rb +16 -16
- data/lib/zendesk_apps_tools/version.rb +1 -1
- metadata +13 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ab3d8023b07c85cb107c3830575ceb7df75265537a1e38b51a64d523ec1d19e0
|
|
4
|
+
data.tar.gz: d04f960bcb63810208ba4b9edf01e4510f1e74e63a57a9363e3df6e106477590
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3694139b1dfbf857eb9e93cdfe2052d124ddda93b3e0d0dc70913aa023576f7657dc9df5192cdc797fb66916c60b92810dbe5911684d2dab7c457ec5bf16db4d
|
|
7
|
+
data.tar.gz: d9cf81fb74890c46f6fd8e2c151b32f59f5bf55ae81d22d504ebde4152d4d2e0e5da67bd0972dd55f7a213ef397f4ffb44b8cf582e1664c637319fe94b26614a
|
|
@@ -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,7 +1,7 @@
|
|
|
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.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James A. Rosen
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2022-
|
|
14
|
+
date: 2022-07-28 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
|
|
@@ -109,14 +115,14 @@ dependencies:
|
|
|
109
115
|
requirements:
|
|
110
116
|
- - "~>"
|
|
111
117
|
- !ruby/object:Gem::Version
|
|
112
|
-
version: 4.
|
|
118
|
+
version: 4.32.0
|
|
113
119
|
type: :runtime
|
|
114
120
|
prerelease: false
|
|
115
121
|
version_requirements: !ruby/object:Gem::Requirement
|
|
116
122
|
requirements:
|
|
117
123
|
- - "~>"
|
|
118
124
|
- !ruby/object:Gem::Version
|
|
119
|
-
version: 4.
|
|
125
|
+
version: 4.32.0
|
|
120
126
|
- !ruby/object:Gem::Dependency
|
|
121
127
|
name: sinatra-cross_origin
|
|
122
128
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -343,7 +349,7 @@ 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
354
|
post_install_message:
|
|
349
355
|
rdoc_options: []
|