1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-19 06:51:33 +02:00

[ticket/17191] Add new direction and user_langto helper and language.php

PHPBB3-17191
This commit is contained in:
Christian Schnegelberger
2023-09-21 17:00:37 +02:00
committed by Marc Alexander
parent 06f38a5646
commit 6d07852410
4 changed files with 38 additions and 10 deletions

View File

@@ -404,8 +404,16 @@ class language
*/
public function get_plural_form($number, $force_rule = false)
{
global $phpbb_container;
// Get the language helper
/* @var $language_helper \phpbb\language\language_file_helper */
$language_file_helper = $phpbb_container->get('language.helper.language_file');
// Grab the users lang plural rule
$plural_rule_content = $language_file_helper->get_lang_key_value('plural_rule');
$number = (int) $number;
$plural_rule = ($force_rule !== false) ? $force_rule : ((isset($this->lang['PLURAL_RULE'])) ? $this->lang['PLURAL_RULE'] : 1);
$plural_rule = ($force_rule !== false) ? $force_rule : ((isset($plural_rule_content)) ? $plural_rule_content : 1);
/**
* The following plural rules are based on a list published by the Mozilla Developer Network