static boolean canTranslate(
)
|
|
Can we translate?
Redefined in descendants as:
static boolean canTranslatePlural(
)
|
|
Can we make plural translations?
static array getDefaultLanguageCode(
)
|
|
Get default language code for this request.
API Tags:
Return: | GalleryStatus a status code string language code |
static null getLanguageCodeFromRequest(
)
|
|
Examine the incoming request and try to figure out what languages the browser will accept.
Take the first one that we can support.
API Tags:
Return: | or a language code in the <language>_<COUNTRY> format, eg: en_US |
static array getLanguageData(
)
|
|
Return our language data.
API Tags:
Return: | array['language code']['country code'] = array('description', 'right-to-left'?) array array('country' => 'default language code', 'country' => 'default language code', ...) |
Information Tags:
Todo: | Move this information into a configuration file |
Redefined in descendants as:
static array getSupportedLanguageCode(
string
$languageCode, [boolean
$fallback = true]
)
|
|
Find a supported locale from given string.
Parameters:
string |
$languageCode: |
the language code hint |
boolean |
$fallback: |
(optional) if false, return array(null,null) for no match instead of en_US |
API Tags:
Return: | (string a language code in <language>_<COUNTRY> format, array data about this language code (description,right-to-left?)) |
static string _setlocale(
mixed
$category, string
$locale
)
|
|
Attempt to set the requested locale. Try fallbacks and character sets if needed to find a valid locale.
Parameters:
mixed |
$category: |
|
string |
$locale: |
|
API Tags:
Return: | locale selected or boolean false if none |
Access: | private |
GalleryTranslator GalleryTranslator(
)
|
|
string getActiveLanguageCode(
)
|
|
Return supported locale that was selected after initialization.
API Tags:
array getLanguageAndCountryFromLanguageCode(
string
$langCode
)
|
|
Determine the language and country given the language code (i.e. en, en_GB)
Parameters:
string |
$langCode: |
The language code to be converted. |
API Tags:
Return: | GalleryStatus a status code string language string country |
array getLanguageCodeFromLocale(
string
$locale
)
|
|
Convert the locale to the language code
Parameters:
string |
$locale: |
The locale code to be converted (i.e. en_US, en_GB, etc.) |
API Tags:
Return: | GalleryStatus a status code string language code (i.e. en, en_GB, etc.) |
array['language getSupportedLanguages(
)
|
|
Return the list of languages that we support.
API Tags:
Return: | code']['country code'] = array('description', 'right-to-left'?) |
Deprecated: | Remove on next major api bump. Use GalleryCoreApi::getSupportedLanguages |
array init(
[string
$languageCode = null], [boolean
$dontUseDatabase = false]
)
|
|
Initialize the translator with the specified language code hint
Parameters:
string |
$languageCode: |
the language code hint (eg. 'en_US' or 'zh_CN') |
boolean |
$dontUseDatabase: |
(optional) true if we should not use the database |
API Tags:
Return: | GalleryStatus a status code string language code |
Does the active language read right-to-left?
array translateDomain(
string
$domain, mixed
$data
)
|
|
Localize the given text.
Expected inputs are of the form:
Example 1: $data['text'] = 'Some %s text to localize with %d arguments' $data['arg1'] = 'fun'; $data['arg2'] = 2; or $data['args'] = array('fun', 2);
localized: 'Some fun text to localize with 5 arguments'
Example 2: $data['one'] = 'You have %d orange' $data['many'] = 'You have %d oranges' $data['count'] = $data['arg1'] = 3; (or 1)
localized: 'You have 3 oranges' (or 'You have 1 orange')
Parameters:
string |
$domain: |
the domain (eg. pluginType . 's_' . pluginId) |
mixed |
$data: |
a single string, or an array of parameters |
API Tags:
Return: | GalleryStatus a status code string the localized value |