You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]:En lang no longer has this. 'no_sales_to_display' => 'No Sales to display', #4794
app/Language/en/Sales.php on master has no no_sales_to_display key — a repo-wide code search for no_sales_to_display returns zero matches anywhere in the codebase, even though bootstrap_tables_locale.php dynamically builds the lookup key Sales.no_sales_to_display for the empty daily-sales table, so it falls back to rendering the literal key name instead of a translated message, exactly as reported.
There is an open, unmerged PR addressing this directly: #4795 "fix(i18n): add missing no_sales_to_display key", which adds the key to en/Sales.php (plus corresponding entries across other locale files). As of this check it is still open (merged: false), so the bug remains reproducible on master.
@coderabbitai Was this issue resolved and closed rightfully by the linked PR/commits? Please verify all requirements were met and flag any missing parts or regressions.
#!/bin/bashset -euo pipefail
cat AGENTS.md
gh pr view 4793 --repo opensourcepos/opensourcepos --json state,mergedAt,mergeCommit,baseRefName,url,statusCheckRollup --jq '{state,mergedAt,mergeCommit,baseRefName,url,checks:[.statusCheckRollup[]? | {name,conclusion,status}]}'
gh api repos/opensourcepos/opensourcepos/branches/master --jq '{name,sha:.commit.sha}'
git show -s --format='%H%n%P%n%s' HEAD
ast-grep outline app/Views/partial/bootstrap_tables_locale.php
ast-grep outline app/Config/Services.php --items all
fd '^LanguageFilesTest\.php$'.
ast-grep outline tests/LanguageFilesTest.php
cat -n app/Views/partial/bootstrap_tables_locale.php
cat -n app/Libraries/MY_Language.php
rg -n -C5 'function language|MY_Language' app/Config/Services.php
rg -n -C5 'no_sales_to_display|function test|Sales|fallback|lang\(' tests/LanguageFilesTest.php
fd '^Sales\.php$'.
rg -n -C4 'bootstrap_tables_locale|function manage|sales/manage' app --glob '*.php' --glob '!Language/**'| head -180
python - <<'PY'from pathlib import Pathimport subprocess,re,collectionskey=re.compile(r"^\s*'no_sales_to_display'\s*=>\s*('(?:\\.|[^'\\])*')\s*,",re.M)files=sorted(Path('app/Language').glob('*/Sales.php'))counts=collections.Counter()problems=[]changed=[]preserved=0parent=subprocess.check_output(['git','rev-parse','HEAD^1'],text=True).strip()for p in files: text=p.read_text() matches=key.findall(text) if len(matches)!=1: problems.append((str(p),len(matches))) continue value=matches[0] counts['empty' if value=="''" else 'English' if p.parent.name=='en' else 'translated']+=1 keys=re.findall(r"^\s*'([^']+)'\s*=>",text,re.M) i=keys.index('no_sales_to_display') if i and keys[i-1]>keys[i] or i+1<len(keys) and keys[i]>keys[i+1]: problems.append((str(p),'key out of order')) oldpath=str(p).replace('/hr/','/hr-HR/') old=subprocess.run(['git','show',f'{parent}:{oldpath}'],capture_output=True,text=True) prev=key.findall(old.stdout) if prev and prev[0] not in ("''","'No Sales to display.'"): if prev[0]==value: preserved+=1 else: changed.append((str(p),prev[0],value))print('Catalog count:',len(files))print('Values:',dict(counts))print('Missing, duplicate, or ordering problems:',problems)print('Existing non-English translations preserved:',preserved)print('Changed existing translations:',changed)print('English-key delta:')subprocess.run(['git','diff',f'{parent}..HEAD','--','app/Language/en/Sales.php'])PY
Length of output: 42645
@BudsieBudsYes. Closing #4794 was justified by the fix merged into master through #4793. The fix did not come from #4795, which remains open and unmerged.
What I verified
Closure and merge:#4793 merged on November 4, 2026, at 14:23:50 UTC. The issue timeline links the closure to commit 9a304c0. That commit is also the current master HEAD.
This is the only change to the English Sales catalog in the closing commit.
Correct lookup: The daily-sales view includes bootstrap_tables_locale.php. Its formatNoMatches callback constructs Sales.no_sales_to_display for the sales controller at Lines 23–26. The restored key matches that lookup.
Locale coverage: All 46 Sales catalogs contain the key exactly once and in alphabetical order. They contain one English source value, 33 non-English values, and 12 empty fallback values.
Fallback behavior:MY_Language::getLine() explicitly falls back to en for empty values at Lines 30–35. This includes the empty en-GB entry. I applied the supplied localization guidance and confirmed it against the source.
I found no missing functional requirement or regression in the empty-sales message path. The earlier “still present” comment predates the merge.
Remaining caveats
Regression-test strength: The new tests/LanguageFilesTest.php checks catalog structure and key parity. Those checks alone would not prevent this key from being removed from every catalog again. A focused assertion for Sales.no_sales_to_display, or a rendered empty-table test, would provide stronger protection.
Deployment remains unverified: The PR’s build, lint, and database test checks passed. However, a staging deployment check failed. I did not run the application or verify the live demo, so this confirms the repository fix—not deployment to the demo or inclusion in a released version.
Duplicate PR:#4795 remains open even though #4793 supplies the fix. It can be closed as superseded.
The issue can remain closed. The test improvement and deployment check are follow-up items, not evidence that the source fix is incomplete.
Learnings used
Learnt from: CR
Repo: opensourcepos/opensourcepos PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-10-31T13:57:12.261Z
Learning: Applies to {app/Language/**,app/Plugins/*/Language/**} : Source excerpt:
# Agent Instructions
## Localization
- Never copy English text from a neighboring key as a value for a non-English language file, even if that neighboring key is already untranslated — evaluate each key independently
Learnt from: CR
Repo: opensourcepos/opensourcepos PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-10-31T13:57:12.261Z
Learning: Applies to {app/Language/**,app/Plugins/*/Language/**} : Source excerpt:
# Agent Instructions
## Localization
- Non-English files must use an empty string (`''`) as the value when no translation is provided — CodeIgniter automatically falls back to the default (`en`) language. This applies only when a translation genuinely isn't available yet.
Learnt from: CR
Repo: opensourcepos/opensourcepos PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-10-31T13:57:12.261Z
Learning: Applies to {app/Language/**,app/Plugins/*/Language/**} : Source excerpt:
# Agent Instructions
## Localization
- **New keys must be inserted in alphabetical order** within the language array
Learnt from: CR
Repo: opensourcepos/opensourcepos PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-10-31T13:57:12.261Z
Learning: Applies to {app/Language/**,app/Plugins/*/Language/**} : Source excerpt:
# Agent Instructions
## Localization
- When adding new keys to language files, add the key to all `app/Language/*/` variants
Learnt from: objecttothis
Repo: opensourcepos/opensourcepos PR: 4450
File: app/Language/de-DE/Sales.php:76-81
Timestamp: 2026-04-03T08:54:53.158Z
Learning: In opensourcepos, non-English language files intentionally use empty string values (`""`) for untranslated keys. The custom `app/Libraries/MY_Language.php` class overrides CI4's `Language::getLine()` to fall back to the English translation whenever `$output === NULL || $output === ""`, so empty strings are a valid and deliberate pattern — they should NOT be flagged as missing translations or suggested for removal.
Learnt from: objecttothis
Repo: opensourcepos/opensourcepos PR: 4727
File: app/Views/partial/header.php:20-20
Timestamp: 2026-10-10T22:13:01.070Z
Learning: OSPOS uses the custom PHP CodeIgniter language service MY_Language, registered by Config\Services::language() in app/Config/Services.php. MY_Language::getLine() in app/Libraries/MY_Language.php falls back to the English translation when the selected translation is null or an empty string, then formats the translation with the supplied arguments. Empty locale strings therefore do not imply missing rendered text when the English translation is populated.
Learnt from: CR
Repo: opensourcepos/opensourcepos PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-10-31T13:57:12.261Z
Learning: Applies to {app/Language/**,app/Plugins/*/Language/**} : Source excerpt:
# Agent Instructions
## Localization
- Only `app/Language/en/` and `app/Language/en-GB/` should contain English strings
Activity
fix(i18n): add missing no_sales_to_display key to English Sales lang
objecttothis commentedon Nov 1, 2026
Claude Issue Checker Agent (cc @objecttothis)
Investigated against current
master.Status: Still present (fix not yet merged).
app/Language/en/Sales.phponmasterhas nono_sales_to_displaykey — a repo-wide code search forno_sales_to_displayreturns zero matches anywhere in the codebase, even thoughbootstrap_tables_locale.phpdynamically builds the lookup keySales.no_sales_to_displayfor the empty daily-sales table, so it falls back to rendering the literal key name instead of a translated message, exactly as reported.There is an open, unmerged PR addressing this directly: #4795 "fix(i18n): add missing no_sales_to_display key", which adds the key to
en/Sales.php(plus corresponding entries across other locale files). As of this check it is still open (merged: false), so the bug remains reproducible onmaster.refactor(i18n): standardize language catalogs, enforce dynamic fallba…
BudsieBuds commentedon Nov 4, 2026
@coderabbitai Was this issue resolved and closed rightfully by the linked PR/commits? Please verify all requirements were met and flag any missing parts or regressions.
coderabbitai commentedon Nov 4, 2026
Analysis chain
Script executed:
Length of output: 36465
Script executed:
Length of output: 31617
Script executed:
Length of output: 42645
@BudsieBudsYes. Closing#4794was justified by the fix merged intomasterthrough#4793. The fix did not come from#4795, which remains open and unmerged.What I verified
#4793merged on November 4, 2026, at 14:23:50 UTC. The issue timeline links the closure to commit9a304c0. That commit is also the currentmasterHEAD.app/Language/en/Sales.php, Line 127 now defines:bootstrap_tables_locale.php. ItsformatNoMatchescallback constructsSales.no_sales_to_displayfor the sales controller at Lines 23–26. The restored key matches that lookup.MY_Language::getLine()explicitly falls back toenfor empty values at Lines 30–35. This includes the emptyen-GBentry. I applied the supplied localization guidance and confirmed it against the source.I found no missing functional requirement or regression in the empty-sales message path. The earlier “still present” comment predates the merge.
Remaining caveats
tests/LanguageFilesTest.phpchecks catalog structure and key parity. Those checks alone would not prevent this key from being removed from every catalog again. A focused assertion forSales.no_sales_to_display, or a rendered empty-table test, would provide stronger protection.#4795remains open even though#4793supplies the fix. It can be closed as superseded.The issue can remain closed. The test improvement and deployment check are follow-up items, not evidence that the source fix is incomplete.
Learnings used
You are interacting with an AI system.