diff --git a/engine/lib/tool/units.php.inc b/engine/lib/tool/units.php.inc new file mode 100755 index 00000000..1e81bff9 --- /dev/null +++ b/engine/lib/tool/units.php.inc @@ -0,0 +1,48 @@ + + * @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; +} +?> diff --git a/engine/locale/units/translation_fr.php.inc b/engine/locale/units/translation_fr.php.inc new file mode 100755 index 00000000..1c176937 --- /dev/null +++ b/engine/locale/units/translation_fr.php.inc @@ -0,0 +1,63 @@ + + * @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'; +?>