Skip to content

Fix language files that break Spanish, Welsh and Uzbek locales - #380

Merged
Cannonb4ll merged 1 commit into
ploi:mainfrom
theluckystrike:fix/ploi-roadmap-lang-parse-errors
Oct 5, 2026
Merged

Cannonb4ll merged 1 commit into
ploi:mainfrom
theluckystrike:fix/ploi-roadmap-lang-parse-errors

Conversation

@theluckystrike

Copy link
Copy Markdown
Contributor

Three locale files break when Laravel loads them.

What users see:

  • Spanish: lang/es/validation.php lines 1 to 3 hold leftover text from a translation tool ("Aquí está la traducción al español:" and a ```php fence) before the opening <?php tag. Laravel requires the file to load the validation group, so that text is printed into the page output whenever a Spanish validation message is used.
  • Welsh: lang/cy/auth.php:24 has an unescaped apostrophe in Dyma'r. The file doesn't parse, so any trans('auth.*') call for a cy user or app throws a ParseError (for example the wrong password message on the password protection page).
  • Uzbek: lang/uz_Latn/auth.php:19 (Yorug') and :24 (noto'g'ri) have the same problem.

Changes:

  • Remove the 3 stray lines from es/validation.php.
  • Escape the apostrophes in cy/auth.php and uz_Latn/auth.php. The translated strings stay the same.
  • Add tests/Feature/LanguageFilesTest.php. It requires every lang//.php file and checks that it returns an array and prints nothing.

Verification:

  • php -l on main: lang/cy/auth.php and lang/uz_Latn/auth.php fail with "syntax error". On this branch all 641 lang//.php files pass.

  • Loading es/validation.php on main prints the 48 bytes of leftover text. On this branch it prints nothing and returns 78 keys.

  • The new test: 3 failures against the lang files from main (cy/auth, uz_Latn/auth, es/validation), 641 passed on this branch.

  • Full Pest suite locally: the same 107 tests fail on main and on this branch. My setup has no frontend build (no Vite manifest). No new failures.

lang/es/validation.php started with leftover text and a Markdown fence
before the opening PHP tag, so loading the es validation group printed
"Aqui esta la traduccion al espanol: ```php" into the response.

lang/cy/auth.php and lang/uz_Latn/auth.php contained unescaped
apostrophes, causing a ParseError whenever an auth.* key was translated
for a user with one of those locales selected on their profile.

Add a test that requires every lang/*/*.php file and asserts it returns
an array without producing output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Cannonb4ll
Cannonb4ll merged commit 25bfd37 into ploi:main Oct 5, 2026
3 checks passed
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.

2 participants