From 6a483425ae0e551714aee9afe611d56ee1db2c9d Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 17 Jan 2017 14:22:33 +0100 Subject: [PATCH] fixed translation for permission names --- build/viewer/view/group/permission.php | 20 ++++++++++++++++++++ build/viewer/view/group/permission.twig | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/build/viewer/view/group/permission.php b/build/viewer/view/group/permission.php index f3f9d55..f61fd03 100755 --- a/build/viewer/view/group/permission.php +++ b/build/viewer/view/group/permission.php @@ -88,6 +88,26 @@ return $ucRes->get('clusters'); })); + $twig->addFilter(new \Twig_Filter('translate', function($word, $lang){ + $word = strtolower($word); + + + if( $lang === 'fr' ){ + + switch($word){ + case 'start': return 'démarrer'; break; + case 'stop': return 'arrêter'; break; + case 'signal': return 'signaler'; break; + case 'lock': return 'bloquer'; break; + case 'unlock': return 'débloquer'; break; + + default: return 'inconnu'; break; + } + }else + return 'inconnu'; + + })); + /* [4] Build the whole stuff =========================================================*/ diff --git a/build/viewer/view/group/permission.twig b/build/viewer/view/group/permission.twig index 67e0d02..6031e7e 100644 --- a/build/viewer/view/group/permission.twig +++ b/build/viewer/view/group/permission.twig @@ -20,7 +20,7 @@ - {{ permission.name }} + {{ permission.name | translate('fr') }}