Skip to content

feat: concurrent translations#3

Merged
edeoliv merged 9 commits intomainfrom
development
Jun 30, 2025
Merged

feat: concurrent translations#3
edeoliv merged 9 commits intomainfrom
development

Conversation

@andrefelipe18
Copy link
Copy Markdown
Contributor

This pull request introduces significant enhancements to the AITranslator service, focusing on performance improvements through parallel processing, better handling of string normalization, and new customization options. Key changes include the addition of a process pool for parallel translation, updates to the documentation, and improvements to internal utilities and methods.

Performance Improvements

  • Process Pool for Parallelism: Introduced a process pool mechanism in AITranslator to enable concurrent processing of translations, improving performance for large datasets and multiple target languages. This includes a new withProcessPool method to configure parallelism and a TranslateChunkCommand for chunk-based processing. [1] [2] [3] [4] [5] [6]

Documentation Enhancements

  • API Documentation Updates: Expanded the docs/api/aitranslator.md file to include details on the process pool, multiple language translation, and new methods like withProcessPool and onSave. These updates provide clear usage examples and highlight the performance benefits of parallelism. [1] [2] [3] [4]

String Normalization Improvements

  • Normalization of Escaped Apostrophes: Updated the normalizeStringsArray method in Utils to handle escaped apostrophes in both keys and values, ensuring consistent string formatting.

Codebase Enhancements

  • Improved Key Handling in AIProvider: Added methods to replace and restore double quotes in array keys to avoid issues with JSON schema validation during translation. [1] [2] [3]
  • Refactoring and Cleanup: Minor refactoring across multiple files, including method formatting, improved instantiation of Utils, and removal of unused imports. [1] [2] [3] [4]

These changes collectively enhance the usability, performance, and maintainability of the AITranslator service.

@andrefelipe18 andrefelipe18 self-assigned this Jun 29, 2025
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 29, 2025

Deploying langfy with  Cloudflare Pages  Cloudflare Pages

Latest commit: 376f58e
Status: ✅  Deploy successful!
Preview URL: https://c5d3b112.langfy.pages.dev
Branch Preview URL: https://development.langfy.pages.dev

View logs

@edeoliv edeoliv merged commit 034954c into main Jun 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants