1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/app/translator.php
mbugeia 5e51bcd6e9 Init files + sources
Kanboard 1.0.6
2014-07-20 12:26:15 +02:00

36 lines
615 B
PHP

<?php
use Core\Translator;
// Get a translation
function t()
{
$t = new Translator;
return call_user_func_array(array($t, 'translate'), func_get_args());
}
// Get a locale currency
function c($value)
{
$t = new Translator;
return $t->currency($value);
}
// Get a formatted number
function n($value)
{
$t = new Translator;
return $t->number($value);
}
// Get a locale date
function dt($format, $timestamp)
{
$t = new Translator;
return $t->datetime($format, $timestamp);
}
// Plurals, return $t2 if $value > 1
function p($value, $t1, $t2) {
return $value > 1 ? $t2 : $t1;
}