This pull request introduces support for right-to-left (RTL) languages in the Gemini SRT Translator. Significant changes include the detection of RTL text and the embedding of RTL markers to ensure proper display in subtitle files. Special thanks to @Theamoz for helping. Key improvements are as follows:
Enhanced the translation process to handle RTL text.
Added the dominant_strong_direction method to determine the text direction and embed appropriate markers.
Introduced a new SubtitleObject type for better type checking.
Improved batch processing logic to handle quotas and errors more gracefully.
Prevent infinite loop in case Gemini insists on returning unexpected responses.
Updated the version in setup.py to 1.2.0.
Impact:
This change will enable the translation of subtitles into RTL languages, ensuring they are correctly displayed in media players. It also improves the robustness of the translation process, handling quotas and errors more effectively.
This pull request introduces support for right-to-left (RTL) languages in the Gemini SRT Translator. Significant changes include the detection of RTL text and the embedding of RTL markers to ensure proper display in subtitle files. Special thanks to @Theamoz for helping. Key improvements are as follows:
dominant_strong_direction
method to determine the text direction and embed appropriate markers.SubtitleObject
type for better type checking.setup.py
to1.2.0
.Impact:
This change will enable the translation of subtitles into RTL languages, ensuring they are correctly displayed in media players. It also improves the robustness of the translation process, handling quotas and errors more effectively.