Skip to content

Commit 8e0e318

Browse files
committed
added troubleshoot toggle that skips calling
openai api
1 parent 48fe8df commit 8e0e318

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

i18n/controllers/recurTranslate.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ const ignoredTags = [
3030

3131
const MAXLEN = Number(process.env.MAX_LEN) || 3000;
3232

33+
// change to true to avoid calling openai api, useful for troubleshooting
34+
// chunking logic
35+
const troubleshoot = false;
36+
3337
// Centralized logging to prevent duplicate messages
3438
const errorMessages = new Set();
3539
// Track errors by file for summary reporting
@@ -404,7 +408,7 @@ async function recursivelyTranslate(
404408
}
405409

406410
async function translateChunk(chunk: string): Promise<string> {
407-
return chunk;
411+
if (troubleshoot) return chunk;
408412
if (chunk.trim() === "" || chunk.trim() === "," || chunk.trim() === ".") {
409413
return chunk;
410414
}

0 commit comments

Comments
 (0)