quantum-php-project icon indicating copy to clipboard operation
quantum-php-project copied to clipboard

Split the common translations into files by topic

Open armanist opened this issue 2 weeks ago • 0 comments

Summary

Split the common translation file of the starter project into files by topic, to match the DemoWeb and DemoApi module templates of quantum-php/framework#644. The framework templates now call pages.*, auth.*, account.*, posts.*, comments.*, actions.* and lang.*, so the texts have to be in these files here, otherwise a generated module shows the key names.

Why

shared/resources/lang/{en,es}/common.php holds 75 keys from unrelated areas. The module templates generated by install:demo read their texts from this project, and the framework now splits the keys by topic.

Goal

For each language (en and es), shared/resources/lang/<lang>/ gets:

  • common.php: the keys the framework reads by name, activate_account, reset_password, otp, pagination (next, prev) and the field labels the validator reads as common.<field> (captcha, confirm_password, content, current_password, email, firstname, image, lastname, new_password, password, repeat_password, title, token)
  • pages.php, auth.php, account.php, posts.php, comments.php, actions.php, lang.php: the other 57 keys, with the same texts, as listed in quantum-php/framework#644
  • comments.added and comments.deleted, two texts the DemoWeb comment controller called but that did not exist, in English and Spanish

The three email views in shared/views/email (and their copies in tests/_root) use the new keys, for example auth.activate instead of common.activate.

Acceptance criteria

  • every key lives in exactly one file, in both languages, and en and es have the same keys in every file
  • every moved text is identical to the old one
  • every key called by the framework DemoWeb and DemoApi templates exists in both languages
  • the pull request is merged together with the framework release that carries the new templates (3.1.2), so a new project shows the texts and not the key names

Notes

Relevant code:

  • shared/resources/lang/en and shared/resources/lang/es
  • shared/views/email/*.php and tests/_root/shared/views/email/*.php
  • tests/Unit/shared/Lang/CommonLangTest.php

armanist avatar Nov 16 '26 19:11 armanist