DomCI : Update all the PHPDoc
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3279 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
51
language.php
51
language.php
@@ -24,10 +24,11 @@ class language
|
||||
public $cacheDir = "data/locale";
|
||||
|
||||
/** Choose the best language in the browser list and which is available in
|
||||
locale path
|
||||
@param string|null $repLocale Directory where are stored the translations
|
||||
@param string|null $languageCode The coding langugage of the soft
|
||||
@return string The choosed locale whithout charset (like fr_FR) */
|
||||
* locale path
|
||||
* @param string|null $repLocale Directory where are stored the translations
|
||||
* @param string|null $languageCode The coding langugage of the soft
|
||||
* @return string The choosed locale whithout charset (like fr_FR)
|
||||
*/
|
||||
function languageSelection ($repLocale = "./locale", $languageCode = "fr_FR")
|
||||
{
|
||||
$arrAccept = array ();
|
||||
@@ -128,8 +129,9 @@ class language
|
||||
}
|
||||
|
||||
/** Return the language recorded in the Cookie. Check if this language is
|
||||
allowed
|
||||
@return string The language allowed or FALSE */
|
||||
* allowed
|
||||
* @return string The language allowed or FALSE
|
||||
*/
|
||||
function languageCookie ($cookieName, $repLocale = "./locale")
|
||||
{
|
||||
if (!isset ($_COOKIE[$cookieName]))
|
||||
@@ -143,17 +145,19 @@ class language
|
||||
}
|
||||
|
||||
/** Set the cookie with a TTL of one month
|
||||
@param string $cookieName The name of the cookie
|
||||
@param string $languageCode Language to store
|
||||
@param string $sitepath The site path */
|
||||
* @param string $cookieName The name of the cookie
|
||||
* @param string $languageCode Language to store
|
||||
* @param string $sitepath The site path
|
||||
*/
|
||||
function languageCookieSet ($cookieName, $languageCode, $sitepath)
|
||||
{
|
||||
@setcookie ($cookieName, $languageCode, time()+60*60*24*30, $sitepath);
|
||||
}
|
||||
|
||||
/** Return an array with all the languages available in the $repLocale dir
|
||||
The languages are in the format 'en_US' without the codeset.
|
||||
Return FALSE if there is an error */
|
||||
* The languages are in the format 'en_US' without the codeset.
|
||||
* Return FALSE if there is an error
|
||||
*/
|
||||
function languageTraductionsList ($repLocale = "./locale")
|
||||
{
|
||||
if (! is_dir ($repLocale) || ! is_readable ($repLocale))
|
||||
@@ -172,10 +176,12 @@ class language
|
||||
return $list;
|
||||
}
|
||||
|
||||
/** Return the full text of the category
|
||||
* Return false if it doesn't exists
|
||||
* @param string $category The category to analyze
|
||||
*/
|
||||
private function languageCategoryText ($category)
|
||||
{
|
||||
// Renvoie en texte la catégorie fournie en entier
|
||||
// Renvoie FALSE si elle n'existe pas
|
||||
$categories[LC_ALL] = "LC_ALL";
|
||||
$categories[LC_COLLATE] = "LC_COLLATE";
|
||||
$categories[LC_CTYPE] = "LC_CTYPE";
|
||||
@@ -189,12 +195,12 @@ class language
|
||||
}
|
||||
|
||||
/** This function manage the cache of $package.mo files as Apache cache them
|
||||
It return the directory to use
|
||||
@param string $languageCode Language with format "fr_FR"
|
||||
@param string|null $package The package name of the soft ($package.mo
|
||||
file). "messages" by default
|
||||
@param string|null $category The folder name LC_MESSAGES by default
|
||||
@param string|null $repLocale The folder where all the locales are stored
|
||||
* It return the directory to use
|
||||
* @param string $languageCode Language with format "fr_FR"
|
||||
* @param string|null $package The package name of the soft ($package.mo
|
||||
* file). "messages" by default
|
||||
* @param string|null $category The folder name LC_MESSAGES by default
|
||||
* @param string|null $repLocale The folder where all the locales are stored
|
||||
*/
|
||||
function languageCache ($languageCode, $package="messages",
|
||||
$category=LC_MESSAGES, $repLocale = "./locale")
|
||||
@@ -255,6 +261,13 @@ class language
|
||||
return $moFile;
|
||||
}
|
||||
|
||||
/** Start the Gettext support with the cached file .mo provided as parameter
|
||||
* @param string $moFile The .mo file
|
||||
* @param string $languageCode The language code to use
|
||||
* @param integer $category the LC_ type to use
|
||||
* @param string|null $repLocale The locale directory. Use "./locale" if not
|
||||
* provided
|
||||
*/
|
||||
function languageActivation ($moFile, $languageCode, $category = LC_MESSAGES,
|
||||
$repLocale = "./locale")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user