[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/inc/ -> class.l10n.php (sommaire)

(pas de description)

Poids: 509 lignes (16 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 2 classes

l10n:: (9 méthodes):
  l10n()
  loadDomain()
  loadPlugin()
  loadFile()
  optimizeLocale()
  getAvailableLocales()
  getAcceptedLanguage()
  getIsoCodes()
  getIsoWestern()

CError:: (5 méthodes):
  resetError()
  setError()
  error()
  setDbError()
  bulkSetError()

Définit 5 fonctions

  __()

Classe: l10n  - X-Ref

Localization class.

2 letter ISO codes from http://www.oasis-open.org/cover/iso639a.html
The list of languages supported by ISO-8859-1 is coming from Wikipedia
l10n($lang='en', $domain='plume')   X-Ref
Constructor.
See loadDomain()

param: string Language ('en')
param: string Domain ('plume')

loadDomain($lang='en', $domain='plume')   X-Ref
Load a domain file.
A domain file is a .lang file in the main locale folder of plume.

param: string Language ('en')
param: string Domain, without the .lang ('plume')
return: bool Success

loadPlugin($lang='en', $plugin)   X-Ref
Load the locale of a plugin in the translation array.
See loadDomain()
It does not set the 'locale_lang' variable, whereas the
loadDomain() method is setting it.

param: string Language ('en')
param: string Plugin name
return: bool Sucess

loadFile($file, $getencodingonly=false)   X-Ref
Load a locale file

param: string Complete path to the locale file
param: bool Get only the encoding of the file
return: mixed Bool for success or encoding string

optimizeLocale($file)   X-Ref
Optimize a locale. Convert the .lang in a .php file
ready to be included. The optimized file is encoded
with the current encoding.

param: string Locale file to optimize
return: bool Success

getAvailableLocales($plugin='', $domain='')   X-Ref
Get the available locales for a plugin or a domain.

param: string Plugin ('')
param: string Domain ('')
return: array List of 2 letter iso codes

getAcceptedLanguage($available, $accepted ='')   X-Ref
Return the "best" accepted language from the list of available
languages.

Use $_SERVER['HTTP_ACCEPT_LANGUAGE'] if the accepted language is empty

param: array Available languages in the system
param: string String of comma separated accepted languages ('')
return: string Language 2 letter iso code, default is 'en'

getIsoCodes($lang=false)   X-Ref
Returns iso codes.

param: bool Is the language the key in the array (false)
return: array The key is either the language or the iso code

getIsoWestern()   X-Ref
Returns the list of western iso codes.


Classe: CError  - X-Ref

Error handling class.

resetError()   X-Ref
Reset the errors


setError($msg, $no=0)   X-Ref
Set an error.

By convention the number is 4xx if the error is coming from
the user or 5xx if coming from the system (database error for ex.)

param: string Error message
param: int Error number (0)

error($html=false, $with_nb=true)   X-Ref
Returns the errors.

param: bool Errors as HTML list (false)
param: bool Show numbers (true)
return: mixed array of errors, HTML list, or false if no errors

setDbError($db_error_msg)   X-Ref
Helper function to set the error from the DB.

param: string Error message from the DB

bulkSetError($errors)   X-Ref
Bulk set errors.

Used when you went to recopy the errors of one object into
another. You can call that way:
$object->bulkSetErrors($otherobject->error());

param: array List of errors
return: bool Success

Fonctions
Fonctions qui ne font pas partie d'une Classe:

__($str)   X-Ref
Pas de description



Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics