b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (0.9.x) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Procedural File: _functions_locale.php

Source Location: /blogs/b2evocore/_functions_locale.php

Page Details

Handling of locales and i18n

s b2evolution - http://b2evolution.net/ Released under GNU GPL License - http://b2evolution.net/about/license.html

Copyright:  (c)2003-2005 by Francois PLANQUE - http://fplanque.net/
Filesource:  Source Code for this file
Functions
locale_activate  [line 151]

void locale_activate( string $locale  )

locale_activate(-)

returns true if locale has been changed

Parameters:
string   $locale:  locale to activate


[ Top ]
locale_by_lang  [line 203]

void locale_by_lang( $lang, [ $fallback_to_default = true]  )

locale_by_lang(-)

Find first locale matching lang

Parameters:
   $lang: 
   $fallback_to_default: 


[ Top ]
locale_charset  [line 247]

void locale_charset( [ $disp = true]  )

Returns the charset of the current locale

Parameters:
   $disp: 


[ Top ]
locale_datefmt  [line 263]

void locale_datefmt( )

Returns the current locale's default date format



[ Top ]
locale_flag  [line 296]

void locale_flag( [string $locale = ''], [string $collection = 'w16px'], [string $class = 'flag'], [string $align = ''], [boolean $disp = true], [mixed $absoluteurl = true]  )

Template function: Display locale flag

Parameters:
string   $locale:  locale to use, '' for current
string   $collection:  collection name (subdir of img/flags)
string   $class:  name of class for IMG tag
string   $align:  deprecated HTML align attribute
boolean   $disp:  to echo or not
mixed   $absoluteurl:  use absolute url (===true) or path to flags directory


[ Top ]
locale_from_httpaccept  [line 370]

locale locale_from_httpaccept( )

Detect language from HTTP_ACCEPT_LANGUAGE

First matched full locale code in HTTP_ACCEPT_LANGUAGE will win Otherwise, first locale in table matching a lang code will win


API Tags:
Return:  made out of HTTP_ACCEPT_LANGUAGE or $default_locale, if no match


[ Top ]
locale_lang  [line 231]

string locale_lang( [boolean $disp = true]  )

Displays/Returns the current locale. (for backward compatibility)

Parameters:
boolean   $disp:  true (default) if we want it to be outputted

API Tags:
Return:  current locale, if $disp = false


[ Top ]
locale_options  [line 342]

void locale_options( [ $default = '']  )
Parameters:
   $default: 


[ Top ]
locale_overwritefromDB  [line 442]

void locale_overwritefromDB( )

load locales from DB into $locales array. Also sets $default_locale.



[ Top ]
locale_priosort  [line 432]

void locale_priosort( $a, $b  )

user sort function to sort locales by priority

  1. is highest priority.

Parameters:
   $a: 
   $b: 


[ Top ]
locale_restore_previous  [line 136]

void locale_restore_previous( )

Restore the locale in use before the switch



[ Top ]
locale_temp_switch  [line 122]

void locale_temp_switch( string $locale  )

Temporarily switch to another locale

Calls can be nested.

Parameters:
string   $locale:  locale to activate


[ Top ]
locale_timefmt  [line 276]

void locale_timefmt( )

Returns the current locale's default time format



[ Top ]
locale_updateDB  [line 526]

void locale_updateDB( )

write $locales array to DB table


Information Tags:
Author:  blueyed

[ Top ]
NT_  [line 107]

void NT_( $string  )

NT_(-)

No Translation Nevertheless, the string will be extracted by the gettext tools

Parameters:
   $string: 


[ Top ]
T_  [line 28]

void T_( string $string, [string $req_locale = '']  )

TRANSLATE!

Translate a text to the desired locale (b2evo localization only) or to the current locale

Parameters:
string   $string:  String to translate, '' to get language file info (as in gettext spec)
string   $req_locale:  locale to translate to, '' to use current locale (basic gettext does only support '')


[ Top ]


Documentation generated on Tue, 20 May 2008 01:54:56 +0200 by phpDocumentor 1.4.2