Skip to content

Commit

Permalink
Fix split texts
Browse files Browse the repository at this point in the history
  • Loading branch information
robisim74 committed Jun 1, 2024
1 parent 97bcd58 commit 6839ee3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export async function gptTranslateJson(options: GptTranslateJsonOptions) {
const estimatedTokens = estimateTokens(lenTexts);
const n = Math.ceil(estimatedTokens / resolvedOptions.maxTokens);

return [...chunks(texts, Math.ceil(lenTexts / n))];
return [...chunks(texts, Math.ceil(texts.length / n))];
};

const flattenData = (filesMap: Map<string, Translation>): Map<string, Map<string, string>> => {
Expand Down

0 comments on commit 6839ee3

Please sign in to comment.