Skip to content

feat(install): the install wizard in five languages, with a language switch - #192

Merged
Panelica merged 3 commits into
Panelica:mainfrom
ertugrulkeyvan:feat/installer-languages
Oct 15, 2026
Merged

Panelica merged 3 commits into
Panelica:mainfrom
ertugrulkeyvan:feat/installer-languages

Conversation

@ertugrulkeyvan

@ertugrulkeyvan ertugrulkeyvan commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

The install wizard now speaks the operator's language. It has a language switch at the top, and it offers that language as the system's default on the last step.

PNLCS ships 30 languages, but the wizard, the first thing anyone installing it sees, was English only. There were two reasons:

  • The text was written into the views: HardcodedViewTextTest counted 59 strings across the six wizard views.
  • There was no language to use: SetLocale takes the language from the database, and while the wizard runs there is none yet. A Turkish or German operator got five English screens before reaching a system they could set to their language.

After this:

  • The browser's language: the wizard opens in it when it is English, Turkish, German, Polish or Chinese, the five languages the project keeps complete. Any other language gets English, as before.
  • A switch at the top: "English · Türkçe · Deutsch · Polski · 简体中文" on every step. The choice is kept in the session for the rest of the wizard.
  • Every text in the wizard is translated: headings, labels, buttons, the requirement checks, the "Test Connection" answer and the finish page. The migrate step and the scheduler note from 09e66f4 were already translated. The ledger goes from 59 to 4: "— PNLCS", "PHP ≥ 8.4", the GitHub address and "Docker Hub".
  • The last step's "Default Locale" starts at the language the wizard was run in. It also marks whichever language is current: before, only English, Turkish and Chinese could ever be shown as selected. With APP_LOCALE=de the form showed English and saved it unless changed by hand. The list and its validation now share one list in the controller.

Unchanged:

  • The steps, their order, their checks and what they write.
  • SetLocale everywhere else.

How

  • App\Http\Middleware\InstallLocale:
    • runs on the wizard's routes after SetLocale;
    • stores ?lang= when it is one of the five;
    • otherwise uses the session's choice, or the browser's preferred language among the five;
    • sets the locale.
  • Views: all text through __('install.*'), 56 keys added to the install language file next to the migration and scheduler texts already there, in en, tr, de, pl and zh. Names, errors and commands are passed as placeholders, so no translation carries a command line or an English word. The finish page's "Login as admin" goes through trans_markup(), so the username keeps its <code> without a raw echo.
  • InstallController:
    • LOCALES drives the last step's list and its validation;
    • the "Test Connection" success is translated. The migration error is already the migrate step's own install.migrate_failed.

The work is split into three commits: the middleware and routes, the views and translations, and the tests.

Tests

tests/Feature/InstallerLanguageTest.php, 5 tests, each on a fresh deployment (no lock, no administrator):

  • Browser language: with Accept-Language: tr the requirements page is Turkish and <html lang="tr">.
  • Switch: ?lang=de is kept on the next step.
  • Unsupported language: ?lang=xx with a Japanese browser stays English.
  • Every step: it offers the other four languages as links, and shows the current one without a link.
  • Last step: after ?lang=pl it preselects Polish as the default language.

Four of them fail on main. The existing installer tests pass unchanged, and so do HardcodedViewTextTest (lower ledger), TranslationParityTest, DynamicTranslationParityTest and TranslationCoverageTest.

Full suite: 4217 passed. The one failure is the CurrencyAndBackupTest db backup test, which fails on main too in my local setup.

@ertugrulkeyvan
ertugrulkeyvan marked this pull request as draft October 15, 2026 00:22
@ertugrulkeyvan
ertugrulkeyvan force-pushed the feat/installer-languages branch from db2e7ad to 0f3b622 Compare October 15, 2026 00:23
@ertugrulkeyvan
ertugrulkeyvan marked this pull request as ready for review October 15, 2026 00:32
Panelica pushed a commit that referenced this pull request Oct 15, 2026
#192 wrote the wizard's 56 new texts in the five complete languages.
Spanish, complete since #190, had 10 of the 66 texts of the install
group. They are written in the "usted" of the Spanish files and with
their words (Nombre de usuario, Contraseña, Apellidos, pasarela de pago),
in the order of the English file.
@Panelica
Panelica merged commit e142b22 into Panelica:main Oct 15, 2026
1 check passed
@Panelica

Copy link
Copy Markdown
Owner

Thank you, Ertuğrul. The wizard is the first thing anyone installing PNLCS sees, and now it speaks their language: the browser's, or the one picked at the top, kept for every step and offered as the default on the last one. Four of the five new tests fail on main and all pass here; the installer, translation and hardcoded-text tests pass as well, and so does the full suite on the merged result (4219 passed).

Merged with one commit on top (aad69b9, merge e142b22): the 56 new texts in Spanish. Spanish has had every text since #190, and its install group would otherwise have had 10 of 66.

Checked on the merged code beyond the tests: the release package uploaded with no command run, walked through in English and in Turkish on nginx and PHP-FPM (a Turkish browser gets the wizard in Turkish, the switch goes to German and back, and the installation is saved with Turkish as its default language), and install.sh on Debian 12 and Rocky Linux 9.

It goes out with the next beta.

Panelica pushed a commit that referenced this pull request Oct 15, 2026
One command on a fresh server (install.sh), the release package installed
without a command line, the wizard's database step tried before it is
saved and run in short requests, the cron line on the finish page, the
wizard in five languages (#192) and the last client texts translated
(#191), the My Account language hint and the README's Docker quick start
on image 1.5. No database change. A MINOR beta: features landed after
1.5.1-beta.1.
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