[ 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 10]

DEBUG_LOCALE = false

[ Top ]


Functions
generateLanguageList  [line 147]

Returns an array of available language locales.


array generateLanguageList( )

[ Top ]
generateLanguageOptionList  [line 177]

Generates the option list for the language selectin <select>

Parameters:
bool   $HTTPAccept:  set to true to include the HTTPAccept item


void generateLanguageOptionList( bool $HTTPAccept  )

[ Top ]
getUserLocale  [line 338]

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 385]

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 ]
parseHttpAcceptLanguage  [line 297]

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 210]

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


void setMainDomain( )

[ Top ]
setPluginDomain  [line 202]

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


bool setPluginDomain( string $plugindomain  )

[ Top ]
setThemeDomain  [line 226]

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: 


bool setThemeDomain( $themedomain, string $plugindomain  )

[ Top ]
setupCurrentLocale  [line 236]

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

Parameters:
   $plugindomain: 
   $type: 


mixed setupCurrentLocale( [ $plugindomain = ''], [ $type = '']  )

[ Top ]
setupLanguageArray  [line 12]

void setupLanguageArray( )

[ Top ]


Documentation generated on Tue, 02 Dec 2008 21:23:49 +0100 by phpDocumentor 1.4.1