$plural_forms
$plural_forms :
Translation utility.
This class provides utilities to load and cache translation strings. The functions using the values are directly available when loading Pluf. They are __ and _n for simple translations and for plural dependent translations respectively.
Based on benchmarking by http://mel.melaxis.com/devblog/2006/04/10/benchmarking-php- \ localization-is-gettext-fast-enough/ the string id system is really fast, so here the system is using a .ini file approach with a string id cache.
Why reimplementing a gettext system when one is already available? It is because the PHP gettext extension requires the corresponding locale to be installed system wide to load the corresponding translations. If your host has no locales outside English installed, you can only provide English to your users. Which is not really nice.
getAcceptedLanguage( $available, $accepted = '') : string
Return the "best" accepted language from the list of available languages.
Use $_SERVER['HTTP_ACCEPT_LANGUAGE'] if the accepted language list is empty. The list must be something like: 'da, en-gb;q=0.8, en;q=0.7'
$available | ||
$accepted |
Language 2 or 5 letter iso code, default is 'en'