feat: Add Polish Language#1155
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRemoves the i18n public header/API declarations (lib/I18n/I18nKeys.h, lib/I18n/I18nStrings.h) and adds a new Polish translation resource (lib/I18n/translations/polish.yaml). Also updates scripts/gen_i18n.py to map "polish" → "PL". Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
lib/I18n/translations/polish.yaml (1)
60-130: Confirm remaining English strings are intentional.
Several entries remain in English (e.g., STR_CONNECT_WIRELESS, STR_STATUS_BAR, STR_EXTRA_SPACING, STR_COLOR_MODE, STR_DOCUMENT_MATCHING, STR_EXTERNAL_FONT, STR_FETCH_FEED_FAILED, STR_UI_THEME, STR_CALIBRE_DESC, STR_GO_HOME_BUTTON, STR_SYNC_PROGRESS). If this is not intentional, consider translating them for a consistent Polish UI.Also applies to: 159-319
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/I18n/translations/polish.yaml` around lines 60 - 130, Several translation keys (e.g., STR_CONNECT_WIRELESS, STR_STATUS_BAR, STR_EXTRA_SPACING, STR_COLOR_MODE, STR_DOCUMENT_MATCHING, STR_EXT_READER_FONT/STR_EXT_CHINESE_FONT/STR_EXT_UI_FONT, STR_FETCH_FEED_FAILED, STR_UI_THEME, STR_CALIBRE_DESC, STR_GO_HOME_BUTTON, STR_SYNC_PROGRESS) are still in English; please provide Polish translations for these entries to ensure a consistent UI. Locate the keys in the polish.yaml (present around the shown block and later between lines ~159-319) and replace the English values with their correct Polish equivalents, keeping the same key names and escaping/formatting (e.g., newline sequences) as in existing entries; if any keys are intentionally left English, add a comment beside them indicating that’s deliberate. Ensure pluralization/grammar fits the app context (labels vs. sentences) and run a quick pass to verify no other English strings remain in the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/I18n/translations/polish.yaml`:
- Line 15: The STR_START_READING translation contains Polish typos/incorrect
diacritics ("Zacznij czytać póniźej") — update its value to the correct Polish
string (e.g., "Zacznij czytać poniżej"); then scan the Polish YAML for other
user-facing strings flagged in the review and correct their spelling/diacritics
as well, ensuring keys like STR_START_READING and the other flagged translation
keys have natural, grammatically correct Polish text.
---
Nitpick comments:
In `@lib/I18n/translations/polish.yaml`:
- Around line 60-130: Several translation keys (e.g., STR_CONNECT_WIRELESS,
STR_STATUS_BAR, STR_EXTRA_SPACING, STR_COLOR_MODE, STR_DOCUMENT_MATCHING,
STR_EXT_READER_FONT/STR_EXT_CHINESE_FONT/STR_EXT_UI_FONT, STR_FETCH_FEED_FAILED,
STR_UI_THEME, STR_CALIBRE_DESC, STR_GO_HOME_BUTTON, STR_SYNC_PROGRESS) are still
in English; please provide Polish translations for these entries to ensure a
consistent UI. Locate the keys in the polish.yaml (present around the shown
block and later between lines ~159-319) and replace the English values with
their correct Polish equivalents, keeping the same key names and
escaping/formatting (e.g., newline sequences) as in existing entries; if any
keys are intentionally left English, add a comment beside them indicating that’s
deliberate. Ensure pluralization/grammar fits the app context (labels vs.
sentences) and run a quick pass to verify no other English strings remain in the
file.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
lib/I18n/I18nKeys.hlib/I18n/I18nStrings.hlib/I18n/translations/polish.yaml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: cppcheck
- GitHub Check: build
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-02-16T22:25:35.674Z
Learnt from: whyte-j
Repo: crosspoint-reader/crosspoint-reader PR: 733
File: lib/I18n/I18nKeys.h:271-272
Timestamp: 2026-02-16T22:25:35.674Z
Learning: In the crosspoint-reader i18n system (lib/I18n/), missing translation keys in non-English YAML files are automatically filled with English strings at build time by the gen_i18n.py script. All generated string arrays (STRINGS_EN, STRINGS_ES, etc.) have identical lengths, so runtime array indexing is safe without per-string fallback logic. The system prints "INFO: '{key}' missing in {lang_code}, using English fallback" during code generation when this occurs.
Applied to files:
lib/I18n/I18nStrings.hlib/I18n/translations/polish.yamllib/I18n/I18nKeys.h
📚 Learning: 2026-02-23T22:11:42.181Z
Learnt from: ariel-lindemann
Repo: crosspoint-reader/crosspoint-reader PR: 1133
File: lib/I18n/translations/finnish.yaml:92-92
Timestamp: 2026-02-23T22:11:42.181Z
Learning: In translation YAML files located in lib/I18n/translations/, literal percent signs (%) in strings (e.g., STR_HIDE_BATTERY, STR_GO_TO_PERCENT, STR_PERCENT_STEP_HINT) do not require escaping as %% and this convention is consistent across all language translations. Ensure that this pattern is followed for all YAML files in this directory to avoid introducing incorrect formatting markers in localized strings.
Applied to files:
lib/I18n/translations/polish.yaml
🧬 Code graph analysis (1)
lib/I18n/I18nKeys.h (1)
lib/I18n/I18nStrings.h (1)
i18n_strings(8-25)
🔇 Additional comments (4)
lib/I18n/I18nStrings.h (1)
23-23: LGTM — Polish strings export is wired.lib/I18n/I18nKeys.h (3)
21-21: LGTM — STRINGS_PL forward declaration added.
39-40: LGTM — enum extended with POLISH.
400-401: LGTM — switch now maps POLISH to STRINGS_PL.
lib/I18n/translations/polish.yaml
Outdated
| STR_CALIBRE_LIBRARY: "Biblioteka Calibre" | ||
| STR_CONTINUE_READING: "Wznów czytanie" | ||
| STR_NO_OPEN_BOOK: "Brak otwartych książek" | ||
| STR_START_READING: "Zacznij czytać póniźej" |
There was a problem hiding this comment.
Fix Polish typos/diacritics in user-facing strings.
These look like spelling/grammar errors in the UI.
✏️ Suggested corrections
-STR_START_READING: "Zacznij czytać póniźej"
+STR_START_READING: "Zacznij czytać poniżej"
-STR_CHECK_UPDATES: "Sprawdź uaktualnia"
+STR_CHECK_UPDATES: "Sprawdź aktualizacje"
-STR_CLEAR_CACHE_WARNING_1: "To wyczyści całą pamięc podręczną książek."
+STR_CLEAR_CACHE_WARNING_1: "To wyczyści całą pamięć podręczną książek."
-STR_CHECK_SERIAL_OUTPUT: "Szczególy sprawdź na wyjściu szeregowym"
+STR_CHECK_SERIAL_OUTPUT: "Szczegóły sprawdź na wyjściu szeregowym"
-STR_SCAN_QR_WIFI_HINT: "albo skanuj kod QRtelefonem aby połączyć sie do Wifi."
+STR_SCAN_QR_WIFI_HINT: "albo skanuj kod QR telefonem, aby połączyć się do WiFi."
-STR_REMAP_PROMPT: "Przyciśnij przednij przycisk dla każdej funkcji"
+STR_REMAP_PROMPT: "Przyciśnij przedni przycisk dla każdej funkcji"Also applies to: 117-117, 139-139, 148-148, 219-219, 275-275
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/I18n/translations/polish.yaml` at line 15, The STR_START_READING
translation contains Polish typos/incorrect diacritics ("Zacznij czytać
póniźej") — update its value to the correct Polish string (e.g., "Zacznij czytać
poniżej"); then scan the Polish YAML for other user-facing strings flagged in
the review and correct their spelling/diacritics as well, ensuring keys like
STR_START_READING and the other flagged translation keys have natural,
grammatically correct Polish text.
There was a problem hiding this comment.
I think you need to update gen_i18n.py: both Polish and Portuguese are getting the "PO" language code. Can you add "polski": "PL", to the LANG_ABBREVIATIONS map?
Additionally, I think we've been mistaken by maintaining checked-in copies of I18nKeys.h and I18nStrings.h. Those get generated automatically at build time. I believe you can delete those.
znelson
left a comment
There was a problem hiding this comment.
Looks good to me! We can also delete I18nKeys.h and I18nStrings.h in a separate change.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/gen_i18n.py (1)
208-216:⚠️ Potential issue | 🔴 CriticalAdd native Polish language name to LANG_ABBREVIATIONS to prevent symbol mismatch.
The
_language_nameinpolish.yamlis "Polski" (native name), which lowercases to "polski". The current LANG_ABBREVIATIONS dict only has"polish": "PL"but not"polski": "PL". Whenget_lang_abbreviation()is called withlang_name="Polski", it will fail to match and fall back tolang_code[:2].upper(), which produces"PO"from"POLISH". This causes the build to generateSTRINGS_POinstead of the expectedSTRINGS_PL, creating a symbol mismatch sinceSTRINGS_PLis already declared inlib/I18n/I18nStrings.hand referenced inlib/I18n/I18nKeys.h.Add the native name mapping:
Suggested fix
LANG_ABBREVIATIONS = { "english": "EN", "español": "ES", "espanol": "ES", "italiano": "IT", "svenska": "SV", "français": "FR", "francais": "FR", "deutsch": "DE", "german": "DE", - "polish": "PL", + "polish": "PL", "polski": "PL",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/gen_i18n.py` around lines 208 - 216, The LANG_ABBREVIATIONS mapping is missing the Polish native name so get_lang_abbreviation() can miscompute the abbrev; add an entry mapping "polski" to "PL" in the LANG_ABBREVIATIONS dict (alongside the existing "polish": "PL") so lookups of lowercased _language_name produce "PL" instead of falling back to lang_code[:2].upper() and generating "PO".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@scripts/gen_i18n.py`:
- Around line 208-216: The LANG_ABBREVIATIONS mapping is missing the Polish
native name so get_lang_abbreviation() can miscompute the abbrev; add an entry
mapping "polski" to "PL" in the LANG_ABBREVIATIONS dict (alongside the existing
"polish": "PL") so lookups of lowercased _language_name produce "PL" instead of
falling back to lang_code[:2].upper() and generating "PO".
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/gen_i18n.py
📜 Review details
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: whyte-j
Repo: crosspoint-reader/crosspoint-reader PR: 733
File: lib/I18n/I18nKeys.h:271-272
Timestamp: 2026-02-16T22:25:35.674Z
Learning: In the crosspoint-reader i18n system (lib/I18n/), missing translation keys in non-English YAML files are automatically filled with English strings at build time by the gen_i18n.py script. All generated string arrays (STRINGS_EN, STRINGS_ES, etc.) have identical lengths, so runtime array indexing is safe without per-string fallback logic. The system prints "INFO: '{key}' missing in {lang_code}, using English fallback" during code generation when this occurs.
📚 Learning: 2026-02-23T19:55:03.054Z
Learnt from: martinbrook
Repo: crosspoint-reader/crosspoint-reader PR: 1136
File: scripts/patch_jpegdec.py:20-23
Timestamp: 2026-02-23T19:55:03.054Z
Learning: In the crosspoint-reader project, enable Python linters (e.g., Ruff or Flake8) in CI for all Python scripts. Run linting as part of the CI workflow and fix reported issues to maintain code quality. Do not skip linting for any Python files.
Applied to files:
scripts/gen_i18n.py
lib/I18n/translations/polish.yaml
Outdated
| STR_GO_HOME_BUTTON: "Go Home" | ||
| STR_SYNC_PROGRESS: "Sync Progress" | ||
| STR_DELETE_CACHE: "Delete Book Cache" |
There was a problem hiding this comment.
not every string is translated?
with new status bar settings
add missing tranlations
## Summary * **What is the goal of this PR?** Implements Polish language * **What changes are included?** ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**< YES | PARTIALLY | NO >**_ --------- Co-authored-by: Zach Nelson <[email protected]> Co-authored-by: Arthur Tazhitdinov <[email protected]>
## Summary * **What is the goal of this PR?** Implements Polish language * **What changes are included?** ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**< YES | PARTIALLY | NO >**_ --------- Co-authored-by: Zach Nelson <[email protected]> Co-authored-by: Arthur Tazhitdinov <[email protected]>
## Summary * **What is the goal of this PR?** Implements Polish language * **What changes are included?** ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**< YES | PARTIALLY | NO >**_ --------- Co-authored-by: Zach Nelson <[email protected]> Co-authored-by: Arthur Tazhitdinov <[email protected]>
Summary
Additional Context
specific areas to focus on).
AI Usage
While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.
Did you use AI tools to help write this code? < YES | PARTIALLY | NO >