fastlane-plugin-ovo_poeditor 1.2.2 → 1.3.0
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e082b2c0393766dea58070c73c7f1ea3eb118a7ef0effca92c4a5184e475e5a2
|
|
4
|
+
data.tar.gz: 586dc24ffd6dd6cf38f84424b8693d6108f00772853652d71e2991bbfd72b61c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 36ae1520ca8cafce02b89676b421c8c32dc7ba7b5972e14ed602f833daa0fcec165b871ef3ddb8348689808864a6b4498c8771ecc38af4c5f88a89089e106301
|
|
7
|
+
data.tar.gz: 62044688877950c6e1fb5f966350da8051fe5ada4da4259334478e7c01780c7f5e8501abebc2a0b8633de0f85fe6964c1171b113671f097419b4dcc20ab3a655
|
|
@@ -15,6 +15,7 @@ module Fastlane
|
|
|
15
15
|
language_map = params[:language_map]
|
|
16
16
|
unquoted_strings = params[:unquoted_strings]
|
|
17
17
|
bypass_default_language = params[:bypass_default_language]
|
|
18
|
+
fallback_languages = params[:fallback_languages]
|
|
18
19
|
|
|
19
20
|
Helper::OvoPoeditorHelper.sync_strings(
|
|
20
21
|
api_token: api_token,
|
|
@@ -26,7 +27,8 @@ module Fastlane
|
|
|
26
27
|
default_language: default_language,
|
|
27
28
|
language_map: language_map,
|
|
28
29
|
unquoted_strings: unquoted_strings,
|
|
29
|
-
bypass_default_language: bypass_default_language
|
|
30
|
+
bypass_default_language: bypass_default_language,
|
|
31
|
+
fallback_languages: fallback_languages
|
|
30
32
|
)
|
|
31
33
|
end
|
|
32
34
|
|
|
@@ -121,6 +123,13 @@ module Fastlane
|
|
|
121
123
|
optional: true,
|
|
122
124
|
type: Boolean,
|
|
123
125
|
default_value: false
|
|
126
|
+
),
|
|
127
|
+
FastlaneCore::ConfigItem.new(
|
|
128
|
+
key: :fallback_languages,
|
|
129
|
+
env_name: 'POEDITOR_FALLBACK_LANGUAGES',
|
|
130
|
+
description: 'Optional. Map of fallback languages',
|
|
131
|
+
optional: true,
|
|
132
|
+
type: Hash
|
|
124
133
|
)
|
|
125
134
|
]
|
|
126
135
|
end
|
|
@@ -22,7 +22,8 @@ module Fastlane
|
|
|
22
22
|
default_language:,
|
|
23
23
|
language_map:,
|
|
24
24
|
unquoted_strings:,
|
|
25
|
-
bypass_default_language
|
|
25
|
+
bypass_default_language:,
|
|
26
|
+
fallback_languages:
|
|
26
27
|
)
|
|
27
28
|
unless @supported_export_types.include?(file_format)
|
|
28
29
|
UI.error("Invalid export type '#{file_format}'. Allowed values: #{@supported_export_types.join(', ')}")
|
|
@@ -36,7 +37,8 @@ module Fastlane
|
|
|
36
37
|
project_id: project_id,
|
|
37
38
|
language: language,
|
|
38
39
|
file_format: file_format,
|
|
39
|
-
unquoted_strings: unquoted_strings
|
|
40
|
+
unquoted_strings: unquoted_strings,
|
|
41
|
+
fallback_languages: fallback_languages
|
|
40
42
|
)
|
|
41
43
|
|
|
42
44
|
if export_url.nil?
|
|
@@ -63,7 +65,7 @@ module Fastlane
|
|
|
63
65
|
end
|
|
64
66
|
end
|
|
65
67
|
|
|
66
|
-
def self.fetch_export_url(api_token:, project_id:, language:, file_format:, unquoted_strings:)
|
|
68
|
+
def self.fetch_export_url(api_token:, project_id:, language:, file_format:, unquoted_strings:, fallback_languages:)
|
|
67
69
|
uri = URI('https://api.poeditor.com/v2/projects/export')
|
|
68
70
|
request = Net::HTTP::Post.new(uri)
|
|
69
71
|
|
|
@@ -77,6 +79,9 @@ module Fastlane
|
|
|
77
79
|
form_data['options'] = '[{"export_all":1}]' if file_format == 'xcstrings'
|
|
78
80
|
form_data['options'] = "[{'unquoted': #{unquoted_strings}}]" if file_format == 'android_strings'
|
|
79
81
|
|
|
82
|
+
fallback_language = fallback_languages&.[](language.to_s)
|
|
83
|
+
form_data['fallback_language'] = fallback_language if fallback_language && !fallback_language.empty?
|
|
84
|
+
|
|
80
85
|
request.set_form_data(form_data)
|
|
81
86
|
|
|
82
87
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
|