Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inserts new locale group and its dedicated library.
- Loading branch information
JB Lebrun
committed
Feb 11, 2019
1 parent
e2c9afb
commit 0be1aa8
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* @brief Units specific methods | ||
* @details Engine / Tool Library | ||
* @file engine/lib/tool/units.php.inc | ||
* @author CaMykS Team <camyks.contact@gmail.com> | ||
* @version 1.0 | ||
* @date Creation: Feb 2019 | ||
* @date Modification: Feb 2019 | ||
* @copyright 2019 CaMykS Team | ||
* @note This program is distributed as is - WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* @warning This library is not loaded with CaMykS initialisation. | ||
*/ | ||
|
||
/** | ||
* Load units locales. | ||
* @param string $language | ||
* @return void | ||
*/ | ||
function units_loadLocales($language='') { | ||
global $camyks; | ||
|
||
/* check lang value */ | ||
if ($language=='') $language = $camyks->current_language; | ||
|
||
/* load locales */ | ||
$camyks->add_generic_translation('units', $language); | ||
} | ||
|
||
/** | ||
* Return unit title. | ||
* @param string $unit | ||
* @param string $language | ||
* @return string | ||
*/ | ||
function unit_getTitle($unit='', $language='') { | ||
global $camyks; | ||
|
||
/* load locales */ | ||
units_loadLocales(); | ||
|
||
/* check locale */ | ||
if (isset($camyks->trads['unit_'.$unit])) | ||
return $camyks->get_translation('unit_'.$unit); | ||
return $unit; | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
/** | ||
* @brief Units french dictionnary | ||
* @details Engine / Dictionnary | ||
* @file engine/locale/units/translation_fr.php.inc | ||
* @author CaMykS Team <camyks.contact@gmail.com> | ||
* @version 1.0 | ||
* @date Creation: Fab 2019 | ||
* @date Modification: Feb 2019 | ||
* @copyright 2019 CaMykS Team | ||
* @note This program is distributed as is - WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
*/ | ||
|
||
/* date and time */ | ||
$this->trads['unit_millisecond'] = 'Milliseconde'; | ||
$this->trads['unit_milliseconds'] = 'Millisecondes'; | ||
$this->trads['unit_millisecond(s)'] = 'Milliseconde(s)'; | ||
$this->trads['unit_1millisecond'] = '1 milliseconde'; | ||
$this->trads['unit_xmilliseconds'] = '%s millisecondes'; | ||
|
||
$this->trads['unit_second'] = 'Seconde'; | ||
$this->trads['unit_seconds'] = 'Secondes'; | ||
$this->trads['unit_second(s)'] = 'Seconde(s)'; | ||
$this->trads['unit_1second'] = '1 seconde'; | ||
$this->trads['unit_xseconds'] = '%s secondes'; | ||
|
||
$this->trads['unit_minute'] = 'Minute'; | ||
$this->trads['unit_minutes'] = 'Minutes'; | ||
$this->trads['unit_minute(s)'] = 'Minute(s)'; | ||
$this->trads['unit_1minute'] = '1 minute'; | ||
$this->trads['unit_xminutes'] = '%s minutes'; | ||
|
||
$this->trads['unit_hour'] = 'Heure'; | ||
$this->trads['unit_hours'] = 'Heures'; | ||
$this->trads['unit_hour(s)'] = 'Heure(s)'; | ||
$this->trads['unit_1hour'] = '1 heure'; | ||
$this->trads['unit_xhours'] = '%s heures'; | ||
|
||
$this->trads['unit_day'] = 'Jour'; | ||
$this->trads['unit_days'] = 'Jours'; | ||
$this->trads['unit_day(s)'] = 'Jour(s)'; | ||
$this->trads['unit_1day'] = '1 jour'; | ||
$this->trads['unit_xdays'] = '%s jours'; | ||
|
||
$this->trads['unit_week'] = 'Semaine'; | ||
$this->trads['unit_weeks'] = 'Semaines'; | ||
$this->trads['unit_week(s)'] = 'Semaine(s)'; | ||
$this->trads['unit_1week'] = '1 semaine'; | ||
$this->trads['unit_xweeks'] = '%s semaines'; | ||
|
||
$this->trads['unit_month'] = 'Mois'; | ||
$this->trads['unit_months'] = 'Mois'; | ||
$this->trads['unit_month(s)'] = 'Mois'; | ||
$this->trads['unit_1month'] = '1 mois'; | ||
$this->trads['unit_xmonths'] = '%s mois'; | ||
|
||
$this->trads['unit_year'] = 'Année'; | ||
$this->trads['unit_years'] = 'Années'; | ||
$this->trads['unit_year(s)'] = 'Année(s)'; | ||
$this->trads['unit_1year'] = '1 année'; | ||
$this->trads['unit_xyears'] = '%s années'; | ||
?> |