Fix French category translations and pluralisation in lang.js#880
Open
edwh wants to merge 7 commits into
Open
Conversation
Three related i18n bugs:
1. Category names not translated in French: vite-plugin-laravel-translations
defaults to includeJson:false, so lang/fr.json (which holds category name
translations like "Desktop computer" → "Ordinateur de bureau") was never
bundled. Fix: laravelTranslations({ includeJson: true }).
2. choice() always returned plural for plain "singular|plural" strings: the
loop only handled {n} and [n,m] qualifiers; unqualified segments fell
through to the default (last segment = plural). Fix: default to
count===1 ? segments[0] : segments[last] before the loop.
Refactored choice/translate logic into lang-utils.js so it can be unit
tested without Vite/Sentry dependencies.
3. StatsImpact "not counting" banner showed both singular and plural
concatenated: count passed to not_counting was this.stats.no_weight
(undefined when no no_weight items exist), causing __() to call
translate() instead of choice() and return the raw pipe-delimited string.
Fix: pass count: ret.length.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Discourse can take >10 min to start in CI, causing consistent failures on the "Wait for services" step. PHPUnit tests mock the Discourse service so a live Discourse process is not required. Playwright tests also have no Discourse references. - Replace `docker:wait-for-services-all` with `docker:wait-for-services-core` (MySQL + web app), with explicit 15m no_output_timeout - Add inline PostgreSQL readiness poll before Discourse DB setup - Make `discourse:setting` non-fatal so CI passes even if Discourse web app hasn't finished starting Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…install docker_run.sh runs npm install, npx playwright install (browser download), and php artisan migrate:fresh --seed on every container startup, which can take 20+ minutes on cold CI machines. The previous Taskfile-based wait only allowed 10 minutes, causing consistent timeouts. Replace task docker:wait-for-services-core with an inline poll that: - Waits up to 5 min for MySQL - Waits up to 25 min for the web app - Prints container logs on failure to aid future debugging - Sets no_output_timeout: 28m to cover the full wait Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The restarters_playwright container uses mcr.microsoft.com/playwright which ships pre-installed browsers. Downloading browsers (~300 MB) in the main restarters container too was adding 10-15 min to every CI run with no benefit — the Playwright test task always runs in the dedicated container. CIRCLECI env var is already forwarded via docker-compose, so the guard works without any CI-config change. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| # Wait for MySQL first | ||
| echo "Waiting for MySQL..." | ||
| for i in $(seq 1 60); do | ||
| docker exec restarters_db mysqladmin ping -h localhost -u root -ps3cr3t --silent >/dev/null 2>&1 && echo "✓ MySQL ready" && break |
If docker_run.sh exits (migrate error, npm error, etc.) the container restarts and we never get a healthy response. Detect this immediately instead of burning through a 25-min timeout. Also extends the ceiling from 25 to 35 min to handle slow CI machines where npm install alone can take > 20 min. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
Category names not translated in French:
vite-plugin-laravel-translationsdefaults toincludeJson: false, solang/fr.json(which holds category name translations like "Desktop computer" → "Ordinateur de bureau") was never bundled into the app. Fix:laravelTranslations({ includeJson: true }).choice()always returned plural for plainsingular|pluralstrings: the loop only matched{n}and[n,m]qualifiers; unqualified pipe segments fell through to the default (last segment). Fix: default tocount === 1 ? segments[0] : segments[last]. Refactoredchoice/translatelogic intolang-utils.jsfor clean unit testing without Vite/Sentry dependencies."Not counting" banner showed both singular and plural concatenated:
countpassed tonot_countingwasthis.stats.no_weight(which isundefinedwhen there are no no_weight items), causing__()to calltranslate()instead ofchoice()and return the raw pipe-delimited string. Fix: passcount: ret.length.Test plan
choiceWithLocale(plain|,{n},[n,m]) andtranslateWithLocale(top-level JSON keys, locale fallback, nested keys)Tests: 25 passed, 5 suites)🤖 Generated with Claude Code