Repository navigation
i18n: Replace untranslated strings with empty fallbacks, normalize locales, and clean catalogs - #4793
Conversation
|
@coderabbitai full review |
|
|
Important Review skippedToo 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.
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain
Finding[P2] Preserve saved Croatian locale settings when renaming Existing installations can still store For the system language, Migrate saved system and employee language codes to Other checks
I followed the retrieved repository guidance to report only changed-code findings within the PR objective. 🧠 Learnings used
You are interacting with an AI system. |
|
@coderabbitai Review dde63f8 and 37221c2. In reply to your comment: a database migration is not needed for this change:
|
|
Tip For best results, initiate chat on the files or code changes. Analysis chain
Croatian locale: Understood. You accept the English fallback until Croatian is selected and saved with I did not run PHPUnit or application code. Before merging, run
You are interacting with an AI system. |
37221c2 to
db01d14
Compare
|
Tip For best results, initiate chat on the files or code changes. Analysis chain
Finding[P3] Enforce missing-key checks for The early return skips the missing-key assertion for every The current 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
I did not run PHPUnit or application code. Run
You are interacting with an AI system. |
db01d14 to
8dc9a36
Compare
|
@coderabbitai Does fa143c0 resolve your finding? |
|
Tip For best results, initiate chat on the files or code changes. Analysis chain
In I verified the code but did not run PHPUnit. Run Learnings used
You are interacting with an AI system. |
objecttothis
left a comment
There was a problem hiding this comment.
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?
…rim Thai string (#4476)
…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
c4464d3 to
91d2457
Compare
|
|
❌ Staging deployment failed Check the workflow logs for details. |
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 inAGENTS.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
''across all non-English catalogs to enable dynamic fallback to English.Attributes.phpto empty fallback so the UI displays "attribute" and unblocks Weblate for human retranslations.Sales.no_sales_to_displayin English (fixing the regression from chore: remove unused Sales language keys #4637), while preserving 34 existing human translations.Partially Addressed & Contextual
kaandsw, normalizeshr-HR→hr, fixes datepickermayl, trims Thai ellipsis). Weblate administrative setup remains open.Sales.no_sales_to_displaywas inadvertently removed as "unused", causing regression [Bug]:En lang no longer has this. 'no_sales_to_display' => 'No Sales to display', #4794.Background & Rationale
MY_Language::getLine()falls back toenwhen a value is''. Using empty fallbacks ensures the UI always shows current English text while properly signaling unlocalized strings to Weblate translators.hr, registerskaandsw, 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):
'') dynamically falls back toenat runtime viaMY_Language::getLine(), the UI continues to render the exact same text.''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.weekstartis 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
tl/Calendar.php(Tagalog) onmasterwith empty fallback.maylin 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:
fix(i18n): correct spelling and populate missing strings in English catalogCashups.php,Customers.php,Employees.php, andReceivings.php.Employees.php,Expenses.php, andTaxes.php.fix: correct item kit error key, use mayl in datepickers, and trim Thai string (#4476)item_kits/form.php.Calendar.maylfor full month names in datepickers.th/Bootstrap_tables.php.feat(i18n): register ka, sw locales and normalize Croatian to hr (#4476)ka,sw-KE, andsw-TZinApp.phpandlocale_helper.php.hr-HRto standardhr.refactor(i18n): replace untranslated English strings with empty fallback (#4783, #4660)''(Replace English values in non-English language catalogs with empty strings #4783).Attributes.phpto empty fallback (i18n: retranslate Attributes.definition_successful_adding / definition_successful_updating for remaining languages #4660).Sales.no_sales_to_displayin English (fixing chore: remove unused Sales language keys #4637 regression) and preserves existing translations ([Bug]:En lang no longer has this. 'no_sales_to_display' => 'No Sales to display', #4794).Common.websiteandCommon.copyrightsacross all catalogs.Datepicker.weekstartper CLDR / national standards.Calendar.php).en-GBto only maintain authentic British English variants.test(i18n): add comprehensive language file test coveragetests/LanguageFilesTest.phpwith 4,418 automated test assertions verifying syntax, exact key parity against English, alphabetical sorting, duplicate rejection, and locale registration.docs(agents): update AGENTS.md with localization guidelines and best practicesAGENTS.md.Verification & Testing
vendor/bin/phpunit --no-coverage tests/LanguageFilesTest.php:.php-cs-fixer.no-header.php).