Problem
The automated tests of PR #11 run with the English locale only. The other locale files (locales/de.php, ja.php, oc.php, sample.php) are not tested: they are not even known to load without errors, and new texts may be missing in them. The keys Wrong password (login) and Invalid page name were added without translations (de.php has Wrong password since PR #11; the others fall back to the English text, which __() handles by returning the key).
Tests to add
- Let the harness set
W2_LOCALE (configOverrides()), and run a smoke test for each locale file: every main view renders (status 200, no PHP warnings, see RegressionTest), the page language attribute is correct, and translated texts appear (e.g. the toolbar tooltips).
- Unit test: every locale file is valid PHP, defines
$w2_word_set as an array of strings, has no duplicate keys, and the values keep their format (e.g. date_format is a valid format string).
- A completeness check against
locales/en.php / the keys used with __() in the code (extract them with the tokenizer, like SourceGuardTest), reporting missing keys per locale; decide whether missing keys fail the build or only produce a report.
- Security: translations are escaped by
__() (h()), so a locale value with quotes or markup (e.g. " or <) cannot break out of attributes; test this with a generated locale.
- Characters: non-ASCII text and the
W2_CHARSET meta tag are consistent (files are UTF-8).
Also add the missing translations (Wrong password, Invalid page name, ...) for the existing locales, if the maintainers of those translations agree.
Problem
The automated tests of PR #11 run with the English locale only. The other locale files (
locales/de.php,ja.php,oc.php,sample.php) are not tested: they are not even known to load without errors, and new texts may be missing in them. The keysWrong password(login) andInvalid page namewere added without translations (de.phphasWrong passwordsince PR #11; the others fall back to the English text, which__()handles by returning the key).Tests to add
W2_LOCALE(configOverrides()), and run a smoke test for each locale file: every main view renders (status 200, no PHP warnings, seeRegressionTest), the page language attribute is correct, and translated texts appear (e.g. the toolbar tooltips).$w2_word_setas an array of strings, has no duplicate keys, and the values keep their format (e.g.date_formatis a valid format string).locales/en.php/ the keys used with__()in the code (extract them with the tokenizer, likeSourceGuardTest), reporting missing keys per locale; decide whether missing keys fail the build or only produce a report.__()(h()), so a locale value with quotes or markup (e.g."or<) cannot break out of attributes; test this with a generated locale.W2_CHARSETmeta tag are consistent (files are UTF-8).Also add the missing translations (
Wrong password,Invalid page name, ...) for the existing locales, if the maintainers of those translations agree.