Skip to content

Commit

Permalink
Inserts new locale group and its dedicated library.
Browse files Browse the repository at this point in the history
  • Loading branch information
JB Lebrun committed Feb 11, 2019
1 parent e2c9afb commit 0be1aa8
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
48 changes: 48 additions & 0 deletions engine/lib/tool/units.php.inc
@@ -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;
}
?>
63 changes: 63 additions & 0 deletions engine/locale/units/translation_fr.php.inc
@@ -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&eacute;e';
$this->trads['unit_years'] = 'Ann&eacute;es';
$this->trads['unit_year(s)'] = 'Ann&eacute;e(s)';
$this->trads['unit_1year'] = '1 ann&eacute;e';
$this->trads['unit_xyears'] = '%s ann&eacute;es';
?>

0 comments on commit 0be1aa8

Please sign in to comment.