zendesk_apps_tools 3.8.11 → 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 +2 -2
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
|