@vocab/phrase
Advanced tools
Comparing version 0.0.0-push-split-translation-files-20230508035947 to 0.0.0-push-split-translation-files-20230508044055
@@ -9,5 +9,5 @@ import type { TranslationsByLanguage } from '@vocab/core'; | ||
}): Promise<{ | ||
uploadIds: string[]; | ||
devLanguageUploadId: string; | ||
}>; | ||
export declare function deleteUnusedKeys(uploadId: string, branch: string): Promise<void>; | ||
export declare function ensureBranch(branch: string): Promise<void>; |
@@ -161,3 +161,3 @@ 'use strict'; | ||
} = translationsToCsv(translationsByLanguage, devLanguage); | ||
const uploadIds = []; | ||
let devLanguageUploadId = ''; | ||
for (const [language, csvFileString] of Object.entries(csvFileStrings)) { | ||
@@ -168,3 +168,3 @@ const formData = new FormData__default["default"](); | ||
contentType: 'text/csv', | ||
filename: 'translations.csv' | ||
filename: `${language}.translations.csv` | ||
}); | ||
@@ -194,6 +194,8 @@ formData.append('file_format', 'csv'); | ||
} | ||
uploadIds.push(result.id); | ||
if (language === devLanguage) { | ||
devLanguageUploadId = result.id; | ||
} | ||
} | ||
return { | ||
uploadIds | ||
devLanguageUploadId | ||
}; | ||
@@ -344,3 +346,3 @@ } | ||
const { | ||
uploadIds | ||
devLanguageUploadId | ||
} = await pushTranslations(phraseTranslations, { | ||
@@ -351,5 +353,3 @@ devLanguage: config.devLanguage, | ||
if (deleteUnusedKeys$1) { | ||
for (const uploadId of uploadIds) { | ||
await deleteUnusedKeys(uploadId, branch); | ||
} | ||
await deleteUnusedKeys(devLanguageUploadId, branch); | ||
} | ||
@@ -356,0 +356,0 @@ } |
@@ -161,3 +161,3 @@ 'use strict'; | ||
} = translationsToCsv(translationsByLanguage, devLanguage); | ||
const uploadIds = []; | ||
let devLanguageUploadId = ''; | ||
for (const [language, csvFileString] of Object.entries(csvFileStrings)) { | ||
@@ -168,3 +168,3 @@ const formData = new FormData__default["default"](); | ||
contentType: 'text/csv', | ||
filename: 'translations.csv' | ||
filename: `${language}.translations.csv` | ||
}); | ||
@@ -194,6 +194,8 @@ formData.append('file_format', 'csv'); | ||
} | ||
uploadIds.push(result.id); | ||
if (language === devLanguage) { | ||
devLanguageUploadId = result.id; | ||
} | ||
} | ||
return { | ||
uploadIds | ||
devLanguageUploadId | ||
}; | ||
@@ -344,3 +346,3 @@ } | ||
const { | ||
uploadIds | ||
devLanguageUploadId | ||
} = await pushTranslations(phraseTranslations, { | ||
@@ -351,5 +353,3 @@ devLanguage: config.devLanguage, | ||
if (deleteUnusedKeys$1) { | ||
for (const uploadId of uploadIds) { | ||
await deleteUnusedKeys(uploadId, branch); | ||
} | ||
await deleteUnusedKeys(devLanguageUploadId, branch); | ||
} | ||
@@ -356,0 +356,0 @@ } |
@@ -149,3 +149,3 @@ import { promises } from 'fs'; | ||
} = translationsToCsv(translationsByLanguage, devLanguage); | ||
const uploadIds = []; | ||
let devLanguageUploadId = ''; | ||
for (const [language, csvFileString] of Object.entries(csvFileStrings)) { | ||
@@ -156,3 +156,3 @@ const formData = new FormData(); | ||
contentType: 'text/csv', | ||
filename: 'translations.csv' | ||
filename: `${language}.translations.csv` | ||
}); | ||
@@ -182,6 +182,8 @@ formData.append('file_format', 'csv'); | ||
} | ||
uploadIds.push(result.id); | ||
if (language === devLanguage) { | ||
devLanguageUploadId = result.id; | ||
} | ||
} | ||
return { | ||
uploadIds | ||
devLanguageUploadId | ||
}; | ||
@@ -332,3 +334,3 @@ } | ||
const { | ||
uploadIds | ||
devLanguageUploadId | ||
} = await pushTranslations(phraseTranslations, { | ||
@@ -339,5 +341,3 @@ devLanguage: config.devLanguage, | ||
if (deleteUnusedKeys$1) { | ||
for (const uploadId of uploadIds) { | ||
await deleteUnusedKeys(uploadId, branch); | ||
} | ||
await deleteUnusedKeys(devLanguageUploadId, branch); | ||
} | ||
@@ -344,0 +344,0 @@ } |
{ | ||
"name": "@vocab/phrase", | ||
"version": "0.0.0-push-split-translation-files-20230508035947", | ||
"version": "0.0.0-push-split-translation-files-20230508044055", | ||
"main": "dist/vocab-phrase.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/vocab-phrase.esm.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43817