@crowdin/app-project-module 0.84.0 → 0.84.2
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.
|
@@ -178,6 +178,7 @@ function processSyncSettings({ config, integration, period, syncSettings, }) {
|
|
|
178
178
|
crowdinId: crowdinCredentials.id,
|
|
179
179
|
clientId: integrationCredentials.id,
|
|
180
180
|
};
|
|
181
|
+
const logInfo = (0, logger_1.withContext)(context);
|
|
181
182
|
try {
|
|
182
183
|
const preparedCrowdinClient = yield (0, connection_1.prepareCrowdinClient)({
|
|
183
184
|
config,
|
|
@@ -189,6 +190,9 @@ function processSyncSettings({ config, integration, period, syncSettings, }) {
|
|
|
189
190
|
crowdinClient = preparedCrowdinClient.client;
|
|
190
191
|
}
|
|
191
192
|
catch (e) {
|
|
193
|
+
intConfig.schedule = '0';
|
|
194
|
+
yield (0, storage_1.getStorage)().updateIntegrationConfig(syncSettings.integrationId, JSON.stringify(intConfig));
|
|
195
|
+
logInfo(`Auto-sync has been disabled for organization '${crowdinCredentials.id}'.`);
|
|
192
196
|
(0, logger_1.logError)(e, context);
|
|
193
197
|
return;
|
|
194
198
|
}
|
|
@@ -159,8 +159,8 @@ function applyIntegrationModuleDefaults(config, integration) {
|
|
|
159
159
|
if (integration.withCronSync || integration.webhooks) {
|
|
160
160
|
defaultSettings.push({
|
|
161
161
|
key: 'schedule',
|
|
162
|
-
label: '
|
|
163
|
-
helpText:
|
|
162
|
+
label: 'Sync schedule',
|
|
163
|
+
helpText: `Defines how often content is synced between ${config.name} and Crowdin. Make sure Auto Sync is enabled for selected directories and files in the dual pane view.`,
|
|
164
164
|
type: 'select',
|
|
165
165
|
defaultValue: '0',
|
|
166
166
|
options: [
|
|
@@ -208,16 +208,18 @@ function applyIntegrationModuleDefaults(config, integration) {
|
|
|
208
208
|
}
|
|
209
209
|
if (integration.uploadTranslations) {
|
|
210
210
|
defaultSettings.push({
|
|
211
|
+
labelHtml: `<b>Translation sync settings (${config.name} → Crowdin)</b>`,
|
|
212
|
+
}, {
|
|
211
213
|
key: 'importEqSuggestions',
|
|
212
|
-
label: '
|
|
214
|
+
label: 'Add translations that are the same as the source text',
|
|
213
215
|
type: 'checkbox',
|
|
214
216
|
}, {
|
|
215
217
|
key: 'autoApproveImported',
|
|
216
|
-
label: '
|
|
218
|
+
label: 'Mark added translations as Approved in Crowdin',
|
|
217
219
|
type: 'checkbox',
|
|
218
220
|
}, {
|
|
219
221
|
key: 'translateHidden',
|
|
220
|
-
label: '
|
|
222
|
+
label: 'Add translations for hidden source strings in Crowdin',
|
|
221
223
|
type: 'checkbox',
|
|
222
224
|
});
|
|
223
225
|
}
|
|
@@ -54,7 +54,8 @@ function webhookHandler(config, webhooks) {
|
|
|
54
54
|
const crowdinId = domain && (0, lodash_isstring_1.default)(domain) ? domain : organizationId;
|
|
55
55
|
const credentials = yield storage.getStorage().getCrowdinCredentials(crowdinId);
|
|
56
56
|
if (!credentials) {
|
|
57
|
-
|
|
57
|
+
res.status(401).send({ error: 'Unable to load Crowdin credentials' });
|
|
58
|
+
return;
|
|
58
59
|
}
|
|
59
60
|
const hmac = crypto.createHmac('sha256', credentials.appSecret);
|
|
60
61
|
hmac.update(req.body.toString());
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
integration-logo="logo.png"
|
|
81
81
|
{{#if uploadTranslations}}
|
|
82
82
|
{{#if excludedTargetLanguages}}
|
|
83
|
-
integration-button-menu-items='[{"label":"Sync translations", "title":"Sync translations to Crowdin", "action":"uploadTranslations"}, {"label":"Select target languages", "title":"Upload file for translation into selected languages", "action":"excludedTargetLanguages"}]'
|
|
83
|
+
integration-button-menu-items='[{"label":"Sync translations", "title":"Sync existing translations from {{name}} to Crowdin. Falls back to heuristics if string keys are not defined. Accuracy may vary.", "action":"uploadTranslations"}, {"label":"Select target languages", "title":"Upload file for translation into selected languages", "action":"excludedTargetLanguages"}]'
|
|
84
84
|
{{else}}
|
|
85
|
-
integration-button-menu-items='[{"label":"Sync translations", "title":"Sync translations to Crowdin", "action":"uploadTranslations"}]'
|
|
85
|
+
integration-button-menu-items='[{"label":"Sync translations", "title":"Sync existing translations from {{name}} to Crowdin. Falls back to heuristics if string keys are not defined. Accuracy may vary.", "action":"uploadTranslations"}]'
|
|
86
86
|
{{/if}}
|
|
87
87
|
{{else}}
|
|
88
88
|
{{#if excludedTargetLanguages}}
|
package/package.json
CHANGED