Skip to content

Commit

Permalink
fix delay in bot-translator
Browse files Browse the repository at this point in the history
  • Loading branch information
miku448 committed Oct 17, 2024
1 parent baea5a9 commit 27918d9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions apps/bot-translator/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ type NovelState = NovelV3.NovelState;
const languageCodeToName = new Map([
['es', 'Spanish'],
['es_ar', 'Spanish (Argentina)'],
['es_es', 'Spanish (España)'],
['es_cl', 'Spanish (Chile)'],
['pt', 'Portuguese'],
['pt_br', 'Portuguese (Brazil)'],
['fr', 'French'],
Expand All @@ -26,8 +24,6 @@ const languageCodeToName = new Map([
const languageCodeToExtraPrompt = new Map([
['es', 'Use typical Spanish expressions and vocabulary.'],
['es_ar', 'Use typical Argentinean Spanish expressions and vocabulary.'],
['es_es', 'Use typical Spanish from Spain expressions and vocabulary.'],
['es_cl', 'Use typical Chilean Spanish expressions and vocabulary.'],
['pt', 'Use typical Portuguese expressions and vocabulary.'],
['pt_br', 'Use typical Brazilian Portuguese expressions and vocabulary.'],
['fr', 'Use typical French expressions and vocabulary.'],
Expand Down Expand Up @@ -106,9 +102,9 @@ const BotTranslator = () => {
);
translatedTexts.push(...batchTranslations);

// Add a 2-second delay between batches
// Add a 10-second delay between batches
if (i + batchSize < textsToTranslate.length) {
await new Promise((resolve) => setTimeout(resolve, 2000));
await new Promise((resolve) => setTimeout(resolve, 10000));
}
}

Expand Down

0 comments on commit 27918d9

Please sign in to comment.