Skip to content

feat: Add Polish Language#1155

Merged
znelson merged 13 commits intocrosspoint-reader:masterfrom
th0m4sek:master
Feb 25, 2026
Merged

feat: Add Polish Language#1155
znelson merged 13 commits intocrosspoint-reader:masterfrom
th0m4sek:master

Conversation

@th0m4sek
Copy link
Contributor

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 >

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Removes 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

Cohort / File(s) Summary
I18n public headers removed
lib/I18n/I18nKeys.h, lib/I18n/I18nStrings.h
Deleted the generated public i18n header declarations: all STRINGS_* extern arrays, Language and StrId enums, LANGUAGE_NAMES, CHARACTER_SETS, and helper functions (e.g., getStringArray, getLanguageCount).
Translation resource added
lib/I18n/translations/polish.yaml
Added Polish localization YAML (+~320 lines) with _language_* metadata and many STR_* keys containing Polish strings.
Generation script
scripts/gen_i18n.py
Added/updated language-abbreviation mapping to include "polish" → "PL".

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • osteotek
  • ngxson
🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description states the goal (implementing Polish language) but lacks substantive detail about what changes are included, leaving it vague and generic. Expand the description to explain the changes made: adding polish.yaml translation file, updating gen_i18n.py with Polish abbreviation mapping, and removing i18n header files that appear to be regenerated.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Add Polish Language' directly and accurately describes the main change—implementing Polish language support as confirmed by the summary of changes.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@znelson znelson changed the title Feat: Add Polish Language feat: Add Polish Language Feb 24, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between d6d0cc8 and 9c646df.

📒 Files selected for processing (3)
  • lib/I18n/I18nKeys.h
  • lib/I18n/I18nStrings.h
  • lib/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.h
  • lib/I18n/translations/polish.yaml
  • lib/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.

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Copy link
Contributor

@znelson znelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
znelson previously approved these changes Feb 24, 2026
Copy link
Contributor

@znelson znelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! We can also delete I18nKeys.h and I18nStrings.h in a separate change.

@znelson znelson requested a review from osteotek February 24, 2026 17:11
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🔴 Critical

Add native Polish language name to LANG_ABBREVIATIONS to prevent symbol mismatch.

The _language_name in polish.yaml is "Polski" (native name), which lowercases to "polski". The current LANG_ABBREVIATIONS dict only has "polish": "PL" but not "polski": "PL". When get_lang_abbreviation() is called with lang_name="Polski", it will fail to match and fall back to lang_code[:2].upper(), which produces "PO" from "POLISH". This causes the build to generate STRINGS_PO instead of the expected STRINGS_PL, creating a symbol mismatch since STRINGS_PL is already declared in lib/I18n/I18nStrings.h and referenced in lib/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

📥 Commits

Reviewing files that changed from the base of the PR and between 25f331b and c62eaba.

📒 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

znelson
znelson previously approved these changes Feb 24, 2026
znelson
znelson previously approved these changes Feb 24, 2026
Comment on lines +285 to +287
STR_GO_HOME_BUTTON: "Go Home"
STR_SYNC_PROGRESS: "Sync Progress"
STR_DELETE_CACHE: "Delete Book Cache"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not every string is translated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

osteotek
osteotek previously approved these changes Feb 25, 2026
@znelson znelson enabled auto-merge (squash) February 25, 2026 17:00
@znelson znelson merged commit cae8517 into crosspoint-reader:master Feb 25, 2026
6 checks passed
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 26, 2026
## 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]>
el pushed a commit to el/crosspoint-reader that referenced this pull request Feb 26, 2026
## 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]>
iandchasse pushed a commit to iandchasse/crosspoint-reader-minRead that referenced this pull request Feb 27, 2026
## 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]>
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.

3 participants