fixed translation for permission names

This commit is contained in:
xdrm-brackets 2017-01-17 14:22:33 +01:00
parent 1bfde4ed37
commit 6a483425ae
2 changed files with 21 additions and 1 deletions

View File

@ -88,6 +88,26 @@
return $ucRes->get('clusters'); 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 /* [4] Build the whole stuff
=========================================================*/ =========================================================*/

View File

@ -20,7 +20,7 @@
<span class='groups'> <span class='groups'>
<span style='border-color: #ddd; background-color: #eee;'> <span style='border-color: #ddd; background-color: #eee;'>
{{ permission.name }} {{ permission.name | translate('fr') }}
<span class='icon-permission'></span> <span class='icon-permission'></span>
</span> </span>