\OCPIL10N

Interface IL10N

Summary

Methods
Constants
t()
n()
l()
getLanguageCode()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

t()

t(string  $text, array  $parameters = array()) : \OC_L10N_String

Translating

Parameters

string $text

The text we need a translation for

array $parameters

default:array() Parameters for sprintf

Returns

\OC_L10N_String —

Translation or the same text

Returns the translation. If no translation is found, $text will be returned.

n()

n(string  $text_singular, string  $text_plural, integer  $count, array  $parameters = array()) : \OC_L10N_String

Translating

Parameters

string $text_singular

the string to translate for exactly one object

string $text_plural

the string to translate for n objects

integer $count

Number of objects

array $parameters

default:array() Parameters for sprintf

Returns

\OC_L10N_String —

Translation or the same text

Returns the translation. If no translation is found, $text will be returned. %n will be replaced with the number of objects.

The correct plural is determined by the plural_forms-function provided by the po file.

l()

l(string  $type, integer|string  $data, array  $options = array()) : string|false

Localization

Parameters

string $type

Type of localization

integer|string $data

parameters for this localization

array $options

currently supports following options:

  • 'width': handed into \Punic\Calendar::formatDate as second parameter

Returns

string|false —

Returns the localized data.

Implemented types:

  • date
    • Creates a date
    • l10n-field: date
    • params: timestamp (int/string)
  • datetime
    • Creates date and time
    • l10n-field: datetime
    • params: timestamp (int/string)
  • time
    • Creates a time
    • l10n-field: time
    • params: timestamp (int/string)

getLanguageCode()

getLanguageCode() : string

The code (en, de, .

..) of the language that is used for this IL10N object

Returns

string —

language