IFactory¶
-
interface
OCP\L10N\
IFactory
¶ Implemented by: OC\L10N\Factory
Source: lib/public/L10N/IFactory.php#37
Methods¶
-
public
OCP\L10N\IFactory::
get
($app, $lang=null, $locale=null)¶ - Get a language instance
Source: Parameters: - $app (string)
- $lang (string | null)
- $locale (string | null)
Returns: Since: 8.2.0
-
public
OCP\L10N\IFactory::
findLanguage
($app=null)¶ - Find the best language
Source: Parameters: - $app (string | null) App id or null for core
Returns: string language If nothing works it returns ‘en’
Since: 9.0.0
-
public
OCP\L10N\IFactory::
findLocale
($lang=null)¶ Source: Parameters: - $lang (string | null) user language as default locale
Returns: string locale If nothing works it returns ‘en_US’
Since: 14.0.0
-
public
OCP\L10N\IFactory::
findLanguageFromLocale
($app=core, $locale=null)¶ - find the matching lang from the locale
Source: Parameters: - $app (string)
- $locale (string)
Returns: null | string
Since: 14.0.1
-
public
OCP\L10N\IFactory::
findAvailableLanguages
($app=null)¶ - Find all available languages for an app
Source: Parameters: - $app (string | null) App id or null for core
Returns: string[] an array of available languages
Since: 9.0.0
-
public
OCP\L10N\IFactory::
findAvailableLocales
()¶ Source: lib/public/L10N/IFactory.php#88 Returns: array an array of available Since: 14.0.0
-
public
OCP\L10N\IFactory::
languageExists
($app, $lang)¶ Source: Parameters: - $app (string | null) App id or null for core
- $lang (string)
Returns: bool
Since: 9.0.0
-
public
OCP\L10N\IFactory::
localeExists
($locale)¶ Source: Parameters: - $locale (string)
Returns: bool
Since: 14.0.0
-
public
OCP\L10N\IFactory::
createPluralFunction
($string)¶ - Creates a function from the plural string
Source: Parameters: - $string (string)
Returns: string Unique function name
Since: 14.0.0
-
public
OCP\L10N\IFactory::
getLanguageIterator
($user=null)¶ - iterate through language settings (if provided) in this order:1. returns the forced language or:2. if applicable, the trunk of 1 (e.g. “fu” instead of “fu_BAR”3. returns the user language or:4. if applicable, the trunk of 35. returns the system default language or:6. if applicable, the trunk of 57+∞. returns ‘en’Hint: in most cases findLanguage() suits you fine
Source: lib/public/L10N/IFactory.php#128 Since: 14.0.0