Releases: pescheckit/python-gpt-po
Releases · pescheckit/python-gpt-po
Enhanced language code handling
This release adds robust language code handling:
- Accepts "Language: French" and "Language: fr" in metadata
- Added pycountry for standardized language support
- Handles ISO codes, full names, and native names
Breaking Changes
None
Dependencies
- pycountry>=22.1.10
Usage
pip install --upgrade python-gpt-po
Added tenacity
- Added tenacity
Updated to 0.2.12
- Added
--detail-lang
Updated correct handeling of multiple languages
- Updated correct handeling of multiple languages
Significant Enhancements with a Minor Update
Major Functional Updates
- Enhanced Batch Processing: Improved precision in batch functions, adjusting batch size for optimal performance and accuracy.
- Retry Mechanism Introduced: Implemented retries across multiple scenarios to enhance reliability, including retries specifically for translation and parsing issues.
- AI Translation Enhancements: Enhanced context handling for AI translations, including retries when certain explanatory phrases are detected.
- Contextual Awareness for AI: Updated the AI's context to explicitly recognize its role as a translator, ensuring more accurate and context-aware translations.
Technical Details
- Updated Batch Size: Batch size adjusted from 50 to 40 to better manage API limits and improve processing efficiency.
- JSON Array Parsing: Introduced a structured JSON array format for parsing, improving data handling and ensuring consistent translation output.
- Batch and Single Translation Improvements: Refined the bulk and single translation methods to better handle chunk processing, including retries for individual translations when bulk translations fail.
- Improved Error Handling: Enhanced error handling and logging to provide more detailed information about translation failures and retries.
- Translation Context Improvements: Updated the translation prompt context to provide clearer and more direct instructions for the AI, reducing the likelihood of errors and unnecessary explanations.
- Enhanced PO File Handling: Added methods to manage and update PO file entries more effectively, including handling fuzzy translations and validating translation quality.
Example Translation Context:
f"Translate the following list of texts from English to {target_language}. "
"Provide only the translations in a JSON array format, maintaining the original order. "
"Each translation should be concise and direct, without explanations or additional context. "
"Keep special characters, placeholders, and formatting intact. "
"If a term should not be translated (like 'URL' or technical terms), keep it as is. "
"Example format: [\"Translation 1\", \"Translation 2\", ...]\n\n"
"Texts to translate:\n"
Additional Changes:
- PO File Management: Introduced new utilities to disable fuzzy translations and infer file languages based on folder structure.
- Unit Test Enhancements: Updated unit tests to reflect the new bulk and single translation logic, including improved mock handling and test coverage.
- Dependency Updates: Updated dependencies to include the latest versions of
openai
andtenacity
libraries, ensuring compatibility with the latest API features.
This update brings significant improvements in precision, reliability, and overall functionality of the translation system, ensuring smoother operations and more accurate results.
video.mp4
Release 0.1.13
- Added simple tests
Updated version to 0.1.12
- Fixed issue with non
--bulk
Updated version to 0.1.10
- Fixed issue with index
Updated version to 0.1.9
- Changed workflow github to make sure only build when linting is done
Updated to version 0.1.8
- Added indexing of gpt