[ticket/17191] Update language file helper for new composer values

PHPBB3-17191
This commit is contained in:
Christian Schnegelberger 2023-09-21 11:07:18 +02:00 committed by Marc Alexander
parent 99fabe2eb8
commit 36ea0c1f2e
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
2 changed files with 8 additions and 4 deletions

View file

@ -24,8 +24,8 @@
"local-name": "British English",
"phpbb-version": "4.0.0-a1-dev",
"direction": "ltr",
"user_lang": "en-gb",
"plural_rule": "1",
"recaptcha_lang": "en-GB"
"user-lang": "en-gb",
"plural-rule": "1",
"recaptcha-lang": "en-GB"
}
}

View file

@ -91,7 +91,7 @@ class language_file_helper
*/
protected function get_language_data_from_json(array $data) : array
{
if (!isset($data['extra']['language-iso']) || !isset($data['extra']['english-name']) || !isset($data['extra']['local-name']))
if (!isset($data['extra']['language-iso']) || !isset($data['extra']['english-name']) || !isset($data['extra']['local-name']) || !isset($data['extra']['direction']) || !isset($data['extra']['user-lang']) || !isset($data['extra']['plural-rule']) || !isset($data['extra']['recaptcha-lang']))
{
throw new DomainException('INVALID_LANGUAGE_PACK');
}
@ -115,6 +115,10 @@ class language_file_helper
'author' => implode(', ', $authors),
'version' => $data['version'],
'phpbb_version' => $data['extra']['phpbb-version'],
'direction' => $data['extra']['direction'],
'user-lang' => $data['extra']['user-lang'],
'plural-rule' => $data['extra']['plural-rule'],
'recaptcha-lang'=> $data['extra']['recaptcha-lang'],
];
}
}