Parcourir la source

Fix gettext and prepare French translation

Julien VAUBOURG il y a 9 ans
Parent
commit
5889e2eba2

+ 43 - 44
sources/config.php

@@ -1,8 +1,8 @@
 <?php
 
-/* VPN Client app for YunoHost 
+/* Wifi Hotspot app for YunoHost 
  * Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
- * Contribute at https://github.com/jvaubourg/vpnclient_ynh
+ * Contribute at https://github.com/jvaubourg/hotspot_ynh
  * 
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -18,57 +18,56 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-// Limonade configuration
+// Framework configuration
 function configure() {
-    option('env', ENV_PRODUCTION);
-    option('debug', false);
-    option('base_uri', '<TPL:NGINX_LOCATION>/');
-    layout("layout.html.php");
-    define('PUBLIC_DIR', '<TPL:NGINX_LOCATION>/public');
-}
+  option('env', ENV_PRODUCTION);
+  option('debug', false);
+  option('base_uri', '<TPL:NGINX_LOCATION>/');
 
-// Not found page
-function not_found($errno, $errstr, $errfile=null, $errline=null) {
-    $msg = h(rawurldecode($errstr));
-    return render($msg, 'error_layout.html.php');
-}
+  layout('layout.html.php');
 
-function T_($string) {
-    return gettext($string);
+  define('PUBLIC_DIR', '<TPL:NGINX_LOCATION>/public');
 }
 
 // Before routing
 function before($route) {
-     /**
-     * * Locale
-     * */
-    if (!isset($_SESSION['locale'])) {
-        $locale = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
-        $_SESSION['locale'] = strtolower(substr(chop($locale[0]),0,2));
-    }
-    $textdomain="localization";
-    putenv('LANGUAGE='.$_SESSION['locale']);
-    putenv('LANG='.$_SESSION['locale']);
-    putenv('LC_ALL='.$_SESSION['locale']);
-    putenv('LC_MESSAGES='.$_SESSION['locale']);
-    setlocale(LC_ALL,$_SESSION['locale']);
-    setlocale(LC_CTYPE,$_SESSION['locale']);
-    $locales_dir = dirname(__FILE__).'/../i18n';
-    bindtextdomain($textdomain,$locales_dir);
-    bind_textdomain_codeset($textdomain, 'UTF-8');
-    textdomain($textdomain);
-    // Set the $locale variable in template
-    set('locale', $_SESSION['locale']);
+  $lang_mapping = array(
+    'fr' => 'fr_FR'
+  );
+
+  if(!isset($_SESSION['locale'])) {
+    $locale = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+    $_SESSION['locale'] = strtolower(substr(chop($locale[0]), 0, 2));
+  }
+
+  $lang = $_SESSION['locale'];
+
+  // Convert simple language code into full language code
+  if(array_key_exists($lang, $lang_mapping)) {
+    $lang = $lang_mapping[$lang];
+  }
+
+  $lang = "$lang.utf8";
+  $textdomain = "localization";
+
+  putenv("LANGUAGE=$lang");
+  putenv("LANG=$lang");
+  putenv("LC_ALL=$lang");
+  putenv("LC_MESSAGES=$lang");
+
+  setlocale(LC_ALL, $lang);
+  setlocale(LC_CTYPE, $lang);
+
+  $locales_dir = dirname(__FILE__).'/i18n';
+
+  bindtextdomain($textdomain, $locales_dir);
+  bind_textdomain_codeset($textdomain, 'UTF-8');
+  textdomain($textdomain);
+
+  set('locale', $lang);
 }
 
 // After routing
 function after($output, $route) {
-    /*
-    $time = number_format( (float)substr(microtime(), 0, 10) - LIM_START_MICROTIME, 6);
-    $output .= "\n<!-- page rendered in $time sec., on ".date(DATE_RFC822)." -->\n";
-    $output .= "<!-- for route\n";
-    $output .= print_r($route, true);
-    $output .= "-->";
-    */
-    return $output;
+  return $output;
 }

+ 12 - 12
sources/controller.php

@@ -93,40 +93,40 @@ dispatch_put('/settings', function() {
   if($service_enabled == 1) {
     try {
       if(empty($_POST['server_name']) || empty($_POST['server_port']) || empty($_POST['server_proto'])) {
-        throw new Exception(T_('The Server Address, the Server Port and the Protocol cannot be empty'));
+        throw new Exception(_('The Server Address, the Server Port and the Protocol cannot be empty'));
       }
     
       if(!preg_match('/^\d+$/', $_POST['server_port'])) {
-        throw new Exception(T_('The Server Port must be only composed of digits'));
+        throw new Exception(_('The Server Port must be only composed of digits'));
       }
     
       if($_POST['server_proto'] != 'udp' && $_POST['server_proto'] != 'tcp') {
-        throw new Exception(T_('The Protocol must be "udp" or "tcp"'));
+        throw new Exception(_('The Protocol must be "udp" or "tcp"'));
       }
     
       if(($_FILES['crt_client']['error'] == UPLOAD_ERR_OK && $_FILES['crt_client_key']['error'] != UPLOAD_ERR_OK && (!$crt_client_key_exists || $_POST['crt_client_key_delete'] == 1))
         || ($_FILES['crt_client_key']['error'] == UPLOAD_ERR_OK && $_FILES['crt_client']['error'] != UPLOAD_ERR_OK && (!$crt_client_exists || $_POST['crt_client_delete'] == 1))) {
     
-        throw new Exception(T_('A Client Certificate is needed when you suggest a Key, or vice versa'));
+        throw new Exception(_('A Client Certificate is needed when you suggest a Key, or vice versa'));
       }
     
       if(empty($_POST['login_user']) xor empty($_POST['login_passphrase'])) {
-        throw new Exception(T_('A Password is needed when you suggest a Username, or vice versa'));
+        throw new Exception(_('A Password is needed when you suggest a Username, or vice versa'));
       }
     
       if($_FILES['crt_server_ca']['error'] != UPLOAD_ERR_OK && !$crt_server_ca_exists) {
-        throw new Exception(T_('You need a Server CA.'));
+        throw new Exception(_('You need a Server CA.'));
       }
     
       if(($_FILES['crt_client_key']['error'] != UPLOAD_ERR_OK && (!$crt_client_key_exists || $_POST['crt_client_key_delete'] == 1)) && empty($_POST['login_user'])) {
-        throw new Exception(T_('You need either a Client Certificate, either a Username, or both'));
+        throw new Exception(_('You need either a Client Certificate, either a Username, or both'));
       }
     
       if($ip6_net != 'none') {
         $ip6_net = ipv6_expanded($ip6_net);
     
         if(empty($ip6_net)) {
-          throw new Exception(T_('The IPv6 Delegated Prefix format looks bad'));
+          throw new Exception(_('The IPv6 Delegated Prefix format looks bad'));
         }
     
         $ip6_blocs = explode(':', $ip6_net);
@@ -137,7 +137,7 @@ dispatch_put('/settings', function() {
       }
 
     } catch(Exception $e) {
-      flash('error', $e->getMessage().' ('.T_('configuration not updated').').');
+      flash('error', $e->getMessage().' ('._('configuration not updated').').');
       goto redirect;
     }
   }
@@ -182,13 +182,13 @@ dispatch_put('/settings', function() {
     $retcode = start_service();
 
     if($retcode == 0) {
-      flash('success', T_('Configuration updated and service successfully reloaded'));
+      flash('success', _('Configuration updated and service successfully reloaded'));
     } else {
-      flash('error', T_('Configuration updated but service reload failed'));
+      flash('error', _('Configuration updated but service reload failed'));
     }
 
   } else {
-      flash('success', T_('Service successfully disabled'));
+      flash('success', _('Service successfully disabled'));
   }
 
   redirect:

+ 0 - 3
sources/i18n/README

@@ -1,3 +0,0 @@
-Add a "localization.pot" to this directory, and one folder per translated language, containing the po a LC_MESSAGE directory (with the .mo)
-
-See: https://github.com/YunoHost/admin_v1/tree/master/i18n

+ 45 - 0
sources/i18n/README.md

@@ -0,0 +1,45 @@
+## Force language
+
+The default language of the web admin depends on your browser language.
+
+You can force a language by using (e.g. for French):
+```
+/vpnadmin/?/lang/fr
+```
+
+English is the default language when the browser language is not available.
+
+## Update the default string list
+
+Updating the pot file from template files:
+```
+xgettext sources/views/* -o sources/i18n/localization.pot
+```
+
+## Add a new language
+
+Create a new directory path (e.g. for French):
+```
+mkdir -p sources/i18n/fr_FR/LC_MESSAGES/
+```
+
+Generate the po file:
+```
+msginit --locale=fr_FR.UTF-8 --no-translator -i sources/i18n/localization.pot -o sources/i18n/fr_FR/LC_MESSAGES/localization.po
+```
+
+You can use poedit for translating the po:
+```
+poedit sources/i18n/fr_FR/LC_MESSAGES/localization.po
+```
+
+With poedit, just save your modifications with the button and the *localization.mo* (compiled version of the po) file will automatically be created or updated.
+
+If you edited the po by hand, you have to compile the mo file:
+```
+msgfmt sources/i18n/fr_FR/localization.po -o sources/i18n/fr_FR/LC_MESSAGES/localization.mo
+```
+
+Change the default language of your browser, and test this new translation.
+
+You should add the locale to the list at the end of *sources/controller.php*.

+ 207 - 0
sources/i18n/fr_FR/LC_MESSAGES/localization.po

@@ -0,0 +1,207 @@
+# French translations for PACKAGE package.
+# Copyright (C) 2015 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2015.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-07-08 19:18+0200\n"
+"PO-Revision-Date: 2015-07-08 19:18+0200\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: sources/views/layout.html.php:27
+msgid "VPN Client"
+msgstr ""
+
+#: sources/views/layout.html.php:49
+msgid "Error"
+msgstr ""
+
+#: sources/views/layout.html.php:54 sources/views/settings.html.php:125
+#: sources/views/settings.html.php:165
+msgid "Notice"
+msgstr ""
+
+#: sources/views/layout.html.php:66
+msgid "Any problem? Contribute!"
+msgstr ""
+
+#: sources/views/settings.html.php:20
+msgid "VPN Client Configuration"
+msgstr ""
+
+#: sources/views/settings.html.php:22 sources/views/settings.html.php:24
+msgid ""
+"This is a fast status. Click on More details to show the complete status."
+msgstr ""
+
+#: sources/views/settings.html.php:22
+msgid "Running"
+msgstr ""
+
+#: sources/views/settings.html.php:24
+msgid "Not Running"
+msgstr ""
+
+#: sources/views/settings.html.php:27
+msgid "Loading complete status may take a few minutes. Be patient."
+msgstr ""
+
+#: sources/views/settings.html.php:27
+msgid "More details"
+msgstr ""
+
+#: sources/views/settings.html.php:43
+msgid "Service"
+msgstr ""
+
+#: sources/views/settings.html.php:48
+msgid "VPN Enabled"
+msgstr ""
+
+#: sources/views/settings.html.php:60
+msgid "VPN"
+msgstr ""
+
+#: sources/views/settings.html.php:65
+msgid "Server Address"
+msgstr ""
+
+#: sources/views/settings.html.php:72
+msgid "Server Port"
+msgstr ""
+
+#: sources/views/settings.html.php:74
+msgid "With restricted access, you should use 443 (TCP) or 53 (UDP)"
+msgstr ""
+
+#: sources/views/settings.html.php:79
+msgid "Protocol"
+msgstr ""
+
+#: sources/views/settings.html.php:82
+msgid "UDP"
+msgstr ""
+
+#: sources/views/settings.html.php:85
+msgid ""
+"UDP is more efficient than TCP (but more filtered in case of restrictive "
+"access)"
+msgstr ""
+
+#: sources/views/settings.html.php:86
+msgid "TCP"
+msgstr ""
+
+#: sources/views/settings.html.php:94
+msgid "Edit the raw configuration only if you know what you do!"
+msgstr ""
+
+#: sources/views/settings.html.php:94 sources/views/settings.html.php:99
+msgid "Advanced"
+msgstr ""
+
+#: sources/views/settings.html.php:109
+msgid "IPv6"
+msgstr ""
+
+#: sources/views/settings.html.php:114
+msgid "Delegated prefix"
+msgstr ""
+
+#: sources/views/settings.html.php:116
+msgid ""
+"Leave empty if your Internet Service Provider does not give you a delegated "
+"prefix"
+msgstr ""
+
+#: sources/views/settings.html.php:125
+msgid ""
+"You need to upload a Client Certificate, or define a Username (or both) for "
+"starting your VPN Client."
+msgstr ""
+
+#: sources/views/settings.html.php:131
+msgid "Certificates"
+msgstr ""
+
+#: sources/views/settings.html.php:136
+msgid "Update Client Cert."
+msgstr ""
+
+#: sources/views/settings.html.php:136
+msgid "Upload Client Cert."
+msgstr ""
+
+#: sources/views/settings.html.php:139 sources/views/settings.html.php:152
+msgid "Delete this certificate"
+msgstr ""
+
+#: sources/views/settings.html.php:144 sources/views/settings.html.php:157
+#: sources/views/settings.html.php:177
+msgid "Browse"
+msgstr ""
+
+#: sources/views/settings.html.php:149
+msgid "Update Client Key"
+msgstr ""
+
+#: sources/views/settings.html.php:149
+msgid "Upload Client Key"
+msgstr ""
+
+#: sources/views/settings.html.php:155
+msgid "Make sure your browser is able to read the key file before uploading"
+msgstr ""
+
+#: sources/views/settings.html.php:157
+msgid "make sure your browser is able to read the key file before uploading"
+msgstr ""
+
+#: sources/views/settings.html.php:165
+msgid "You need to upload a Server CA for starting your VPN Client."
+msgstr ""
+
+#: sources/views/settings.html.php:169
+msgid "Update Server CA"
+msgstr ""
+
+#: sources/views/settings.html.php:169
+msgid "Upload Server CA"
+msgstr ""
+
+#: sources/views/settings.html.php:172
+msgid "You cannot have no server CA"
+msgstr ""
+
+#: sources/views/settings.html.php:185
+msgid "Login"
+msgstr ""
+
+#: sources/views/settings.html.php:190
+msgid "Username"
+msgstr ""
+
+#: sources/views/settings.html.php:192 sources/views/settings.html.php:199
+msgid "Leave empty if not necessary"
+msgstr ""
+
+#: sources/views/settings.html.php:197
+msgid "Password"
+msgstr ""
+
+#: sources/views/settings.html.php:207
+msgid "Reloading may take a few minutes. Be patient."
+msgstr ""
+
+#: sources/views/settings.html.php:207
+msgid "Save and reload"
+msgstr ""

+ 207 - 0
sources/i18n/localization.pot

@@ -0,0 +1,207 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-07-08 19:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: sources/views/layout.html.php:27
+msgid "VPN Client"
+msgstr ""
+
+#: sources/views/layout.html.php:49
+msgid "Error"
+msgstr ""
+
+#: sources/views/layout.html.php:54 sources/views/settings.html.php:125
+#: sources/views/settings.html.php:165
+msgid "Notice"
+msgstr ""
+
+#: sources/views/layout.html.php:66
+msgid "Any problem? Contribute!"
+msgstr ""
+
+#: sources/views/settings.html.php:20
+msgid "VPN Client Configuration"
+msgstr ""
+
+#: sources/views/settings.html.php:22 sources/views/settings.html.php:24
+msgid ""
+"This is a fast status. Click on More details to show the complete status."
+msgstr ""
+
+#: sources/views/settings.html.php:22
+msgid "Running"
+msgstr ""
+
+#: sources/views/settings.html.php:24
+msgid "Not Running"
+msgstr ""
+
+#: sources/views/settings.html.php:27
+msgid "Loading complete status may take a few minutes. Be patient."
+msgstr ""
+
+#: sources/views/settings.html.php:27
+msgid "More details"
+msgstr ""
+
+#: sources/views/settings.html.php:43
+msgid "Service"
+msgstr ""
+
+#: sources/views/settings.html.php:48
+msgid "VPN Enabled"
+msgstr ""
+
+#: sources/views/settings.html.php:60
+msgid "VPN"
+msgstr ""
+
+#: sources/views/settings.html.php:65
+msgid "Server Address"
+msgstr ""
+
+#: sources/views/settings.html.php:72
+msgid "Server Port"
+msgstr ""
+
+#: sources/views/settings.html.php:74
+msgid "With restricted access, you should use 443 (TCP) or 53 (UDP)"
+msgstr ""
+
+#: sources/views/settings.html.php:79
+msgid "Protocol"
+msgstr ""
+
+#: sources/views/settings.html.php:82
+msgid "UDP"
+msgstr ""
+
+#: sources/views/settings.html.php:85
+msgid ""
+"UDP is more efficient than TCP (but more filtered in case of restrictive "
+"access)"
+msgstr ""
+
+#: sources/views/settings.html.php:86
+msgid "TCP"
+msgstr ""
+
+#: sources/views/settings.html.php:94
+msgid "Edit the raw configuration only if you know what you do!"
+msgstr ""
+
+#: sources/views/settings.html.php:94 sources/views/settings.html.php:99
+msgid "Advanced"
+msgstr ""
+
+#: sources/views/settings.html.php:109
+msgid "IPv6"
+msgstr ""
+
+#: sources/views/settings.html.php:114
+msgid "Delegated prefix"
+msgstr ""
+
+#: sources/views/settings.html.php:116
+msgid ""
+"Leave empty if your Internet Service Provider does not give you a delegated "
+"prefix"
+msgstr ""
+
+#: sources/views/settings.html.php:125
+msgid ""
+"You need to upload a Client Certificate, or define a Username (or both) for "
+"starting your VPN Client."
+msgstr ""
+
+#: sources/views/settings.html.php:131
+msgid "Certificates"
+msgstr ""
+
+#: sources/views/settings.html.php:136
+msgid "Update Client Cert."
+msgstr ""
+
+#: sources/views/settings.html.php:136
+msgid "Upload Client Cert."
+msgstr ""
+
+#: sources/views/settings.html.php:139 sources/views/settings.html.php:152
+msgid "Delete this certificate"
+msgstr ""
+
+#: sources/views/settings.html.php:144 sources/views/settings.html.php:157
+#: sources/views/settings.html.php:177
+msgid "Browse"
+msgstr ""
+
+#: sources/views/settings.html.php:149
+msgid "Update Client Key"
+msgstr ""
+
+#: sources/views/settings.html.php:149
+msgid "Upload Client Key"
+msgstr ""
+
+#: sources/views/settings.html.php:155
+msgid "Make sure your browser is able to read the key file before uploading"
+msgstr ""
+
+#: sources/views/settings.html.php:157
+msgid "make sure your browser is able to read the key file before uploading"
+msgstr ""
+
+#: sources/views/settings.html.php:165
+msgid "You need to upload a Server CA for starting your VPN Client."
+msgstr ""
+
+#: sources/views/settings.html.php:169
+msgid "Update Server CA"
+msgstr ""
+
+#: sources/views/settings.html.php:169
+msgid "Upload Server CA"
+msgstr ""
+
+#: sources/views/settings.html.php:172
+msgid "You cannot have no server CA"
+msgstr ""
+
+#: sources/views/settings.html.php:185
+msgid "Login"
+msgstr ""
+
+#: sources/views/settings.html.php:190
+msgid "Username"
+msgstr ""
+
+#: sources/views/settings.html.php:192 sources/views/settings.html.php:199
+msgid "Leave empty if not necessary"
+msgstr ""
+
+#: sources/views/settings.html.php:197
+msgid "Password"
+msgstr ""
+
+#: sources/views/settings.html.php:207
+msgid "Reloading may take a few minutes. Be patient."
+msgstr ""
+
+#: sources/views/settings.html.php:207
+msgid "Save and reload"
+msgstr ""

+ 4 - 4
sources/views/layout.html.php

@@ -24,7 +24,7 @@
 <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
 <!--[if gt IE 8]><!--> <html class="no-js" lang="<?= $locale ?>"> <!--<![endif]-->
 <head>
-  <title><?= T_("VPN Client") ?><?= isset($title) ? " | $title" : '' ?></title>
+  <title><?= _("VPN Client") ?><?= isset($title) ? " | $title" : '' ?></title>
 
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width">
@@ -46,12 +46,12 @@
     <?php if(isset($flash['error'])): ?>
       <div class="alert alert-dismissible alert-danger fade in" style="margin-top: 20px" role="alert">
         <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-        <strong><?= T_('Error') ?>:</strong> <?= $flash['error'] ?>
+        <strong><?= _('Error') ?>:</strong> <?= $flash['error'] ?>
       </div>
     <?php elseif(isset($flash['notice'])): ?>
       <div class="alert alert-dismissible alert-info fade in" style="margin-top: 20px" role="alert">
         <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-        <strong><?= T_('Notice') ?>:</strong> <?= $flash['notice'] ?>
+        <strong><?= _('Notice') ?>:</strong> <?= $flash['notice'] ?>
       </div>
     <?php elseif(isset($flash['success'])): ?>
       <div class="alert alert-dismissible alert-success fade in" style="margin-top: 20px" role="alert">
@@ -63,7 +63,7 @@
     <?= $content ?>
 
     <hr />
-    <div id="github"><a href="https://github.com/labriqueinternet/vpnclient_ynh"><?= T_('Any problem? Contribute!') ?></a> - AGPL 3.0</div>
+    <div id="github"><a href="https://github.com/labriqueinternet/vpnclient_ynh"><?= _('Any problem? Contribute!') ?></a> - AGPL 3.0</div>
   </div>
 </body>
 

+ 38 - 38
sources/views/settings.html.php

@@ -17,14 +17,14 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 
-<h2><?= T_("VPN Client Configuration") ?></h2>
+<h2><?= _("VPN Client Configuration") ?></h2>
 <?php if($faststatus): ?>
-  <span class="label label-success" data-toggle="tooltip" data-title="<?= T_('This is a fast status. Click on More details to show the complete status.') ?>"><?= T_('Running') ?></span>
+  <span class="label label-success" data-toggle="tooltip" data-title="<?= _('This is a fast status. Click on More details to show the complete status.') ?>"><?= _('Running') ?></span>
 <?php else: ?>
-  <span class="label label-danger" data-toggle="tooltip" data-title="<?= T_('This is a fast status. Click on More details to show the complete status.') ?>"><?= T_('Not Running') ?></span>
+  <span class="label label-danger" data-toggle="tooltip" data-title="<?= _('This is a fast status. Click on More details to show the complete status.') ?>"><?= _('Not Running') ?></span>
 <?php endif; ?>
 
- &nbsp; <img src="public/img/loading.gif" id="status-loading" alt="Loading..." /><a href="#" id="statusbtn" data-toggle="tooltip" data-title="<?= T_('Loading complete status may take a few minutes. Be patient.') ?>"><?= T_('More details') ?></a>
+ &nbsp; <img src="public/img/loading.gif" id="status-loading" alt="Loading..." /><a href="#" id="statusbtn" data-toggle="tooltip" data-title="<?= _('Loading complete status may take a few minutes. Be patient.') ?>"><?= _('More details') ?></a>
 
 <div id="status" class="alert alert-dismissible alert-info fade in" style="margin-top: 10px" role="alert">
   <button type="button" class="close"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
@@ -40,12 +40,12 @@
 
       <div class="panel panel-default">
         <div class="panel-heading">
-          <h3 class="panel-title"><?= T_("Service") ?></h3>
+          <h3 class="panel-title"><?= _("Service") ?></h3>
         </div>
 
         <div style="padding: 14px 14px 0 10px">
           <div class="form-group">
-            <label for="service_enabled" class="col-sm-3 control-label"><?= T_('VPN Enabled') ?></label>
+            <label for="service_enabled" class="col-sm-3 control-label"><?= _('VPN Enabled') ?></label>
             <div class="col-sm-9 input-group-btn">
               <div class="input-group">
                 <input type="checkbox" class="form-control switch" name="service_enabled" id="service_enabled" value="1" <?= $service_enabled == 1 ? 'checked="checked"' : '' ?> />
@@ -57,33 +57,33 @@
 
       <div class="panel panel-default enabled" <?= $service_enabled == 0 ? 'style="display: none"' : '' ?>>
         <div class="panel-heading">
-          <h3 class="panel-title"><?= T_("VPN") ?></h3>
+          <h3 class="panel-title"><?= _("VPN") ?></h3>
         </div>
 
         <div style="padding: 14px 14px 0 10px">
           <div class="form-group">
-            <label for="server_name" class="col-sm-3 control-label"><?= T_('Server Address') ?></label>
+            <label for="server_name" class="col-sm-3 control-label"><?= _('Server Address') ?></label>
             <div class="col-sm-9">
               <input type="text" class="form-control" name="server_name" id="server_name" placeholder="access.ldn-fai.net" value="<?= $server_name ?>" />
             </div>
           </div>
     
           <div class="form-group">
-            <label for="server_port" class="col-sm-3 control-label"><?= T_('Server Port') ?></label>
+            <label for="server_port" class="col-sm-3 control-label"><?= _('Server Port') ?></label>
             <div class="col-sm-9">
-              <input type="text" data-toggle="tooltip" data-title="<?= T_('With restricted access, you should use 443 (TCP) or 53 (UDP)') ?>" class="form-control" name="server_port" id="server_port" placeholder="1194" value="<?= $server_port ?>" />
+              <input type="text" data-toggle="tooltip" data-title="<?= _('With restricted access, you should use 443 (TCP) or 53 (UDP)') ?>" class="form-control" name="server_port" id="server_port" placeholder="1194" value="<?= $server_port ?>" />
             </div>
           </div>
     
           <div class="form-group">
-            <label for="server_proto" class="col-sm-3 control-label"><?= T_('Protocol') ?></label>
+            <label for="server_proto" class="col-sm-3 control-label"><?= _('Protocol') ?></label>
             <div class="btn-group col-sm-9" data-toggle="buttons">
               <label class="btn btn-default <?= $server_proto == 'udp' ? 'active' : '' ?>">
-                <input type="radio" name="server_proto" value="udp" <?= $server_proto == 'udp' ? 'checked="cheked"' : '' ?> /> <?= T_('UDP') ?>
+                <input type="radio" name="server_proto" value="udp" <?= $server_proto == 'udp' ? 'checked="cheked"' : '' ?> /> <?= _('UDP') ?>
               </label>
     
-              <label class="btn btn-default <?= $server_proto == 'tcp' ? 'active' : '' ?>" data-toggle="tooltip" data-title="<?= T_('UDP is more efficient than TCP (but more filtered in case of restrictive access)') ?>">
-                <input type="radio" name="server_proto" value="tcp" <?= $server_proto == 'tcp' ? 'checked="cheked"' : '' ?> /> <?= T_('TCP') ?>
+              <label class="btn btn-default <?= $server_proto == 'tcp' ? 'active' : '' ?>" data-toggle="tooltip" data-title="<?= _('UDP is more efficient than TCP (but more filtered in case of restrictive access)') ?>">
+                <input type="radio" name="server_proto" value="tcp" <?= $server_proto == 'tcp' ? 'checked="cheked"' : '' ?> /> <?= _('TCP') ?>
               </label>
             </div>
           </div>
@@ -91,12 +91,12 @@
           <div class="form-group" id="raw_openvpn_btnpanel">
             <label class="col-sm-3 control-label"></label>
             <div class="col-sm-9">
-              <span class="glyphicon glyphicon-cog"></span> <a href="#" id="raw_openvpn_btn" data-toggle="tooltip" data-title="<?= T_('Edit the raw configuration only if you know what you do!') ?>"><?= T_('Advanced') ?></a>
+              <span class="glyphicon glyphicon-cog"></span> <a href="#" id="raw_openvpn_btn" data-toggle="tooltip" data-title="<?= _('Edit the raw configuration only if you know what you do!') ?>"><?= _('Advanced') ?></a>
             </div>
           </div>
 
           <div class="form-group" id="raw_openvpn_panel">
-            <label for="raw_openvpn" class="col-sm-3 control-label"><?= T_('Advanced') ?></label>
+            <label for="raw_openvpn" class="col-sm-3 control-label"><?= _('Advanced') ?></label>
             <div class="col-sm-9">
               <pre><textarea class="form-control" name="raw_openvpn" id="raw_openvpn"><?= $raw_openvpn ?></textarea></pre>
             </div>
@@ -106,14 +106,14 @@
 
       <div class="panel panel-default enabled" <?= $service_enabled == 0 ? 'style="display: none"' : '' ?>>
         <div class="panel-heading">
-          <h3 class="panel-title"><?= T_("IPv6") ?></h3>
+          <h3 class="panel-title"><?= _("IPv6") ?></h3>
         </div>
 
         <div style="padding: 14px 14px 0 10px">
           <div class="form-group">
-            <label for="ip6_net" class="col-sm-3 control-label"><?= T_('Delegated prefix') ?></label>
+            <label for="ip6_net" class="col-sm-3 control-label"><?= _('Delegated prefix') ?></label>
             <div class="col-sm-9">
-              <input type="text" data-toggle="tooltip" data-title="<?= T_('Leave empty if your Internet Service Provider does not give you a delegated prefix') ?>" class="form-control" name="ip6_net" id="ip6_net" placeholder="2001:db8:42::" value="<?= $ip6_net ?>" />
+              <input type="text" data-toggle="tooltip" data-title="<?= _('Leave empty if your Internet Service Provider does not give you a delegated prefix') ?>" class="form-control" name="ip6_net" id="ip6_net" placeholder="2001:db8:42::" value="<?= $ip6_net ?>" />
             </div>
           </div>
         </div>
@@ -122,39 +122,39 @@
       <?php if(!$crt_client_key_exists && empty($login_user)): ?>
         <div class="alert alert-dismissible alert-warning fade in enabled" <?= $service_enabled == 0 ? 'style="display: none"' : '' ?> style="margin: 2px 0px 17px" role="alert">
           <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-          <strong><?= T_('Notice') ?>:</strong> <?= T_("You need to upload a Client Certificate, or define a Username (or both) for starting your VPN Client.") ?>
+          <strong><?= _('Notice') ?>:</strong> <?= _("You need to upload a Client Certificate, or define a Username (or both) for starting your VPN Client.") ?>
         </div>
       <?php endif; ?>
 
       <div class="panel panel-default enabled" <?= $service_enabled == 0 ? 'style="display: none"' : '' ?>>
         <div class="panel-heading">
-          <h3 class="panel-title"><?= T_("Certificates") ?></h3>
+          <h3 class="panel-title"><?= _("Certificates") ?></h3>
         </div>
 
         <div style="padding: 14px 14px 0 10px">
           <div class="form-group">
-            <label for="crt_client" class="col-sm-3 control-label"><?= $crt_client_exists ? T_('Update Client Cert.') : T_('Upload Client Cert.') ?></label>
+            <label for="crt_client" class="col-sm-3 control-label"><?= $crt_client_exists ? _('Update Client Cert.') : _('Upload Client Cert.') ?></label>
             <div class="input-group col-sm-9" style="padding: 0 15px">
               <?php if($crt_client_exists): ?>
-                <a class="btn btn-danger input-group-addon deletefile" id="crt_client_deletebtn" data-toggle="tooltip" data-title="<?= T_('Delete this certificate') ?>"><span class="glyphicon glyphicon-remove"></span></a>
+                <a class="btn btn-danger input-group-addon deletefile" id="crt_client_deletebtn" data-toggle="tooltip" data-title="<?= _('Delete this certificate') ?>"><span class="glyphicon glyphicon-remove"></span></a>
                 <input id="crt_client_delete" name="crt_client_delete" type="checkbox" value="1" style="display: none" />
               <?php endif; ?>
               <input type="text" class="form-control fileinput" id="crt_client_choosertxt" placeholder="-----BEGIN CERTIFICATE-----" readonly="readonly" />
               <input id="crt_client" name="crt_client" type="file" style="display: none" />
-              <a class="btn input-group-addon fileinput" id="crt_client_chooserbtn" data-toggle="tooltip" data-title="<?= T_('Browse') ?>"><span class="glyphicon glyphicon-search"></span></a>
+              <a class="btn input-group-addon fileinput" id="crt_client_chooserbtn" data-toggle="tooltip" data-title="<?= _('Browse') ?>"><span class="glyphicon glyphicon-search"></span></a>
             </div>
           </div>
 
           <div class="form-group">
-            <label for="crt_client_key" class="col-sm-3 control-label"><?= $crt_client_key_exists ? T_('Update Client Key') : T_('Upload Client Key') ?></label>
+            <label for="crt_client_key" class="col-sm-3 control-label"><?= $crt_client_key_exists ? _('Update Client Key') : _('Upload Client Key') ?></label>
             <div class="input-group col-sm-9" style="padding: 0 15px">
               <?php if($crt_client_key_exists): ?>
-                <a class="btn btn-danger input-group-addon deletefile" id="crt_client_key_deletebtn" data-toggle="tooltip" data-title="<?= T_('Delete this certificate') ?>"><span class="glyphicon glyphicon-remove"></span></a>
+                <a class="btn btn-danger input-group-addon deletefile" id="crt_client_key_deletebtn" data-toggle="tooltip" data-title="<?= _('Delete this certificate') ?>"><span class="glyphicon glyphicon-remove"></span></a>
                 <input id="crt_client_key_delete" name="crt_client_key_delete" type="checkbox" value="1" style="display: none" />
               <?php endif; ?>
-              <input type="text" class="form-control fileinput" id="crt_client_key_choosertxt" data-toggle="tooltip" data-title="<?= T_('Make sure your browser is able to read the key file before uploading') ?>" placeholder="-----BEGIN PRIVATE KEY-----" readonly="readonly" />
+              <input type="text" class="form-control fileinput" id="crt_client_key_choosertxt" data-toggle="tooltip" data-title="<?= _('Make sure your browser is able to read the key file before uploading') ?>" placeholder="-----BEGIN PRIVATE KEY-----" readonly="readonly" />
               <input id="crt_client_key" name="crt_client_key" type="file" style="display: none" />
-              <a class="btn input-group-addon fileinput" id="crt_client_key_chooserbtn" data-toggle="tooltip" data-title="<?= T_('Browse') ?> (<?= T_('make sure your browser is able to read the key file before uploading') ?>)"><span class="glyphicon glyphicon-search"></span></a>
+              <a class="btn input-group-addon fileinput" id="crt_client_key_chooserbtn" data-toggle="tooltip" data-title="<?= _('Browse') ?> (<?= _('make sure your browser is able to read the key file before uploading') ?>)"><span class="glyphicon glyphicon-search"></span></a>
             </div>
           </div>
 
@@ -162,19 +162,19 @@
             <?php if(!$crt_server_ca_exists): ?>
               <div class="alert alert-dismissible alert-warning fade in" style="margin: 2px 16px 17px" role="alert">
                 <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-                <strong><?= T_('Notice') ?>:</strong> <?= T_("You need to upload a Server CA for starting your VPN Client.") ?>
+                <strong><?= _('Notice') ?>:</strong> <?= _("You need to upload a Server CA for starting your VPN Client.") ?>
               </div>
             <?php endif; ?>
 
-            <label for="crt_server_ca" class="col-sm-3 control-label"><?= $crt_server_ca_exists ? T_('Update Server CA') : T_('Upload Server CA') ?></label>
+            <label for="crt_server_ca" class="col-sm-3 control-label"><?= $crt_server_ca_exists ? _('Update Server CA') : _('Upload Server CA') ?></label>
             <div class="input-group col-sm-9" style="padding: 0 15px">
               <?php if($crt_server_ca_exists): ?>
-                <a class="btn btn-danger not-allowed btn-disabled input-group-addon" id="crt_server_ca_deletebtn" data-toggle="tooltip" data-title="<?= T_('You cannot have no server CA') ?>"><span class="glyphicon glyphicon-remove"></span></a>
+                <a class="btn btn-danger not-allowed btn-disabled input-group-addon" id="crt_server_ca_deletebtn" data-toggle="tooltip" data-title="<?= _('You cannot have no server CA') ?>"><span class="glyphicon glyphicon-remove"></span></a>
                 <input id="crt_server_ca_delete" name="crt_server_ca_delete" type="checkbox" value="1" style="display: none" />
               <?php endif; ?>
               <input type="text" class="form-control fileinput" id="crt_server_ca_choosertxt" placeholder="-----BEGIN CERTIFICATE-----" readonly="readonly" />
               <input id="crt_server_ca" name="crt_server_ca" type="file" style="display: none" />
-              <a class="btn input-group-addon fileinput" id="crt_server_ca_chooserbtn" data-toggle="tooltip" data-title="<?= T_('Browse') ?>"><span class="glyphicon glyphicon-search"></span></a>
+              <a class="btn input-group-addon fileinput" id="crt_server_ca_chooserbtn" data-toggle="tooltip" data-title="<?= _('Browse') ?>"><span class="glyphicon glyphicon-search"></span></a>
             </div>
           </div>
         </div>
@@ -182,21 +182,21 @@
 
       <div class="panel panel-default enabled" <?= $service_enabled == 0 ? 'style="display: none"' : '' ?>>
         <div class="panel-heading">
-          <h3 class="panel-title"><?= T_("Login") ?></h3>
+          <h3 class="panel-title"><?= _("Login") ?></h3>
         </div>
 
         <div style="padding: 14px 14px 0 10px">
           <div class="form-group">
-            <label for="login_user" class="col-sm-3 control-label"><?= T_('Username') ?></label>
+            <label for="login_user" class="col-sm-3 control-label"><?= _('Username') ?></label>
             <div class="col-sm-9">
-              <input type="text" data-toggle="tooltip" data-title="<?= T_('Leave empty if not necessary') ?>" class="form-control" name="login_user" id="login_user" placeholder="michu" value="<?= $login_user ?>" />
+              <input type="text" data-toggle="tooltip" data-title="<?= _('Leave empty if not necessary') ?>" class="form-control" name="login_user" id="login_user" placeholder="michu" value="<?= $login_user ?>" />
             </div>
           </div>
 
           <div class="form-group">
-            <label for="login_passphrase" class="col-sm-3 control-label"><?= T_('Password') ?></label>
+            <label for="login_passphrase" class="col-sm-3 control-label"><?= _('Password') ?></label>
             <div class="col-sm-9">
-              <input type="text" data-toggle="tooltip" data-title="<?= T_('Leave empty if not necessary') ?>" class="form-control" name="login_passphrase" id="login_passphrase" placeholder="XVCwSbDkxnqQ" value="<?= $login_passphrase ?>" />
+              <input type="text" data-toggle="tooltip" data-title="<?= _('Leave empty if not necessary') ?>" class="form-control" name="login_passphrase" id="login_passphrase" placeholder="XVCwSbDkxnqQ" value="<?= $login_passphrase ?>" />
             </div>
           </div>
         </div>
@@ -204,7 +204,7 @@
 
       <div class="form-group">
         <div style="text-align: center">
-          <button type="submit" class="btn btn-default" data-toggle="tooltip" id="save" data-title="<?= T_('Reloading may take a few minutes. Be patient.') ?>"><?= T_('Save and reload') ?></button> <img src="public/img/loading.gif" id="save-loading" alt="Loading..." />
+          <button type="submit" class="btn btn-default" data-toggle="tooltip" id="save" data-title="<?= _('Reloading may take a few minutes. Be patient.') ?>"><?= _('Save and reload') ?></button> <img src="public/img/loading.gif" id="save-loading" alt="Loading..." />
         </div>
       </div>
     </form>