Skip to content

i18n: Replace untranslated strings with empty fallbacks, normalize locales, and clean catalogs - #4793

Merged
BudsieBuds merged 7 commits into
masterfrom
replace-english-translations
Nov 4, 2026
Merged

BudsieBuds merged 7 commits into
masterfrom
replace-english-translations

Conversation

@BudsieBuds

@BudsieBuds BudsieBuds commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Comprehensive localization overhaul across all 46 supported language catalogs. Replaces untranslated English strings with '' to leverage CodeIgniter's native English fallback mechanism, fixes legacy translation errors, normalizes locale naming, enforces strict key parity, adds comprehensive automated test coverage, and documents localization standards in AGENTS.md.

Closes #4783
Closes #4660
Closes #4794
Supersedes #4791
Partially addresses #4476
References #4795
References #4637
References #3891


Linked Issues & Pull Requests

Directly Resolved & Superseded

Partially Addressed & Contextual


Background & Rationale

  1. Empty Fallback Mechanism (Replace English values in non-English language catalogs with empty strings #4783): MY_Language::getLine() falls back to en when a value is ''. Using empty fallbacks ensures the UI always shows current English text while properly signaling unlocalized strings to Weblate translators.
  2. Key Parity & Consistency: Resolves accumulated drift across catalogs, eliminating dead keys, adding missing keys, and enforcing alphabetical sorting.
  3. Locale Normalization ([Feature]: Weblate Translation Fixes #4476): Normalizes Croatian to standard hr, registers ka and sw, and fixes datepicker month handling (mayl).

Important Review Notes

1. Handling of English-Identical Terms & Fallbacks

Where non-English catalogs contained values identical to the English source (such as single-word labels, loanwords, or acronyms):

  • Zero visual/behavioral regression: Because any empty string ('') dynamically falls back to en at runtime via MY_Language::getLine(), the UI continues to render the exact same text.
  • Prevents stale hardcoded copies: When English strings are copied verbatim into non-English catalogs, upstream updates to English strings are never reflected. Empty fallbacks guarantee non-English catalogs always inherit the latest English text.
  • Surfaces keys on Weblate: English copies previously caused Weblate to mark catalogs as "100% translated", hiding unlocalized strings. Setting unlocalized entries to '' unblocks translators so native speakers can review whether a distinct native word fits or if the loanword/acronym is preferred.

2. Datepicker Weekstart Configuration

Datepicker.weekstart is a numeric calendar configuration setting (0 = Sunday, 1 = Monday, 6 = Saturday), not English text. It was audited across all 46 locales and calibrated to match real CLDR / national standards.

3. Calendar Fixes

  • Replaced stray Telugu script mistakenly present in tl/Calendar.php (Tagalog) on master with empty fallback.
  • Populated missing mayl in Norwegian Bokmål (nb: Mai) and Malayalam (ml: മേയ്) to match their existing full-month catalogs.

4. CodeRabbit AI Review Note

CodeRabbit AI skips automated reviews on PRs modifying more than 300 files. To ensure confidence and ease review, this PR includes an automated test suite (tests/LanguageFilesTest.php) executing 4,418 assertions across all files.


Commit Structure

This PR is split into 6 atomic, conventional commits:

  1. fix(i18n): correct spelling and populate missing strings in English catalog

    • Corrects English typos in Cashups.php, Customers.php, Employees.php, and Receivings.php.
    • Populates missing English keys in Employees.php, Expenses.php, and Taxes.php.
  2. fix: correct item kit error key, use mayl in datepickers, and trim Thai string (#4476)

    • Corrects item kit validation message key in item_kits/form.php.
    • Uses Calendar.mayl for full month names in datepickers.
    • Trims redundant ellipsis in th/Bootstrap_tables.php.
  3. feat(i18n): register ka, sw locales and normalize Croatian to hr (#4476)

    • Registers ka, sw-KE, and sw-TZ in App.php and locale_helper.php.
    • Normalizes Croatian from hr-HR to standard hr.
  4. refactor(i18n): replace untranslated English strings with empty fallback (#4783, #4660)

  5. test(i18n): add comprehensive language file test coverage

    • Adds tests/LanguageFilesTest.php with 4,418 automated test assertions verifying syntax, exact key parity against English, alphabetical sorting, duplicate rejection, and locale registration.
  6. docs(agents): update AGENTS.md with localization guidelines and best practices

    • Documents i18n rules, conventions, and CI4 fallback guidelines in AGENTS.md.

Verification & Testing

  • Automated Tests: Ran vendor/bin/phpunit --no-coverage tests/LanguageFilesTest.php:
    OK (4418 tests, 5498 assertions)
    
  • Code Style: Validated with PHP-CS-Fixer (.php-cs-fixer.no-header.php).
  • Clean Diff: Zero non-catalog runtime side effects; views and configs tested for compatibility.

@BudsieBuds

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review skipped: 753 files exceed the limit of 300.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 809 files, which is 509 over the limit of 300.

To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch.

Usage-priced reviews support at most 300 files.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 92743866-2f96-41b0-bf32-9e5769ffd434
Commits

Reviewing files that changed from the base of the PR and between 72a7515 and 91d2457.

Files selected for processing: 809
  • AGENTS.md
  • app/Config/App.php
  • app/Helpers/locale_helper.php
  • app/Language/ar-EG/Attributes.php
  • app/Language/ar-EG/Common.php
  • app/Language/ar-EG/Config.php
  • app/Language/ar-EG/Customers.php
  • app/Language/ar-EG/Datepicker.php
  • app/Language/ar-EG/Employees.php
  • app/Language/ar-EG/Error.php
  • app/Language/ar-EG/Expenses_categories.php
  • app/Language/ar-EG/Item_kits.php
  • app/Language/ar-EG/Items.php
  • app/Language/ar-EG/Messages.php
  • app/Language/ar-EG/Receivings.php
  • app/Language/ar-EG/Sales.php
  • app/Language/ar-EG/Taxes.php
  • app/Language/ar-LB/Attributes.php
  • app/Language/ar-LB/Common.php
  • app/Language/ar-LB/Config.php
  • app/Language/ar-LB/Customers.php
  • app/Language/ar-LB/Datepicker.php
  • app/Language/ar-LB/Employees.php
  • app/Language/ar-LB/Error.php
  • app/Language/ar-LB/Expenses_categories.php
  • app/Language/ar-LB/Item_kits.php
  • app/Language/ar-LB/Items.php
  • app/Language/ar-LB/Messages.php
  • app/Language/ar-LB/Receivings.php
  • app/Language/ar-LB/Sales.php
  • app/Language/ar-LB/Taxes.php
  • app/Language/az/Attributes.php
  • app/Language/az/Cashups.php
  • app/Language/az/Common.php
  • app/Language/az/Config.php
  • app/Language/az/Customers.php
  • app/Language/az/Datepicker.php
  • app/Language/az/Employees.php
  • app/Language/az/Expenses.php
  • app/Language/az/Item_kits.php
  • app/Language/az/Items.php
  • app/Language/az/Login.php
  • app/Language/az/Messages.php
  • app/Language/az/Receivings.php
  • app/Language/az/Reports.php
  • app/Language/az/Sales.php
  • app/Language/az/Taxes.php
  • app/Language/bg/Attributes.php
  • app/Language/bg/Common.php
  • app/Language/bg/Config.php
  • app/Language/bg/Customers.php
  • app/Language/bg/Datepicker.php
  • app/Language/bg/Employees.php
  • app/Language/bg/Enum.php
  • app/Language/bg/Error.php
  • app/Language/bg/Expenses.php
  • app/Language/bg/Expenses_categories.php
  • app/Language/bg/Giftcards.php
  • app/Language/bg/Item_kits.php
  • app/Language/bg/Items.php
  • app/Language/bg/Login.php
  • app/Language/bg/Messages.php
  • app/Language/bg/Module.php
  • app/Language/bg/Receivings.php
  • app/Language/bg/Reports.php
  • app/Language/bg/Sales.php
  • app/Language/bg/Suppliers.php
  • app/Language/bg/Taxes.php
  • app/Language/bs/Attributes.php
  • app/Language/bs/Cashups.php
  • app/Language/bs/Common.php
  • app/Language/bs/Config.php
  • app/Language/bs/Customers.php
  • app/Language/bs/Employees.php
  • app/Language/bs/Error.php
  • app/Language/bs/Expenses.php
  • app/Language/bs/Expenses_categories.php
  • app/Language/bs/Item_kits.php
  • app/Language/bs/Items.php
  • app/Language/bs/Messages.php
  • app/Language/bs/Receivings.php
  • app/Language/bs/Reports.php
  • app/Language/bs/Sales.php
  • app/Language/bs/Taxes.php
  • app/Language/ckb/Attributes.php
  • app/Language/ckb/Common.php
  • app/Language/ckb/Config.php
  • app/Language/ckb/Customers.php
  • app/Language/ckb/Datepicker.php
  • app/Language/ckb/Employees.php
  • app/Language/ckb/Error.php
  • app/Language/ckb/Expenses_categories.php
  • app/Language/ckb/Item_kits.php
  • app/Language/ckb/Items.php
  • app/Language/ckb/Messages.php
  • app/Language/ckb/Receivings.php
  • app/Language/ckb/Sales.php
  • app/Language/ckb/Taxes.php
  • app/Language/cs/Attributes.php
  • app/Language/cs/Common.php
  • app/Language/cs/Config.php
  • app/Language/cs/Customers.php
  • app/Language/cs/Datepicker.php
  • app/Language/cs/Employees.php
  • app/Language/cs/Error.php
  • app/Language/cs/Expenses_categories.php
  • app/Language/cs/Item_kits.php
  • app/Language/cs/Items.php
  • app/Language/cs/Login.php
  • app/Language/cs/Messages.php
  • app/Language/cs/Receivings.php
  • app/Language/cs/Reports.php
  • app/Language/cs/Sales.php
  • app/Language/cs/Taxes.php
  • app/Language/da/Attributes.php
  • app/Language/da/Cashups.php
  • app/Language/da/Common.php
  • app/Language/da/Config.php
  • app/Language/da/Customers.php
  • app/Language/da/Datepicker.php
  • app/Language/da/Employees.php
  • app/Language/da/Enum.php
  • app/Language/da/Error.php
  • app/Language/da/Expenses.php
  • app/Language/da/Expenses_categories.php
  • app/Language/da/Giftcards.php
  • app/Language/da/Item_kits.php
  • app/Language/da/Items.php
  • app/Language/da/Login.php
  • app/Language/da/Receivings.php
  • app/Language/da/Reports.php
  • app/Language/da/Sales.php
  • app/Language/da/Taxes.php
  • app/Language/de-CH/Attributes.php
  • app/Language/de-CH/Bootstrap_tables.php
  • app/Language/de-CH/Common.php
  • app/Language/de-CH/Config.php
  • app/Language/de-CH/Customers.php
  • app/Language/de-CH/Datepicker.php
  • app/Language/de-CH/Employees.php
  • app/Language/de-CH/Error.php
  • app/Language/de-CH/Expenses_categories.php
  • app/Language/de-CH/Giftcards.php
  • app/Language/de-CH/Item_kits.php
  • app/Language/de-CH/Items.php
  • app/Language/de-CH/Login.php
  • app/Language/de-CH/Messages.php
  • app/Language/de-CH/Module.php
  • app/Language/de-CH/Receivings.php
  • app/Language/de-CH/Reports.php
  • app/Language/de-CH/Sales.php
  • app/Language/de-CH/Taxes.php
  • app/Language/de-DE/Attributes.php
  • app/Language/de-DE/Common.php
  • app/Language/de-DE/Config.php
  • app/Language/de-DE/Customers.php
  • app/Language/de-DE/Employees.php
  • app/Language/de-DE/Error.php
  • app/Language/de-DE/Expenses.php
  • app/Language/de-DE/Expenses_categories.php
  • app/Language/de-DE/Giftcards.php
  • app/Language/de-DE/Item_kits.php
  • app/Language/de-DE/Items.php
  • app/Language/de-DE/Login.php
  • app/Language/de-DE/Messages.php
  • app/Language/de-DE/Module.php
  • app/Language/de-DE/Receivings.php
  • app/Language/de-DE/Reports.php
  • app/Language/de-DE/Sales.php
  • app/Language/de-DE/Taxes.php
  • app/Language/el/Attributes.php
  • app/Language/el/Common.php
  • app/Language/el/Config.php
  • app/Language/el/Customers.php
  • app/Language/el/Datepicker.php
  • app/Language/el/Employees.php
  • app/Language/el/Error.php
  • app/Language/el/Expenses_categories.php
  • app/Language/el/Item_kits.php
  • app/Language/el/Items.php
  • app/Language/el/Login.php
  • app/Language/el/Receivings.php
  • app/Language/el/Sales.php
  • app/Language/el/Suppliers.php
  • app/Language/el/Taxes.php
  • app/Language/en-GB/Attributes.php
  • app/Language/en-GB/Bootstrap_tables.php
  • app/Language/en-GB/Calendar.php
  • app/Language/en-GB/Cashups.php
  • app/Language/en-GB/Common.php
  • app/Language/en-GB/Config.php
  • app/Language/en-GB/Customers.php
  • app/Language/en-GB/Datepicker.php
  • app/Language/en-GB/Employees.php
  • app/Language/en-GB/Enum.php
  • app/Language/en-GB/Error.php
  • app/Language/en-GB/Expenses.php
  • app/Language/en-GB/Expenses_categories.php
  • app/Language/en-GB/Giftcards.php
  • app/Language/en-GB/Item_kits.php
  • app/Language/en-GB/Items.php
  • app/Language/en-GB/Login.php
  • app/Language/en-GB/Messages.php
  • app/Language/en-GB/Module.php
  • app/Language/en-GB/Receivings.php
  • app/Language/en-GB/Reports.php
  • app/Language/en-GB/Sales.php
  • app/Language/en-GB/Suppliers.php
  • app/Language/en-GB/Taxes.php
  • app/Language/en/Cashups.php
  • app/Language/en/Common.php
  • app/Language/en/Config.php
  • app/Language/en/Customers.php
  • app/Language/en/Employees.php
  • app/Language/en/Error.php
  • app/Language/en/Expenses.php
  • app/Language/en/Expenses_categories.php
  • app/Language/en/Item_kits.php
  • app/Language/en/Items.php
  • app/Language/en/Messages.php
  • app/Language/en/Receivings.php
  • app/Language/en/Sales.php
  • app/Language/en/Taxes.php
  • app/Language/es-ES/Attributes.php
  • app/Language/es-ES/Cashups.php
  • app/Language/es-ES/Common.php
  • app/Language/es-ES/Config.php
  • app/Language/es-ES/Customers.php
  • app/Language/es-ES/Datepicker.php
  • app/Language/es-ES/Employees.php
  • app/Language/es-ES/Error.php
  • app/Language/es-ES/Expenses.php
  • app/Language/es-ES/Expenses_categories.php
  • app/Language/es-ES/Item_kits.php
  • app/Language/es-ES/Items.php
  • app/Language/es-ES/Login.php
  • app/Language/es-ES/Messages.php
  • app/Language/es-ES/Receivings.php
  • app/Language/es-ES/Reports.php
  • app/Language/es-ES/Sales.php
  • app/Language/es-ES/Suppliers.php
  • app/Language/es-ES/Taxes.php
  • app/Language/es-MX/Attributes.php
  • app/Language/es-MX/Cashups.php
  • app/Language/es-MX/Common.php
  • app/Language/es-MX/Config.php
  • app/Language/es-MX/Customers.php
  • app/Language/es-MX/Employees.php
  • app/Language/es-MX/Error.php
  • app/Language/es-MX/Expenses_categories.php
  • app/Language/es-MX/Giftcards.php
  • app/Language/es-MX/Item_kits.php
  • app/Language/es-MX/Items.php
  • app/Language/es-MX/Login.php
  • app/Language/es-MX/Messages.php
  • app/Language/es-MX/Receivings.php
  • app/Language/es-MX/Reports.php
  • app/Language/es-MX/Sales.php
  • app/Language/es-MX/Suppliers.php
  • app/Language/es-MX/Taxes.php
  • app/Language/fa/Attributes.php
  • app/Language/fa/Bootstrap_tables.php
  • app/Language/fa/Common.php
  • app/Language/fa/Config.php
  • app/Language/fa/Customers.php
  • app/Language/fa/Datepicker.php
  • app/Language/fa/Employees.php
  • app/Language/fa/Error.php
  • app/Language/fa/Expenses_categories.php
  • app/Language/fa/Giftcards.php
  • app/Language/fa/Item_kits.php
  • app/Language/fa/Items.php
  • app/Language/fa/Login.php
  • app/Language/fa/Module.php
  • app/Language/fa/Receivings.php
  • app/Language/fa/Reports.php
  • app/Language/fa/Sales.php
  • app/Language/fa/Taxes.php
  • app/Language/fr/Attributes.php
  • app/Language/fr/Cashups.php
  • app/Language/fr/Common.php
  • app/Language/fr/Config.php
  • app/Language/fr/Customers.php
  • app/Language/fr/Datepicker.php
  • app/Language/fr/Employees.php
  • app/Language/fr/Error.php
  • app/Language/fr/Expenses.php
  • app/Language/fr/Expenses_categories.php
  • app/Language/fr/Giftcards.php
  • app/Language/fr/Item_kits.php
  • app/Language/fr/Items.php
  • app/Language/fr/Login.php
  • app/Language/fr/Messages.php
  • app/Language/fr/Module.php
  • app/Language/fr/Receivings.php
  • app/Language/fr/Reports.php
  • app/Language/fr/Sales.php
  • app/Language/fr/Suppliers.php
  • app/Language/fr/Taxes.php
  • app/Language/he/Attributes.php
  • app/Language/he/Common.php
  • app/Language/he/Config.php
  • app/Language/he/Customers.php
  • app/Language/he/Employees.php
  • app/Language/he/Error.php
  • app/Language/he/Expenses_categories.php
  • app/Language/he/Item_kits.php
  • app/Language/he/Items.php
  • app/Language/he/Login.php
  • app/Language/he/Messages.php
  • app/Language/he/Module.php
  • app/Language/he/Receivings.php
  • app/Language/he/Sales.php
  • app/Language/he/Taxes.php
  • app/Language/hr-HR/Messages.php
  • app/Language/hr/Attributes.php
  • app/Language/hr/Bootstrap_tables.php
  • app/Language/hr/Calendar.php
  • app/Language/hr/Cashups.php
  • app/Language/hr/Common.php
  • app/Language/hr/Config.php
  • app/Language/hr/Customers.php
  • app/Language/hr/Datepicker.php
  • app/Language/hr/Employees.php
  • app/Language/hr/Enum.php
  • app/Language/hr/Error.php
  • app/Language/hr/Expenses.php
  • app/Language/hr/Expenses_categories.php
  • app/Language/hr/Giftcards.php
  • app/Language/hr/Item_kits.php
  • app/Language/hr/Items.php
  • app/Language/hr/Login.php
  • app/Language/hr/Messages.php
  • app/Language/hr/Module.php
  • app/Language/hr/Receivings.php
  • app/Language/hr/Reports.php
  • app/Language/hr/Sales.php
  • app/Language/hr/Suppliers.php
  • app/Language/hr/Taxes.php
  • app/Language/hr/index.html
  • app/Language/hu/Attributes.php
  • app/Language/hu/Common.php
  • app/Language/hu/Config.php
  • app/Language/hu/Customers.php
  • app/Language/hu/Employees.php
  • app/Language/hu/Error.php
  • app/Language/hu/Expenses_categories.php
  • app/Language/hu/Giftcards.php
  • app/Language/hu/Item_kits.php
  • app/Language/hu/Items.php
  • app/Language/hu/Login.php
  • app/Language/hu/Messages.php
  • app/Language/hu/Module.php
  • app/Language/hu/Receivings.php
  • app/Language/hu/Reports.php
  • app/Language/hu/Sales.php
  • app/Language/hu/Taxes.php
  • app/Language/hy/Attributes.php
  • app/Language/hy/Common.php
  • app/Language/hy/Config.php
  • app/Language/hy/Customers.php
  • app/Language/hy/Datepicker.php
  • app/Language/hy/Employees.php
  • app/Language/hy/Error.php
  • app/Language/hy/Expenses_categories.php
  • app/Language/hy/Item_kits.php
  • app/Language/hy/Items.php
  • app/Language/hy/Receivings.php
  • app/Language/hy/Sales.php
  • app/Language/hy/Taxes.php
  • app/Language/id/Attributes.php
  • app/Language/id/Cashups.php
  • app/Language/id/Common.php
  • app/Language/id/Config.php
  • app/Language/id/Customers.php
  • app/Language/id/Employees.php
  • app/Language/id/Error.php
  • app/Language/id/Expenses_categories.php
  • app/Language/id/Item_kits.php
  • app/Language/id/Items.php
  • app/Language/id/Messages.php
  • app/Language/id/Receivings.php
  • app/Language/id/Reports.php
  • app/Language/id/Sales.php
  • app/Language/id/Taxes.php
  • app/Language/it/Attributes.php
  • app/Language/it/Cashups.php
  • app/Language/it/Common.php
  • app/Language/it/Config.php
  • app/Language/it/Customers.php
  • app/Language/it/Datepicker.php
  • app/Language/it/Employees.php
  • app/Language/it/Enum.php
  • app/Language/it/Error.php
  • app/Language/it/Expenses.php
  • app/Language/it/Expenses_categories.php
  • app/Language/it/Item_kits.php
  • app/Language/it/Items.php
  • app/Language/it/Login.php
  • app/Language/it/Messages.php
  • app/Language/it/Module.php
  • app/Language/it/Receivings.php
  • app/Language/it/Reports.php
  • app/Language/it/Sales.php
  • app/Language/it/Suppliers.php
  • app/Language/it/Taxes.php
  • app/Language/ka/Attributes.php
  • app/Language/ka/Common.php
  • app/Language/ka/Config.php
  • app/Language/ka/Customers.php
  • app/Language/ka/Datepicker.php
  • app/Language/ka/Employees.php
  • app/Language/ka/Error.php
  • app/Language/ka/Expenses_categories.php
  • app/Language/ka/Item_kits.php
  • app/Language/ka/Items.php
  • app/Language/ka/Receivings.php
  • app/Language/ka/Sales.php
  • app/Language/ka/Taxes.php
  • app/Language/km/Attributes.php
  • app/Language/km/Bootstrap_tables.php
  • app/Language/km/Cashups.php
  • app/Language/km/Common.php
  • app/Language/km/Config.php
  • app/Language/km/Customers.php
  • app/Language/km/Datepicker.php
  • app/Language/km/Employees.php
  • app/Language/km/Error.php
  • app/Language/km/Expenses.php
  • app/Language/km/Expenses_categories.php
  • app/Language/km/Giftcards.php
  • app/Language/km/Item_kits.php
  • app/Language/km/Items.php
  • app/Language/km/Login.php
  • app/Language/km/Messages.php
  • app/Language/km/Module.php
  • app/Language/km/Receivings.php
  • app/Language/km/Reports.php
  • app/Language/km/Sales.php
  • app/Language/km/Suppliers.php
  • app/Language/km/Taxes.php
  • app/Language/lo/Attributes.php
  • app/Language/lo/Bootstrap_tables.php
  • app/Language/lo/Common.php
  • app/Language/lo/Config.php
  • app/Language/lo/Customers.php
  • app/Language/lo/Employees.php
  • app/Language/lo/Enum.php
  • app/Language/lo/Error.php
  • app/Language/lo/Expenses.php
  • app/Language/lo/Expenses_categories.php
  • app/Language/lo/Giftcards.php
  • app/Language/lo/Item_kits.php
  • app/Language/lo/Items.php
  • app/Language/lo/Login.php
  • app/Language/lo/Messages.php
  • app/Language/lo/Module.php
  • app/Language/lo/Receivings.php
  • app/Language/lo/Reports.php
  • app/Language/lo/Sales.php
  • app/Language/lo/Suppliers.php
  • app/Language/lo/Taxes.php
  • app/Language/ml/Attributes.php
  • app/Language/ml/Calendar.php
  • app/Language/ml/Common.php
  • app/Language/ml/Config.php
  • app/Language/ml/Customers.php
  • app/Language/ml/Datepicker.php
  • app/Language/ml/Employees.php
  • app/Language/ml/Error.php
  • app/Language/ml/Expenses_categories.php
  • app/Language/ml/Item_kits.php
  • app/Language/ml/Items.php
  • app/Language/ml/Receivings.php
  • app/Language/ml/Sales.php
  • app/Language/ml/Taxes.php
  • app/Language/nb/Attributes.php
  • app/Language/nb/Calendar.php
  • app/Language/nb/Common.php
  • app/Language/nb/Config.php
  • app/Language/nb/Customers.php
  • app/Language/nb/Datepicker.php
  • app/Language/nb/Employees.php
  • app/Language/nb/Error.php
  • app/Language/nb/Expenses_categories.php
  • app/Language/nb/Item_kits.php
  • app/Language/nb/Items.php
  • app/Language/nb/Receivings.php
  • app/Language/nb/Sales.php
  • app/Language/nb/Taxes.php
  • app/Language/nl-BE/Attributes.php
  • app/Language/nl-BE/Cashups.php
  • app/Language/nl-BE/Common.php
  • app/Language/nl-BE/Config.php
  • app/Language/nl-BE/Customers.php
  • app/Language/nl-BE/Datepicker.php
  • app/Language/nl-BE/Employees.php
  • app/Language/nl-BE/Enum.php
  • app/Language/nl-BE/Error.php
  • app/Language/nl-BE/Expenses.php
  • app/Language/nl-BE/Expenses_categories.php
  • app/Language/nl-BE/Item_kits.php
  • app/Language/nl-BE/Items.php
  • app/Language/nl-BE/Login.php
  • app/Language/nl-BE/Messages.php
  • app/Language/nl-BE/Module.php
  • app/Language/nl-BE/Receivings.php
  • app/Language/nl-BE/Reports.php
  • app/Language/nl-BE/Sales.php
  • app/Language/nl-BE/Suppliers.php
  • app/Language/nl-BE/Taxes.php
  • app/Language/nl-NL/Attributes.php
  • app/Language/nl-NL/Common.php
  • app/Language/nl-NL/Config.php
  • app/Language/nl-NL/Customers.php
  • app/Language/nl-NL/Datepicker.php
  • app/Language/nl-NL/Employees.php
  • app/Language/nl-NL/Error.php
  • app/Language/nl-NL/Expenses_categories.php
  • app/Language/nl-NL/Item_kits.php
  • app/Language/nl-NL/Items.php
  • app/Language/nl-NL/Messages.php
  • app/Language/nl-NL/Module.php
  • app/Language/nl-NL/Receivings.php
  • app/Language/nl-NL/Reports.php
  • app/Language/nl-NL/Sales.php
  • app/Language/nl-NL/Suppliers.php
  • app/Language/nl-NL/Taxes.php
  • app/Language/pl/Attributes.php
  • app/Language/pl/Common.php
  • app/Language/pl/Config.php
  • app/Language/pl/Customers.php
  • app/Language/pl/Datepicker.php
  • app/Language/pl/Employees.php
  • app/Language/pl/Error.php
  • app/Language/pl/Expenses_categories.php
  • app/Language/pl/Item_kits.php
  • app/Language/pl/Items.php
  • app/Language/pl/Messages.php
  • app/Language/pl/Receivings.php
  • app/Language/pl/Sales.php
  • app/Language/pl/Taxes.php
  • app/Language/pt-BR/Attributes.php
  • app/Language/pt-BR/Cashups.php
  • app/Language/pt-BR/Common.php
  • app/Language/pt-BR/Config.php
  • app/Language/pt-BR/Customers.php
  • app/Language/pt-BR/Employees.php
  • app/Language/pt-BR/Error.php
  • app/Language/pt-BR/Expenses.php
  • app/Language/pt-BR/Expenses_categories.php
  • app/Language/pt-BR/Item_kits.php
  • app/Language/pt-BR/Items.php
  • app/Language/pt-BR/Messages.php
  • app/Language/pt-BR/Module.php
  • app/Language/pt-BR/Receivings.php
  • app/Language/pt-BR/Reports.php
  • app/Language/pt-BR/Sales.php
  • app/Language/pt-BR/Suppliers.php
  • app/Language/pt-BR/Taxes.php
  • app/Language/ro/Attributes.php
  • app/Language/ro/Cashups.php
  • app/Language/ro/Common.php
  • app/Language/ro/Config.php
  • app/Language/ro/Customers.php
  • app/Language/ro/Datepicker.php
  • app/Language/ro/Employees.php
  • app/Language/ro/Error.php
  • app/Language/ro/Expenses_categories.php
  • app/Language/ro/Item_kits.php
  • app/Language/ro/Items.php
  • app/Language/ro/Login.php
  • app/Language/ro/Receivings.php
  • app/Language/ro/Sales.php
  • app/Language/ro/Taxes.php
  • app/Language/ru/Cashups.php
  • app/Language/ru/Common.php
  • app/Language/ru/Config.php
  • app/Language/ru/Customers.php
  • app/Language/ru/Datepicker.php
  • app/Language/ru/Employees.php
  • app/Language/ru/Error.php
  • app/Language/ru/Expenses.php
  • app/Language/ru/Item_kits.php
  • app/Language/ru/Login.php
  • app/Language/ru/Messages.php
  • app/Language/ru/Receivings.php
  • app/Language/ru/Sales.php
  • app/Language/ru/Taxes.php
  • app/Language/sv/Attributes.php
  • app/Language/sv/Cashups.php
  • app/Language/sv/Common.php
  • app/Language/sv/Config.php
  • app/Language/sv/Customers.php
  • app/Language/sv/Datepicker.php
  • app/Language/sv/Employees.php
  • app/Language/sv/Error.php
  • app/Language/sv/Expenses.php
  • app/Language/sv/Expenses_categories.php
  • app/Language/sv/Giftcards.php
  • app/Language/sv/Item_kits.php
  • app/Language/sv/Items.php
  • app/Language/sv/Login.php
  • app/Language/sv/Messages.php
  • app/Language/sv/Receivings.php
  • app/Language/sv/Reports.php
  • app/Language/sv/Sales.php
  • app/Language/sv/Suppliers.php
  • app/Language/sv/Taxes.php
  • app/Language/sw-KE/Attributes.php
  • app/Language/sw-KE/Cashups.php
  • app/Language/sw-KE/Common.php
  • app/Language/sw-KE/Config.php
  • app/Language/sw-KE/Customers.php
  • app/Language/sw-KE/Employees.php
  • app/Language/sw-KE/Error.php
  • app/Language/sw-KE/Expenses.php
  • app/Language/sw-KE/Expenses_categories.php
  • app/Language/sw-KE/Item_kits.php
  • app/Language/sw-KE/Items.php
  • app/Language/sw-KE/Messages.php
  • app/Language/sw-KE/Receivings.php
  • app/Language/sw-KE/Reports.php
  • app/Language/sw-KE/Sales.php
  • app/Language/sw-KE/Suppliers.php
  • app/Language/sw-KE/Taxes.php
  • app/Language/sw-TZ/Attributes.php
  • app/Language/sw-TZ/Cashups.php
  • app/Language/sw-TZ/Common.php
  • app/Language/sw-TZ/Config.php
  • app/Language/sw-TZ/Customers.php
  • app/Language/sw-TZ/Datepicker.php
  • app/Language/sw-TZ/Employees.php
  • app/Language/sw-TZ/Error.php
  • app/Language/sw-TZ/Expenses.php
  • app/Language/sw-TZ/Expenses_categories.php
  • app/Language/sw-TZ/Item_kits.php
  • app/Language/sw-TZ/Items.php
  • app/Language/sw-TZ/Messages.php
  • app/Language/sw-TZ/Receivings.php
  • app/Language/sw-TZ/Reports.php
  • app/Language/sw-TZ/Sales.php
  • app/Language/sw-TZ/Suppliers.php
  • app/Language/sw-TZ/Taxes.php
  • app/Language/ta/Attributes.php
  • app/Language/ta/Cashups.php
  • app/Language/ta/Common.php
  • app/Language/ta/Config.php
  • app/Language/ta/Customers.php
  • app/Language/ta/Employees.php
  • app/Language/ta/Error.php
  • app/Language/ta/Expenses_categories.php
  • app/Language/ta/Giftcards.php
  • app/Language/ta/Item_kits.php
  • app/Language/ta/Items.php
  • app/Language/ta/Messages.php
  • app/Language/ta/Module.php
  • app/Language/ta/Receivings.php
  • app/Language/ta/Reports.php
  • app/Language/ta/Sales.php
  • app/Language/ta/Suppliers.php
  • app/Language/ta/Taxes.php
  • app/Language/th/Attributes.php
  • app/Language/th/Bootstrap_tables.php
  • app/Language/th/Common.php
  • app/Language/th/Config.php
  • app/Language/th/Customers.php
  • app/Language/th/Employees.php
  • app/Language/th/Error.php
  • app/Language/th/Expenses_categories.php
  • app/Language/th/Giftcards.php
  • app/Language/th/Item_kits.php
  • app/Language/th/Items.php
  • app/Language/th/Login.php
  • app/Language/th/Messages.php
  • app/Language/th/Module.php
  • app/Language/th/Receivings.php
  • app/Language/th/Reports.php
  • app/Language/th/Sales.php
  • app/Language/th/Suppliers.php
  • app/Language/th/Taxes.php
  • app/Language/tl/Attributes.php
  • app/Language/tl/Bootstrap_tables.php
  • app/Language/tl/Calendar.php
  • app/Language/tl/Cashups.php
  • app/Language/tl/Common.php
  • app/Language/tl/Config.php
  • app/Language/tl/Customers.php
  • app/Language/tl/Datepicker.php
  • app/Language/tl/Employees.php
  • app/Language/tl/Enum.php
  • app/Language/tl/Error.php
  • app/Language/tl/Expenses.php
  • app/Language/tl/Expenses_categories.php
  • app/Language/tl/Giftcards.php
  • app/Language/tl/Item_kits.php
  • app/Language/tl/Items.php
  • app/Language/tl/Login.php
  • app/Language/tl/Messages.php
  • app/Language/tl/Module.php
  • app/Language/tl/Receivings.php
  • app/Language/tl/Reports.php
  • app/Language/tl/Sales.php
  • app/Language/tl/Suppliers.php
  • app/Language/tl/Taxes.php
  • app/Language/tr/Attributes.php
  • app/Language/tr/Cashups.php
  • app/Language/tr/Common.php
  • app/Language/tr/Config.php
  • app/Language/tr/Customers.php
  • app/Language/tr/Datepicker.php
  • app/Language/tr/Employees.php
  • app/Language/tr/Error.php
  • app/Language/tr/Expenses_categories.php
  • app/Language/tr/Item_kits.php
  • app/Language/tr/Items.php
  • app/Language/tr/Messages.php
  • app/Language/tr/Module.php
  • app/Language/tr/Receivings.php
  • app/Language/tr/Reports.php
  • app/Language/tr/Sales.php
  • app/Language/tr/Taxes.php
  • app/Language/uk/Attributes.php
  • app/Language/uk/Common.php
  • app/Language/uk/Config.php
  • app/Language/uk/Customers.php
  • app/Language/uk/Datepicker.php
  • app/Language/uk/Employees.php
  • app/Language/uk/Error.php
  • app/Language/uk/Expenses_categories.php
  • app/Language/uk/Item_kits.php
  • app/Language/uk/Items.php
  • app/Language/uk/Login.php
  • app/Language/uk/Messages.php
  • app/Language/uk/Receivings.php
  • app/Language/uk/Sales.php
  • app/Language/uk/Taxes.php
  • app/Language/ur/Attributes.php
  • app/Language/ur/Common.php
  • app/Language/ur/Config.php
  • app/Language/ur/Customers.php
  • app/Language/ur/Datepicker.php
  • app/Language/ur/Employees.php
  • app/Language/ur/Error.php
  • app/Language/ur/Expenses_categories.php
  • app/Language/ur/Item_kits.php
  • app/Language/ur/Items.php
  • app/Language/ur/Receivings.php
  • app/Language/ur/Sales.php
  • app/Language/ur/Taxes.php
  • app/Language/vi/Attributes.php
  • app/Language/vi/Common.php
  • app/Language/vi/Config.php
  • app/Language/vi/Customers.php
  • app/Language/vi/Datepicker.php
  • app/Language/vi/Employees.php
  • app/Language/vi/Error.php
  • app/Language/vi/Expenses_categories.php
  • app/Language/vi/Item_kits.php
  • app/Language/vi/Items.php
  • app/Language/vi/Messages.php
  • app/Language/vi/Receivings.php
  • app/Language/vi/Reports.php
  • app/Language/vi/Sales.php
  • app/Language/vi/Taxes.php
  • app/Language/zh-Hans/Attributes.php
  • app/Language/zh-Hans/Common.php
  • app/Language/zh-Hans/Config.php
  • app/Language/zh-Hans/Customers.php
  • app/Language/zh-Hans/Datepicker.php
  • app/Language/zh-Hans/Employees.php
  • app/Language/zh-Hans/Error.php
  • app/Language/zh-Hans/Expenses.php
  • app/Language/zh-Hans/Expenses_categories.php
  • app/Language/zh-Hans/Giftcards.php
  • app/Language/zh-Hans/Item_kits.php
  • app/Language/zh-Hans/Items.php
  • app/Language/zh-Hans/Login.php
  • app/Language/zh-Hans/Messages.php
  • app/Language/zh-Hans/Module.php
  • app/Language/zh-Hans/Receivings.php
  • app/Language/zh-Hans/Reports.php
  • app/Language/zh-Hans/Sales.php
  • app/Language/zh-Hans/Suppliers.php
  • app/Language/zh-Hans/Taxes.php
  • app/Language/zh-Hant/Attributes.php
  • app/Language/zh-Hant/Common.php
  • app/Language/zh-Hant/Config.php
  • app/Language/zh-Hant/Customers.php
  • app/Language/zh-Hant/Datepicker.php
  • app/Language/zh-Hant/Employees.php
  • app/Language/zh-Hant/Error.php
  • app/Language/zh-Hant/Expenses.php
  • app/Language/zh-Hant/Expenses_categories.php
  • app/Language/zh-Hant/Giftcards.php
  • app/Language/zh-Hant/Item_kits.php
  • app/Language/zh-Hant/Items.php
  • app/Language/zh-Hant/Messages.php
  • app/Language/zh-Hant/Receivings.php
  • app/Language/zh-Hant/Reports.php
  • app/Language/zh-Hant/Sales.php
  • app/Language/zh-Hant/Suppliers.php
  • app/Language/zh-Hant/Taxes.php
  • app/Views/item_kits/form.php
  • app/Views/login.php
  • app/Views/partial/datepicker_locale.php
  • app/Views/partial/daterangepicker.php
  • app/Views/partial/footer.php
  • tests/LanguageFilesTest.php

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@BudsieBuds

Copy link
Copy Markdown
Member Author

@coderabbitai can you review 793eb3c, 4569658, 51856cc, and 944ce2d? Skipping a468db7 which has the most files.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
git status --short
fd -H '^AGENTS\.md$' -E .git
if [ -f AGENTS.md ]; then cat AGENTS.md; fi
for commit in 793eb3c 4569658 51856cc 944ce2d; do
  git show --format=fuller --stat "$commit"
done

Length of output: 13475


🏁 Script executed:

#!/bin/bash
set -euo pipefail
for commit in 793eb3c 4569658 51856cc 944ce2d; do
 git show --format=short --find-renames "$commit"
done
ast-grep outline app/Helpers/locale_helper.php --items all
ast-grep outline tests/LanguageFilesTest.php --items all
rg -n -C3 'hr-HR|supportedLocales|current_language|currentLanguage' app tests --glob '*.php' --glob '!app/Language/**'

Length of output: 31133


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '1,110p' app/Helpers/locale_helper.php
sed -n '1,150p' tests/LanguageFilesTest.php
ast-grep outline app/Events/Load_config.php --items all
sed -n '1,180p' app/Events/Load_config.php
rg -n -C3 'hr-HR|croatian|language_code|setLocale\(' app/Database app/Controllers app/Models composer.json
rg -n -C2 "'mayl?'|'item_kit_number_duplicate'|'unauthorized_modify'|'jurisdiction_id'" app/Language/en app/Language/hr
python - <<'PY'
import pathlib,re
root=pathlib.Path('app/Language')
pattern=re.compile(r"^\s*'([^']+)'\s*=>",re.M)
english={p.name:pattern.findall(p.read_text()) for p in (root/'en').glob('*.php')}
issues=[]
for p in sorted(root.glob('*/*.php')):
 keys=pattern.findall(p.read_text())
 if p.name not in english:
  issues.append((str(p),'no English file'))
  continue
 extra=set(keys)-set(english[p.name])
 missing=set(english[p.name])-set(keys)
 if extra: issues.append((str(p),'extra',sorted(extra)))
 if missing and p.parent.name!='en-GB': issues.append((str(p),'missing',sorted(missing)))
 if p.name!='Calendar.php' and keys!=sorted(keys): issues.append((str(p),'unsorted'))
 if len(keys)!=len(set(keys)): issues.append((str(p),'duplicates'))
print('Static catalog check:',len(issues),'issues')
for issue in issues[:65]: print(issue)
PY

Length of output: 21885


🏁 Script executed:

#!/bin/bash
set -euo pipefail
nl -ba app/Helpers/locale_helper.php | sed -n '12,27p;68,84p'
nl -ba app/Config/App.php | sed -n '170,202p'
nl -ba app/Events/Load_config.php | sed -n '46,72p'
python - <<'PY'
import pathlib,re,subprocess
root=pathlib.Path('app/Language')
dirs={p.name for p in root.iterdir() if p.is_dir()}
config=pathlib.Path('app/Config/App.php').read_text()
supported=set(re.findall(r"'([^']+)'",config.split('public array $supportedLocales = [',1)[1].split('];',1)[0]))
helper=pathlib.Path('app/Helpers/locale_helper.php').read_text()
registered=set(re.findall(r"'([^':]+):[^']*'\s*=>",helper.split('function get_languages()',1)[1].split('return $languages;',1)[0]))
print('Directories missing from supportedLocales:',sorted(dirs-supported))
print('Directories missing from get_languages():',sorted(dirs-registered))
files=set()
for c in ['793eb3c','4569658','51856cc','944ce2d']:
 files.update(subprocess.check_output(['git','diff-tree','--no-commit-id','--name-only','-r','-M',c],text=True).splitlines())
print('Unique selected changed paths (including rename sources):',len(files))
print('Legacy Croatian directory exists:',(root/'hr-HR').exists())
print('Normalized Croatian directory exists:',(root/'hr').exists())
PY

Length of output: 5095


@BudsieBuds I reviewed 793eb3c, 4569658, 51856cc, and 944ce2d. I excluded a468db7 from the review scope.

Finding

[P2] Preserve saved Croatian locale settings when renaming hr-HR to hr
Commit 51856cc — app/Helpers/locale_helper.php, Line 73; app/Config/App.php, Line 178.

Existing installations can still store hr-HR as their system or employee language code. The directory rename removes app/Language/hr-HR, but this change does not migrate or normalize those saved values.

For the system language, Load_config::setDefaultLanguage() checks whether the saved locale directory exists. A saved hr-HR now fails that check, so the application uses English instead of Croatian. Employee settings also continue to return the old code unchanged.

Migrate saved system and employee language codes to hr, or normalize hr-HR before directory validation and locale selection. Verify the upgrade with both settings initially set to hr-HR.

Other checks

  • No additional findings in the other three commits.
  • Static catalog checks found no missing keys, extra keys, duplicate keys, or ordering violations.
  • All language directories appear in supportedLocales and get_languages().
  • I did not run PHPUnit or application code.

I followed the retrieved repository guidance to report only changed-code findings within the PR objective.


🧠 Learnings used
Learnt from: objecttothis
Repo: opensourcepos/opensourcepos PR: 4697
File: AGENTS.md:0-0
Timestamp: 2026-09-10T10:48:27.876Z
Learning: For the opensourcepos/opensourcepos repository, limit pull request review comments to code changed in the pull request branch. Do not report findings in unchanged files.
Learnt from: objecttothis
Repo: opensourcepos/opensourcepos PR: 0
File: :0-0
Timestamp: 2026-08-23T13:35:50.065Z
Learning: In the opensourcepos/opensourcepos repository, review findings outside the pull request objective should normally be proposed as follow-up issues or separate pull requests. Include an unrelated finding in the current pull request only when it is required to prevent a direct security or correctness problem in the changed feature.

You are interacting with an AI system.

@BudsieBuds

Copy link
Copy Markdown
Member Author

@coderabbitai Review dde63f8 and 37221c2.

In reply to your comment: a database migration is not needed for this change:

  1. Safe fallback: Load_config::setDefaultLanguage() already checks languageExists(). If hr-HR is encountered, it safely falls back to en without crashes or errors.
  2. Translation state: Croatian is only ~50% translated; half the catalog was already dynamically falling back to English.
  3. Self-healing: locale_helper::get_languages() already maps to hr:croatian, so any configuration or profile save automatically updates the saved code to hr.
  4. Overhead: Adding a migration across ospos_app_config and ospos_employees for a single directory normalization is unnecessary schema churn.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

Analysis chain

Script executed:

#!/bin/bash
set -euo pipefail
fd -H '^AGENTS\.md$' -E .git
if [ -f AGENTS.md ]; then cat AGENTS.md; fi
for commit in dde63f8 37221c2; do
  git show --format=fuller --stat "$commit"
  git show --format=short --find-renames "$commit"
done

Length of output: 121403


Script executed:

#!/bin/bash
set -euo pipefail
ast-grep outline app/Events/Load_config.php --items all
ast-grep outline app/Helpers/locale_helper.php --items all
ast-grep outline tests/LanguageFilesTest.php --items all
rg -n -C3 "Messages\.(successfully_sent|unsuccessfully_sent)|Sales\.(nontaxed_ind|taxed_ind|invoice_confirm|invoice_sent|invoice_unsent)|Common\.(please_visit_my|list_of|searched_for)|Error\.no_permission_module" app --glob '*.php' --glob '!app/Language/**'
sed -n '1,115p' app/Events/Load_config.php
sed -n '1,100p' app/Helpers/locale_helper.php
sed -n '1,240p' tests/LanguageFilesTest.php
python - <<'PY'
import pathlib,re,subprocess,collections
root=pathlib.Path('app/Language')
pat=re.compile(r"^\s*'((?:\\.|[^'\\])*)'\s*=>\s*'((?:\\.|[^'\\])*)',?\s*$",re.M)
def read(p): return pat.findall(p.read_text())
english={p.name:dict(read(p)) for p in (root/'en').glob('*.php')}
files=set()
for c in ['dde63f8','37221c2']:
 files.update(subprocess.check_output(['git','diff-tree','--no-commit-id','--name-only','-r',c],text=True).splitlines())
issues=[]
for name in sorted(files):
 p=pathlib.Path(name)
 if not name.startswith('app/Language/'): continue
 pairs=read(p); keys=[k for k,v in pairs]; ref=english[p.name]
 if set(keys)!=set(ref): issues.append((name,'key mismatch',sorted(set(keys)^set(ref))))
 if len(keys)!=len(set(keys)): issues.append((name,'duplicate keys'))
 if p.name!='Calendar.php' and keys!=sorted(keys): issues.append((name,'unsorted'))
 for k,v in pairs:
  if v:
   expected=set(re.findall(r'\{(\w+)(?:[,}])',ref[k]))
   actual=set(re.findall(r'\{(\w+)(?:[,}])',v))
   if expected!=actual: issues.append((name,k,'placeholders',sorted(expected),sorted(actual)))
print('Static issues in selected changed catalogs:',len(issues))
for issue in issues: print(issue)
PY

Length of output: 18425


Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C3 "taxed_flag|no_sales_to_display|find_or_scan_item_or_receipt|date_required" app --glob '*.php' --glob '!app/Language/**'
for file in app/Language/es-ES/Sales.php app/Language/it/Sales.php app/Language/uk/Sales.php; do
 nl -ba "$file" | sed -n '123,135p'
done
git show dde63f8^:app/Language/km/Sales.php | grep -nE "date_required|find_or_scan_item_or_receipt"
rg -n -C2 "'date_required'|'find_or_scan_item_or_receipt'" app/Language/en/Sales.php app/Language/km/Sales.php
rg -n -C3 "language_code|explode\(':'|get_languages\(" app/Controllers/Config.php app/Controllers/Employees.php
rg -n -C3 'codeigniter4/framework' composer.json composer.lock
nl -ba AGENTS.md | sed -n '106,125p'

Length of output: 16811


Script executed:

#!/bin/bash
set -euo pipefail
python - <<'PY'
import pathlib,re,subprocess
root=pathlib.Path('app/Language')
keypat=re.compile(r"^\s*'([^']+)'\s*=>",re.M)
valuepat=re.compile(r"""^\s*'([^']+)'\s*=>\s*('(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"),?\s*$""",re.M)
english={p.name:dict(valuepat.findall(p.read_text())) for p in (root/'en').glob('*.php')}
files=subprocess.check_output(['git','diff-tree','--no-commit-id','--name-only','-r','dde63f8'],text=True).splitlines()
issues=[]
count=0
for name in files:
 p=pathlib.Path(name)
 if not name.startswith('app/Language/'): continue
 count+=1
 text=p.read_text(); keys=keypat.findall(text); values=dict(valuepat.findall(text)); ref=english[p.name]
 if set(keys)!=set(ref): issues.append((name,'key mismatch',sorted(set(keys)^set(ref))))
 if len(keys)!=len(set(keys)): issues.append((name,'duplicate keys'))
 if p.name!='Calendar.php' and keys!=sorted(keys): issues.append((name,'unsorted'))
 if set(values)!=set(keys): issues.append((name,'unparsed values'))
 for k,v in values.items():
  if v in ("''",'""'): continue
  expected=set(re.findall(r'\{(\w+)(?:[,}])',ref[k]))
  actual=set(re.findall(r'\{(\w+)(?:[,}])',v))
  if expected!=actual: issues.append((name,k,'placeholder mismatch',expected,actual))
print('Catalogs checked:',count)
print('Structural and placeholder-token issues:',len(issues))
for issue in issues: print(issue)
PY

Length of output: 1814


@BudsieBuds I reviewed dde63f8 and 37221c2. No new findings. I kept a468db7 outside the review scope.

  • Checked all 110 changed catalogs for key parity, ordering, and duplicate keys. No issues found.
  • Checked placeholder tokens. The only scanner matches were existing PHP \u{200b} escapes in Khmer strings, not translation placeholders.
  • Confirmed that message callers already add a space before the phone number. Removing trailing spaces does not join the text.
  • Reviewed the localization guidance changes in AGENTS.md.

Croatian locale: Understood. You accept the English fallback until Croatian is selected and saved with hr. I will not pursue the migration recommendation. Load_config::setDefaultLanguage() confirms the system-language fallback. Saving a submitted hr:croatian selection stores hr; that differs from every configuration or profile save automatically converting the old value.

I did not run PHPUnit or application code. Before merging, run vendor/bin/phpunit tests/LanguageFilesTest.php in the normal test environment.


I couldn't check this conversation for new learnings, so no new learning was saved.

You are interacting with an AI system.

@BudsieBuds
BudsieBuds force-pushed the replace-english-translations branch from 37221c2 to db01d14 Compare October 31, 2026 16:24
@BudsieBuds
BudsieBuds marked this pull request as ready for review October 31, 2026 16:26
@BudsieBuds

Copy link
Copy Markdown
Member Author

@coderabbitai review 793eb3c, e2bbcff, a844840, 193ca32, and db01d14. Skip b5556e8 because it has too many files for review.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

Analysis chain

Script executed:

#!/bin/bash
set -euo pipefail
fd -H '^AGENTS\.md$' -E .git
if [ -f AGENTS.md ]; then cat AGENTS.md; fi
for commit in 793eb3c e2bbcff a844840 193ca32 db01d14; do
  git show --format=fuller --stat "$commit"
  git show --format=short --find-renames "$commit"
done

Length of output: 42066


Script executed:

#!/bin/bash
set -euo pipefail
ast-grep outline tests/LanguageFilesTest.php --items all
ast-grep outline app/Helpers/locale_helper.php --items all
ast-grep outline app/Views/partial/datepicker_locale.php --items all
ast-grep outline app/Views/partial/daterangepicker.php --items all
nl -ba tests/LanguageFilesTest.php | sed -n '1,160p'
sed -n '1,115p' app/Helpers/locale_helper.php
sed -n '145,210p' app/Config/App.php
sed -n '1,110p' app/Views/partial/datepicker_locale.php
sed -n '65,115p;180,225p' app/Views/partial/daterangepicker.php
sed -n '250,300p' app/Views/item_kits/form.php
rg -n -C2 "'item_kit_number_duplicate'|'mayl'|'unauthorized_modify'|'jurisdiction_id'" app/Language/en
rg -n -C3 'formatLoadingMessage|Bootstrap_tables.loading' app --glob '!app/Language/**'
python - <<'PY'
import pathlib,re
root=pathlib.Path('app/Language')
pat=re.compile(r"^\s*'([^']+)'\s*=>", re.M)
english={p.name:pat.findall(p.read_text()) for p in (root/'en').glob('*.php')}
print('en-GB parity:')
for p in sorted((root/'en-GB').glob('*.php')):
    missing=set(english[p.name])-set(pat.findall(p.read_text()))
    if missing: print(p, 'missing',len(missing),sorted(missing)[:8])
dirs={p.name for p in root.iterdir() if p.is_dir()}
config=pathlib.Path('app/Config/App.php').read_text()
supported=set(re.findall(r"'([^']+)'",config.split('public array $supportedLocales = [',1)[1].split('];',1)[0]))
helper=pathlib.Path('app/Helpers/locale_helper.php').read_text()
registered=set(re.findall(r"'([^':]+):[^']*'\s*=>",helper.split('function get_languages()',1)[1].split('return $languages;',1)[0]))
print('Directories missing supportedLocales:',sorted(dirs-supported))
print('Directories missing get_languages:',sorted(dirs-registered))
for name in ['Cashups.php','Customers.php','Employees.php','Expenses.php','Receivings.php','Taxes.php']:
    p=root/'en'/name
    keys=pat.findall(p.read_text())
    print(str(p), 'sorted:',keys==sorted(keys),'unique:',len(keys)==len(set(keys)))
PY

Length of output: 27775


@BudsieBuds I reviewed 793eb3c, e2bbcff, a844840, 193ca32, and db01d14. I excluded b5556e8.

Finding

[P3] Enforce missing-key checks for en-GB
Commit 193ca32 — tests/LanguageFilesTest.php, Line 60–62.

The early return skips the missing-key assertion for every en-GB catalog. This conflicts with the key-parity requirement in AGENTS.md, which explicitly includes en-GB.

The current en-GB catalogs have full key parity. However, a future deletion would pass this test, including deletion of a British English translation.

Remove this exception so all catalogs reach the missing-key assertion:

$missing = array_diff($expectedKeys, $currentKeys);
$this->assertEmpty($missing, "{$file} is missing keys: " . implode(', ', $missing));

Other checks

  • No additional findings in the selected commits.
  • Confirmed the corrected item-kit validation key exists.
  • Confirmed full-month arrays use Calendar.mayl and the short-month array retains Calendar.may.
  • Confirmed all language directories appear in both locale registrations.
  • Confirmed the six changed English catalogs have sorted, unique keys.

I did not run PHPUnit or application code. Run vendor/bin/phpunit tests/LanguageFilesTest.php in the normal test environment.


I couldn't check this conversation for new learnings, so no new learning was saved.

You are interacting with an AI system.

@BudsieBuds
BudsieBuds force-pushed the replace-english-translations branch from db01d14 to 8dc9a36 Compare October 31, 2026 16:40
@BudsieBuds

Copy link
Copy Markdown
Member Author

@coderabbitai Does fa143c0 resolve your finding?

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

Analysis chain

Script executed:

#!/bin/bash
set -euo pipefail
fd -H '^AGENTS\.md$' -E .git
if [ -f AGENTS.md ]; then cat AGENTS.md; fi
git show --format=fuller --stat fa143c0
git show --format=short fa143c0
ast-grep outline tests/LanguageFilesTest.php --items all
nl -ba tests/LanguageFilesTest.php | sed -n '1,180p'

Length of output: 21759


@BudsieBuds Yes. fa143c0 resolves the finding.

In tests/LanguageFilesTest.php, Line 60–61, the missing-key assertion now applies to every catalog, including en-GB. There is no en-GB early return. The data provider also includes all locale directories.

I verified the code but did not run PHPUnit. Run vendor/bin/phpunit tests/LanguageFilesTest.php in your normal test environment to confirm the suite passes.


Learnings used
Learnt from: objecttothis
Repo: opensourcepos/opensourcepos PR: 0
File: :0-0
Timestamp: 2026-08-23T13:35:50.065Z
Learning: In the opensourcepos/opensourcepos repository, review findings outside the pull request objective should normally be proposed as follow-up issues or separate pull requests. Include an unrelated finding in the current pull request only when it is required to prevent a direct security or correctness problem in the changed feature.

You are interacting with an AI system.

Comment thread app/Config/App.php Resolved
Comment thread app/Language/ar-EG/Common.php Resolved

@objecttothis objecttothis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review: Non-Language File Changes

app/Config/App.php + app/Helpers/locale_helper.php

The hr-HR → hr normalization and ka (Georgian) addition are consistent across both files. ✅

Bug: sw-KE and sw-TZ are missing from locale_helper.php.

Both locales are added to $supportedLocales in App.php and have full language file directories, but there is no corresponding entry in get_languages() in locale_helper.php. If the UI populates a language selector from that function, these locales will never appear as options for users.

Suggested fix:

'sw-KE:swahili-ke' => 'Swahili (Kenya)',
'sw-TZ:swahili-tz' => 'Swahili (Tanzania)',

AGENTS.md

The restructured localization rules look reasonable. However, the file now references vendor/bin/phpunit tests/LanguageFilesTest.php as a validation step — if that test file is not included in this PR, the reference is dangling. Can you confirm tests/LanguageFilesTest.php is part of this changeset or already existing in code?

…ack (#4783, #4660)

- Replace untranslated English strings across all non-English catalogs with empty strings (#4783)
- Preserve genuine native calendar abbreviations and names across Latin-alphabet locales
- Purge legacy item references from Attributes catalogs across all locales (#4660)
- Migrate human translations from deleted Common keys to Login and Messages
- Remove dead keys (Common.migration_needed, Common.logout, Common.phone_number_required, Item_kits.item_number, Item_kits.item_number_duplicate)
- Clean en-GB to only maintain legitimate British English variants
- Sort all language catalog keys alphabetically
- Restore missing placeholders, clean indicator flags, and fix punctuation typos across catalogs
- Hardcode 'OSPOS', 'Open Source Point of Sale', 'opensourcepos.org', and copyright notice directly in login and footer views
- Remove copyrights, software_short, software_title, and website keys from all 46 language catalogs
- Replace Persian (fa) transliteration of OSPOS with Latin branding across Common, Config, and Module catalogs
- Correct Spanish (es-ES) os_timezone to reference OSPOS timezone
@BudsieBuds
BudsieBuds force-pushed the replace-english-translations branch from c4464d3 to 91d2457 Compare November 4, 2026 12:12
@BudsieBuds

Copy link
Copy Markdown
Member Author

@objecttothis

  1. sw-KE and sw-TZ are already in locale_helper.php. Commit 3 only added them to App.php where they had previously been omitted, bringing both files into parity.
  2. Yes, tests/LanguageFilesTest.php is included in this PR with full automated test coverage for key parity, sorting, and locale registrations.

@github-actions
github-actions Bot had a problem deploying to staging November 4, 2026 13:57 Failure
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

❌ Staging deployment failed

Check the workflow logs for details.

@BudsieBuds
BudsieBuds merged commit 9a304c0 into master Nov 4, 2026
76 of 77 checks passed
@BudsieBuds
BudsieBuds deleted the replace-english-translations branch November 4, 2026 14:24
@BudsieBuds BudsieBuds mentioned this pull request Nov 4, 2026
3 of 4 tasks

This branch had an error being deployed

1 failed deployment
staging — 91d24570 Deployed Nov 4, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants