@enplug/scripts 1.11.4-dev25 → 1.11.4-dev26
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.
|
@@ -108,11 +108,11 @@ function getCrowdinConfig() {
|
|
|
108
108
|
return pkg.config.crowdin;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
function generateFormData(crowdinPath, localPath) {
|
|
112
112
|
// const reader = new FileReader();
|
|
113
113
|
const formData = new FormData();
|
|
114
114
|
console.log('localPath', localPath);
|
|
115
|
-
const file =
|
|
115
|
+
const file = fs.readFile(localPath);
|
|
116
116
|
console.log('file', file);
|
|
117
117
|
// formData.append('update_option', 'update_without_changes'); // Previous translations should remain valid
|
|
118
118
|
// formData.append('json', '');
|
|
@@ -121,9 +121,9 @@ async function generateFormData(crowdinPath, localPath) {
|
|
|
121
121
|
return formData;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
function postFileToCrowdin(credentials, crowdinPath, localPath) {
|
|
125
125
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
126
|
-
const formData =
|
|
126
|
+
const formData = generateFormData(crowdinPath, localPath);
|
|
127
127
|
|
|
128
128
|
const url = `${CROWDIN_STORAGE_URL}`;
|
|
129
129
|
console.log('formData', formData);
|