1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Change language code to lowercase for translation file (#1775)

For languages like 'pt_BR', the filename is pt_br.ini as well as the repo is /pt_br.

The pt_BR pages' headers and footers are not being translated.
This commit is contained in:
Leonardo Lara Rodrigues
2026-01-18 16:13:25 -03:00
committed by GitHub
parent fa2452042e
commit d965e37a1e

View File

@@ -292,7 +292,7 @@ function autogen(string $text, string $lang) {
throw new \InvalidArgumentException("Cannot autogenerate text for '$text'");
}
$translationFile = __DIR__ . \DIRECTORY_SEPARATOR . "ui_translation" . \DIRECTORY_SEPARATOR . $lang . ".ini";
$translationFile = __DIR__ . \DIRECTORY_SEPARATOR . "ui_translation" . \DIRECTORY_SEPARATOR . strtolower($lang) . ".ini";
if (!\file_exists($translationFile)) {
if ($lang !== "en") {