Skip to content

Commit ffdb9ae

Browse files
committed
corrected minor bugs
1 parent 28ded1d commit ffdb9ae

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

i18n/index.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,21 @@ async function setupCleanupHandlers() {
173173
});
174174
}
175175

176-
async function needsTranslation(enFilePath: string, lang: string): boolean {
176+
async function needsTranslation(
177+
enFilePath: string,
178+
lang: string
179+
): Promise<boolean> {
177180
const cnFilePath = enFilePath.replace(
178181
path.sep + "en" + path.sep,
179-
path.sep + ".." + path.sep + "i18n" + path.sep + "translation_output" + path.sep + lang + path.sep
182+
path.sep +
183+
".." +
184+
path.sep +
185+
"i18n" +
186+
path.sep +
187+
"translation_output" +
188+
path.sep +
189+
lang +
190+
path.sep
180191
);
181192
try {
182193
const cnStats = await fs.promises.stat(cnFilePath);
@@ -285,7 +296,9 @@ export default async function fancyName(path: string, language: string) {
285296
batch.map(async file => {
286297
if (absent) {
287298
if (!(await needsTranslation(file, lang))) {
288-
console.log(`Skipped translation for ${file} to language ${lang} (yarn trans abs)`);
299+
console.log(
300+
`Skipped translation for ${file} to language ${lang} (yarn trans abs)`
301+
);
289302
return { file, success: true };
290303
}
291304
}

0 commit comments

Comments
 (0)