Add Hebrew locale with RTL support and finalize translations#1711
Open
lidorshimoni wants to merge 10 commits intohacksider:mainfrom
Open
Add Hebrew locale with RTL support and finalize translations#1711lidorshimoni wants to merge 10 commits intohacksider:mainfrom
lidorshimoni wants to merge 10 commits intohacksider:mainfrom
Conversation
Agent-Logs-Url: https://github.com/lidorshimoni/Deep-Live-Cam/sessions/d38f6c91-b2a0-44dd-8218-9f204fdd8fc6 Co-authored-by: lidorshimoni <26524213+lidorshimoni@users.noreply.github.com>
Agent-Logs-Url: https://github.com/lidorshimoni/Deep-Live-Cam/sessions/d38f6c91-b2a0-44dd-8218-9f204fdd8fc6 Co-authored-by: lidorshimoni <26524213+lidorshimoni@users.noreply.github.com>
Agent-Logs-Url: https://github.com/lidorshimoni/Deep-Live-Cam/sessions/289e90ea-7063-4c1e-9bc2-ccb74dd00e35 Co-authored-by: lidorshimoni <26524213+lidorshimoni@users.noreply.github.com>
Agent-Logs-Url: https://github.com/lidorshimoni/Deep-Live-Cam/sessions/35d4dfae-b82a-4fc6-9ef9-7c871ad91f5b Co-authored-by: lidorshimoni <26524213+lidorshimoni@users.noreply.github.com>
Address PR feedback on RTL locale handling and Hebrew UI coverage
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds RTL-aware translation handling, wires several remaining UI labels into the i18n system, and introduces a Hebrew locale JSON file for full RTL localization support. Sequence diagram for RTL-aware translation lookupsequenceDiagram
participant UI as UILayer
participant LM as LanguageManager
UI->>LM: _(key="Face Enhancer", default=None)
activate LM
LM->>LM: text = translations.get(key, default or key)
LM->>LM: normalized_lang = current_language.lower().split("-", 1)[0]
alt normalized_lang in RTL_LANGUAGES
alt text startswith RTL_MARK
LM-->>UI: text
else text does not startwith RTL_MARK
LM->>LM: text = RTL_MARK + text
LM-->>UI: text
end
else normalized_lang not in RTL_LANGUAGES
LM-->>UI: text
end
deactivate LM
UI->>UI: Create CTkLabel(text=translated_text)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In
LanguageManager._, the non-RTL path currently falls through without areturn, so you should add a finalreturn textafter the RTL-specific block to preserve the original behavior for LTR languages. - When checking for the existing RTL mark with
text.startswith(RTL_MARK), consider trimming leading whitespace or using a more robust check, otherwise translations with leading spaces will be wrapped with a duplicate RTL mark.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `LanguageManager._`, the non-RTL path currently falls through without a `return`, so you should add a final `return text` after the RTL-specific block to preserve the original behavior for LTR languages.
- When checking for the existing RTL mark with `text.startswith(RTL_MARK)`, consider trimming leading whitespace or using a more robust check, otherwise translations with leading spaces will be wrapped with a duplicate RTL mark.
## Individual Comments
### Comment 1
<location path="modules/ui.py" line_range="436-439" />
<code_context>
save_switch_states()
- enhancer_label = ctk.CTkLabel(root, text="Face Enhancer:")
+ enhancer_label = ctk.CTkLabel(root, text=f'{_("Face Enhancer")}:')
enhancer_label.place(relx=0.1, rely=0.62, relwidth=0.2, relheight=0.03)
</code_context>
<issue_to_address>
**suggestion:** Include punctuation in the translatable string to allow locale-specific placement.
Currently the colon is concatenated outside the translation (e.g. `_("Face Enhancer") + ":"`), which prevents locale-specific punctuation or placement (especially for RTL languages). Instead, pass the full label string to translation, e.g. `_("Face Enhancer:")`, so translators can control punctuation as needed.
Suggested implementation:
```python
enhancer_label = ctk.CTkLabel(root, text=_("Face Enhancer:"))
```
```python
transparency_label = ctk.CTkLabel(root, text=_("Transparency:"))
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
Adds Hebrew localization support, including RTL text handling, and updates several UI labels to use translated strings.
Changes:
- Added
locales/he.jsonwith Hebrew translations for existing UI strings. - Implemented RTL support in
LanguageManager._()by prefixing RTL-mark for RTL languages. - Updated several CustomTkinter label strings to be translatable (Face Enhancer / Transparency / Sharpness / Mouth Mask).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| modules/ui.py | Converts a few hard-coded label texts into translated equivalents. |
| modules/gettext.py | Adds RTL language detection + RTL mark insertion in the translation helper. |
| locales/he.json | Introduces Hebrew translations for many UI strings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…dling Agent-Logs-Url: https://github.com/lidorshimoni/Deep-Live-Cam/sessions/c31b322f-c5f7-4019-8491-71ec704a366b Co-authored-by: lidorshimoni <26524213+lidorshimoni@users.noreply.github.com>
…ons-pr-1711 Address PR hacksider#1711 review feedback for RTL localization and translatable UI labels
ultrasage-danz
approved these changes
Mar 29, 2026
Author
|
lets merge :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UI verification screenshots
Hebrew (localized + RTL) — proof of fix
Summary by Sourcery
Add RTL-aware localization support for Hebrew and apply translations to additional UI labels.
New Features:
Enhancements: