[ Index ]

PHP Cross Reference of phpBB-3.3.0-deutsch




/phpbb/language/ -> language.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 673 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

language:: (16 methods):

Class: language  - X-Ref

Wrapper class for loading translations

__construct(language_file_loader $loader, $common_modules = null)   X-Ref

param: \phpbb\language\language_file_loader    $loader            Language file loader
param: array|null                            $common_modules    Array of common language modules to load (optional)

set_user_language($user_lang_iso, $reload = false)   X-Ref
Function to set user's language to display.

param: string    $user_lang_iso        ISO code of the User's language
param: bool        $reload                Whether or not to reload language files

set_default_language($default_lang_iso, $reload = false)   X-Ref
Function to set the board's default language to display.

param: string    $default_lang_iso    ISO code of the board's default language
param: bool        $reload                Whether or not to reload language files

get_lang_array()   X-Ref
Returns language array

Note: This function is needed for the BC purposes, until \phpbb\user::lang[] is
not removed.

return: array    Array of loaded language strings

add_lang($component, $extension_name = null)   X-Ref
Add Language Items

$component = array('posting');
$component = array('posting', 'viewtopic')
$component = 'posting'

param: string|array    $component        The name of the language component to load
param: string|null    $extension_name    Name of the extension to load component from, or null for core file

is_set($key)   X-Ref

return: bool        Returns whether the language key is set.
param: $key array|string        The language key we want to know more about. Can be string or array.

lang()   X-Ref
Advanced language substitution

Function to mimic sprintf() with the possibility of using phpBB's language system to substitute nullar/singular/plural forms.
Params are the language key and the parameters to be substituted.
This function/functionality is inspired by SHS` and Ashe.

Example call: <samp>$user->lang('NUM_POSTS_IN_QUEUE', 1);</samp>

If the first parameter is an array, the elements are used as keys and subkeys to get the language entry:
Example: <samp>$user->lang(array('datetime', 'AGO'), 1)</samp> uses $user->lang['datetime']['AGO'] as language entry.

return: string    Return localized string or the language key if the translation is not available

lang_raw($key)   X-Ref
Returns the raw value associated to a language key or the language key no translation is available.
No parameter substitution is performed, can be a string or an array.

return: array|string
param: string|array    $key    Language key

lang_array($key, $args = array()   X-Ref
Act like lang() but takes a key and an array of parameters instead of using variadic

return: string
param: string|array    $key    Language key
param: array            $args    Parameters

load_common_language_files()   X-Ref
Loads common language files

get_plural_form($number, $force_rule = false)   X-Ref
Determine which plural form we should use.

For some languages this is not as simple as for English.

return: int    The plural-case we need to use for the number plural-rule combination
param: int|float        $number        The number we want to get the plural case for. Float numbers are floored.
param: int|bool        $force_rule    False to use the plural rule of the language package

get_used_language()   X-Ref
Returns the ISO code of the used language

return: string    The ISO code of the currently used language

set_fallback_array($reload = false)   X-Ref
Returns language fallback data

return: array
param: bool    $reload    Whether or not to reload language files

load_core_file($component)   X-Ref
Load core language file

param: string    $component    Name of the component to load

load_extension($extension_name, $component)   X-Ref
Load extension language file

param: string    $extension_name    Name of the extension to load language from
param: string    $component        Name of the component to load

reload_language_files()   X-Ref
Reload language files

Generated: Tue Apr 7 19:44:41 2020 Cross-referenced by PHPXref 0.7.1