[ class tree: core ] [ index: core ] [ all elements ]

Procedural File: functions-i18n.php

Source Location: /functions-i18n.php

Page Details

functions-i18n.php -- support functions for internationalization

Constants
DEBUG_LOCALE  [line 9]

DEBUG_LOCALE = false

[ Top ]


Functions
generateLanguageList  [line 145]

Returns an array of available language locales.

Parameters:
   $all: 


array generateLanguageList( [ $all = false]  )

[ Top ]
getAllTranslations  [line 561]

returns a serialized "multilingual array" of translations Used for setting default options with multi-lingual strings.

Parameters:
string   $text:  to be translated


void getAllTranslations( string $text  )

[ Top ]
gettext_pl  [line 248]

Gettext replacement function for separate translations of third party plugins within the root plugins folder.

Parameters:
string   $string:  The string to be translated
string   $plugin:  The name of the plugin. Required.


string gettext_pl( string $string, string $plugin  )

[ Top ]
gettext_th  [line 231]

Gettext replacement function for separate translations of third party themes.

Parameters:
string   $string:  The string to be translated
string   $theme:  The name of the plugin. Only required for strings on the 'theme_description.php' file like the general theme description. If the theme is the current theme the function sets it automatically.


string gettext_th( string $string, [string $theme = '']  )

[ Top ]
getTimezones  [line 505]

Returns a list of timezones


unknown getTimezones( )

[ Top ]
getUserLocale  [line 417]

Returns a saved (or posted) locale. Posted locales are stored as a cookie.

Sets the 'locale' option to the result (non-persistent)


void getUserLocale( )

[ Top ]
get_language_string  [line 478]

Returns the sring for the current language from a serialized set of language strings Defaults to the string for the current locale, the en_US string, or the first string which ever is present

Parameters:
string   $dbstring:  either a serialized languag string array or a single string
string   $locale:  optional locale of the translation desired


string get_language_string( string $dbstring, [string $locale = NULL]  )

[ Top ]
i18nSetLocale  [line 261]

Wrapper function for setLocale() so that all the proper permutations are used

Returns the result from the setLocale call

Parameters:
$locale   $locale:  the local desired


string i18nSetLocale( $locale $locale  )

[ Top ]
parseHttpAcceptLanguage  [line 351]

This function will parse a given HTTP Accepted language instruction (or retrieve it from $_SERVER if not provided) and will return a sorted array. For example, it will parse fr;en-us;q=0.8

Thanks to Fredbird.org for this code.

Parameters:
string   $str:  optional language string


array parseHttpAcceptLanguage( [string $str = NULL]  )

[ Top ]
setMainDomain  [line 204]

Sets the locale, etc. to the zenphoto domain details.

Returns the result of setupCurrentLocale()


void setMainDomain( )

[ Top ]
setPluginDomain  [line 195]

Sets the optional textdomain for separate translation files for plugins.

The plugin translation files must be located within zp-core/plugins/<plugin name>/locale/<language locale>/LC_MESSAGES/ and must have the name of the plugin (<plugin name>.po <plugin name>.mo)

Return value is the success of the setlocale() call

Parameters:
string   $plugindomain:  The name of the plugin

API Tags:
Deprecated:  


bool setPluginDomain( string $plugindomain  )

[ Top ]
setThemeDomain  [line 221]

Sets the optional textdomain for separate translation files for themes.

The plugin translation files must be located within zenphoto/themes/<theme name>/locale/<language locale>/LC_MESSAGES/ and must have the name of the theme (<theme name>.po <theme name>.mo)

Return value is the success of the setlocale() call

Parameters:
string   $plugindomain:  The name of the theme
   $themedomain: 

API Tags:
Deprecated:  


bool setThemeDomain( $themedomain, string $plugindomain  )

[ Top ]
setupCurrentLocale  [line 307]

Setup code for gettext translation Returns the result of the setlocale call

Parameters:
string   $override:  force locale to this
string   $plugindomain:  domain
string   $type:  case for settign domain


mixed setupCurrentLocale( [string $override = NULL], string $plugindomain, string $type  )

[ Top ]
setupDomain  [line 277]

Sets the translation domain and

Parameters:
$domaine   $domain: 
$type   $type: 


void setupDomain( [$domaine $domain = NULL], [$type $type = NULL]  )

[ Top ]
setupLanguageArray  [line 11]

void setupLanguageArray( )

[ Top ]
timezoneDiff  [line 536]

Returns the difference between the server timez one and the local (users) time zone

Parameters:
string   $server: 
string   $local: 


int timezoneDiff( string $server, string $local  )

[ Top ]
validateLocale  [line 391]

checks a "supplied" locale against the valid locales.

Returns a valid locale if one exists else returns NULL

Parameters:
string   $userlocale: 
   $source: 


void validateLocale( string $userlocale, $source  )

[ Top ]


Documentation generated on Tue, 20 Dec 2011 16:07:18 +0100 by phpDocumentor 1.4.3