@enplug/scripts 1.11.4-dev59 → 1.11.4-dev60
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.
|
@@ -85,12 +85,14 @@ async function syncTranslations(s3Client, bucket) {
|
|
|
85
85
|
const storageId = await uploadFileToCrowdinStorage(credentials, config.localPath);
|
|
86
86
|
if(fileId && storageId) {
|
|
87
87
|
await updateCrowdinFile(credentials, crowdinPath, storageId.data.data.id, fileId);
|
|
88
|
+
await updateFrakeTranslations(fileId);
|
|
88
89
|
}
|
|
89
90
|
} else {
|
|
90
91
|
const storageId = await uploadFileToCrowdinStorage(credentials, config.localPath);
|
|
91
92
|
if(storageId) {
|
|
92
93
|
const result = await addCrowdinFile(credentials, crowdinPath, storageId.data.data.id, folderId);
|
|
93
94
|
console.log('add result', result.data);
|
|
95
|
+
// await updateFrakeTranslations(fileId);
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
} else if((crowdinPathSections[0] === 'dashboard' || crowdinPathSections[0] === 'player-web' || crowdinPathSections[0] === 'components') && appDirectoryId) {
|
|
@@ -100,6 +102,7 @@ async function syncTranslations(s3Client, bucket) {
|
|
|
100
102
|
const storageId = await uploadFileToCrowdinStorage(credentials, config.localPath);
|
|
101
103
|
if(fileId && storageId) {
|
|
102
104
|
await updateCrowdinFile(credentials, crowdinPath, storageId.data.data.id, fileId);
|
|
105
|
+
await updateFrakeTranslations(fileId);
|
|
103
106
|
}
|
|
104
107
|
} else {
|
|
105
108
|
console.error(`Could not upload ${chalk.yellow.bold(`${rowdinPathSections[1]}`)}. Only en.json supported.`);
|
|
@@ -113,22 +116,25 @@ async function syncTranslations(s3Client, bucket) {
|
|
|
113
116
|
const storageId = await uploadFileToCrowdinStorage(credentials, config.localPath);
|
|
114
117
|
if(fileId && storageId) {
|
|
115
118
|
await updateCrowdinFile(credentials, crowdinPath, storageId.data.data.id, fileId);
|
|
119
|
+
await updateFrakeTranslations(fileId);
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
|
-
const { data: fakeTranslation } = await fetchFileFromCrowdin(credentials, FAKE_IN_CONTEXT_LANGUAGE, fileId);
|
|
120
|
-
console.log('eo data', fakeTranslation);
|
|
121
|
-
const s3TranslationsPath = path.parse(s3EnPath).dir;
|
|
122
|
-
console.log('s3TranslationsPath', s3TranslationsPath);
|
|
123
|
-
const s3FakeTranslationPath = path.join(s3TranslationsPath, FAKE_IN_CONTEXT_LANGUAGE_FILE);
|
|
124
|
-
console.log('s3FakeTranslationPath', s3FakeTranslationPath);
|
|
125
|
-
|
|
126
|
-
// await uploadTranslationToS3(s3Client, bucket, s3FakeTranslationPath, JSON.stringify(fakeTranslation));
|
|
127
123
|
}
|
|
128
124
|
}
|
|
129
125
|
}
|
|
130
126
|
}
|
|
131
127
|
|
|
128
|
+
async function updateFrakeTranslations(fileId) {
|
|
129
|
+
const { data: fakeTranslation } = await fetchFileFromCrowdin(credentials, FAKE_IN_CONTEXT_LANGUAGE, fileId);
|
|
130
|
+
console.log('eo data', fakeTranslation);
|
|
131
|
+
const s3TranslationsPath = path.parse(s3EnPath).dir;
|
|
132
|
+
console.log('s3TranslationsPath', s3TranslationsPath);
|
|
133
|
+
const s3FakeTranslationPath = path.join(s3TranslationsPath, FAKE_IN_CONTEXT_LANGUAGE_FILE);
|
|
134
|
+
console.log('s3FakeTranslationPath', s3FakeTranslationPath);
|
|
135
|
+
// await uploadTranslationToS3(s3Client, bucket, s3FakeTranslationPath, JSON.stringify(fakeTranslation));
|
|
136
|
+
}
|
|
137
|
+
|
|
132
138
|
async function promptForceContinue() {
|
|
133
139
|
return inquirer.prompt({
|
|
134
140
|
type: 'confirm',
|