From 2fa2bb665d8ca5e837147f85267f865f1b8b0503 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 10 May 2016 16:57:06 +0200 Subject: Translating module strings and custom sections works --- modules-available/backup/lang/de/messages.json | 3 + modules-available/backup/lang/de/module.json | 2 +- .../baseconfig/hooks/translation.inc.php | 10 +- .../baseconfig/lang/de/cat_setting.json | 9 - .../lang/de/config-variable-categories.json | 9 + .../baseconfig/lang/de/config-variables.json | 23 + modules-available/baseconfig/lang/de/module.json | 3 + modules-available/baseconfig/lang/de/setting.json | 23 - .../baseconfig/lang/en/cat_setting.json | 9 - .../lang/en/config-variable-categories.json | 9 + .../baseconfig/lang/en/config-variables.json | 23 + modules-available/baseconfig/lang/en/setting.json | 23 - .../lang/pt/config-variable-categories.json | 7 + .../baseconfig/lang/pt/config-variables.json | 16 + modules-available/baseconfig/page.inc.php | 4 +- modules-available/baseconfig/templates/_page.html | 7 +- modules-available/dozmod/lang/de/module.json | 4 + modules-available/eventlog/lang/de/module.json | 3 + modules-available/eventlog/lang/en/module.json | 2 +- modules-available/locations/lang/de/module.json | 4 + modules-available/main/hooks/translation.inc.php | 30 ++ modules-available/main/lang/de/categories.json | 6 + modules-available/main/lang/de/template-tags.json | 17 +- modules-available/main/lang/en/template-tags.json | 19 +- modules-available/main/lang/pt/categories.json | 6 + modules-available/main/page.inc.php | 2 - modules-available/main/templates/page-login.html | 11 - .../main/templates/page-minilinux.html | 14 - modules-available/main/templates/page-news.html | 57 --- modules-available/main/templates/page-syslog.html | 58 --- modules-available/main/templates/page-vmstore.html | 111 ----- modules-available/minilinux/lang/de/module.json | 4 + modules-available/news/lang/de/module.json | 3 + modules-available/serversetup/lang/de/module.json | 4 + modules-available/support/lang/de/module.json | 3 + modules-available/sysconfig/lang/de/module.json | 4 + modules-available/sysconfig/lang/en/module.json | 3 +- modules-available/syslog/lang/en/module.json | 3 +- modules-available/systemstatus/lang/de/module.json | 3 + modules-available/systemstatus/lang/en/module.json | 2 +- .../translation/lang/de/messages.json | 3 + modules-available/translation/lang/de/module.json | 3 + .../translation/lang/de/template-tags.json | 9 +- .../translation/lang/en/template-tags.json | 7 +- modules-available/translation/page.inc.php | 471 +++++++++++---------- modules-available/translation/templates/_page.html | 18 - .../translation/templates/custom-list.html | 21 + .../translation/templates/module-list.html | 10 +- .../translation/templates/string-list.html | 21 + modules-available/vmstore/lang/de/module.json | 4 + modules-available/vmstore/lang/en/module.json | 3 +- modules-available/webinterface/lang/de/module.json | 4 + 52 files changed, 516 insertions(+), 611 deletions(-) create mode 100644 modules-available/backup/lang/de/messages.json delete mode 100644 modules-available/baseconfig/lang/de/cat_setting.json create mode 100644 modules-available/baseconfig/lang/de/config-variable-categories.json create mode 100644 modules-available/baseconfig/lang/de/config-variables.json create mode 100644 modules-available/baseconfig/lang/de/module.json delete mode 100644 modules-available/baseconfig/lang/de/setting.json delete mode 100644 modules-available/baseconfig/lang/en/cat_setting.json create mode 100644 modules-available/baseconfig/lang/en/config-variable-categories.json create mode 100644 modules-available/baseconfig/lang/en/config-variables.json delete mode 100644 modules-available/baseconfig/lang/en/setting.json create mode 100644 modules-available/baseconfig/lang/pt/config-variable-categories.json create mode 100644 modules-available/baseconfig/lang/pt/config-variables.json create mode 100644 modules-available/dozmod/lang/de/module.json create mode 100644 modules-available/eventlog/lang/de/module.json create mode 100644 modules-available/locations/lang/de/module.json create mode 100644 modules-available/main/hooks/translation.inc.php create mode 100644 modules-available/main/lang/de/categories.json create mode 100644 modules-available/main/lang/pt/categories.json delete mode 100644 modules-available/main/templates/page-login.html delete mode 100644 modules-available/main/templates/page-minilinux.html delete mode 100644 modules-available/main/templates/page-news.html delete mode 100644 modules-available/main/templates/page-syslog.html delete mode 100644 modules-available/main/templates/page-vmstore.html create mode 100644 modules-available/minilinux/lang/de/module.json create mode 100644 modules-available/news/lang/de/module.json create mode 100644 modules-available/serversetup/lang/de/module.json create mode 100644 modules-available/support/lang/de/module.json create mode 100644 modules-available/sysconfig/lang/de/module.json create mode 100644 modules-available/systemstatus/lang/de/module.json create mode 100644 modules-available/translation/lang/de/messages.json create mode 100644 modules-available/translation/lang/de/module.json delete mode 100644 modules-available/translation/templates/_page.html create mode 100644 modules-available/translation/templates/custom-list.html create mode 100644 modules-available/translation/templates/string-list.html create mode 100644 modules-available/vmstore/lang/de/module.json create mode 100644 modules-available/webinterface/lang/de/module.json (limited to 'modules-available') diff --git a/modules-available/backup/lang/de/messages.json b/modules-available/backup/lang/de/messages.json new file mode 100644 index 00000000..a1237539 --- /dev/null +++ b/modules-available/backup/lang/de/messages.json @@ -0,0 +1,3 @@ +{ + "backup-failed": "Erstellen des Backups fehlgeschlagen" +} \ No newline at end of file diff --git a/modules-available/backup/lang/de/module.json b/modules-available/backup/lang/de/module.json index a08ad617..8b32a289 100644 --- a/modules-available/backup/lang/de/module.json +++ b/modules-available/backup/lang/de/module.json @@ -1,4 +1,4 @@ { "module_name": "Sichern\/Wiederherstellen", - "page_title": "Sichern und wiederherstellen" + "page_title": "Sichern und Wiederherstellen" } \ No newline at end of file diff --git a/modules-available/baseconfig/hooks/translation.inc.php b/modules-available/baseconfig/hooks/translation.inc.php index 84a6d33a..4f2cd8f7 100644 --- a/modules-available/baseconfig/hooks/translation.inc.php +++ b/modules-available/baseconfig/hooks/translation.inc.php @@ -6,7 +6,7 @@ $HANDLER = array(); * List of valid subsections */ $HANDLER['subsections'] = array( - 'categories', 'settings' + 'config-variable-categories', 'config-variables' ); /* @@ -17,11 +17,11 @@ $HANDLER['subsections'] = array( /** * Configuration categories */ -$HANDLER['grep']['categories'] = function($module) { +$HANDLER['grep_config-variable-categories'] = function($module) { $want = array(); $res = Database::simpleQuery("SELECT catid FROM cat_setting ORDER BY catid ASC"); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $want[] = 'cat_' . $row['catid']; + $want['cat_' . $row['catid']] = true; } return $want; }; @@ -29,11 +29,11 @@ $HANDLER['grep']['categories'] = function($module) { /** * Configuration variables */ -$HANDLER['grep']['settings'] = function($module) { +$HANDLER['grep_config-variables'] = function($module) { $want = array(); $res = Database::simpleQuery("SELECT setting FROM setting ORDER BY setting ASC"); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $want[] = $row['setting']; + $want[$row['setting']] = true; } return $want; }; diff --git a/modules-available/baseconfig/lang/de/cat_setting.json b/modules-available/baseconfig/lang/de/cat_setting.json deleted file mode 100644 index b8cb6935..00000000 --- a/modules-available/baseconfig/lang/de/cat_setting.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "cat_1": "Inaktivit\u00e4t und Abschaltung", - "cat_2": "Internetzugriff", - "cat_3": "Zeitsynchronisation", - "cat_4": "Grundsystem", - "cat_5": "Gemeinsames Netzlaufwerk", - "cat_6": "Unkategorisiert", - "cat_7": "vmchooser" -} \ No newline at end of file diff --git a/modules-available/baseconfig/lang/de/config-variable-categories.json b/modules-available/baseconfig/lang/de/config-variable-categories.json new file mode 100644 index 00000000..b8cb6935 --- /dev/null +++ b/modules-available/baseconfig/lang/de/config-variable-categories.json @@ -0,0 +1,9 @@ +{ + "cat_1": "Inaktivit\u00e4t und Abschaltung", + "cat_2": "Internetzugriff", + "cat_3": "Zeitsynchronisation", + "cat_4": "Grundsystem", + "cat_5": "Gemeinsames Netzlaufwerk", + "cat_6": "Unkategorisiert", + "cat_7": "vmchooser" +} \ No newline at end of file diff --git a/modules-available/baseconfig/lang/de/config-variables.json b/modules-available/baseconfig/lang/de/config-variables.json new file mode 100644 index 00000000..af1007be --- /dev/null +++ b/modules-available/baseconfig/lang/de/config-variables.json @@ -0,0 +1,23 @@ +{ + "SLX_ADDONS": "Zu ladende Addons. Zur Zeit steht nur *vmware* zur Verf\u00fcgung.", + "SLX_BENCHMARK_VM": "Tragen Sie hier den exakten Namen einer Veranstaltung, wie sie im *vmchooser* auftaucht ein, um diese VM nach dem Booten automatisch zu starten. Dies ist n\u00fctzlich f\u00fcr Bootzeitmessungen. Feld leer lassen, um Funktion zu deaktivieren.", + "SLX_BIOS_CLOCK": "Legt fest, ob und wie die interne Uhr des Rechners im Bezug auf die Systemzeit des \/MiniLinux\/ gesetzt werden soll.\r\n*off* = Die interne Uhr des Rechners wird nicht ver\u00e4ndert.\r\n*local* = Die interne Uhr wird auf die Lokalzeit gesetzt. Bevorzugt wenn z.B. noch eine native Windows-Installation auf dem PC vorhanden ist.\r\n*utc* = Die interne Uhr wird auf die \/Koordinierte Weltzeit\/ gesetzt. Dies ist die g\u00e4ngige Einstellung in einem reinen Linux-Umfeld.", + "SLX_COMMON_SHARE_AUTH": "Authentifizierungsmethode f\u00fcr das gemeinsame Netzlaufwerk. *guest* bedeutet, dass keine Authentifizierung notwendig ist, *user* bedeutet, dass die Credentials des angemeldeten Benutzers verwendet werden.", + "SLX_COMMON_SHARE_PATH": "Netzwerkpfad des gemeinsamen Netzlaufwerks. Es werden NFS (keine Authentifizierung) und CIFS\/SMB (mit und ohne Authentifizierung) unterst\u00fctzt.", + "SLX_DEMO_PASS": "Passwort f\u00fcr den eingebauten *demo*-Account. Leer lassen, um das Einloggen zu verbieten.\r\nDas Passwort wird wie das root-Passwort nur gehasht an den Client \u00fcbertragen.", + "SLX_LOGOUT_TIMEOUT": "Zeit \/in Sekunden\/, die eine Benutzersitzung ohne Aktion sein darf, bevor sie beendet wird.Feld leer lassen, um die Funktion zu deaktivieren.", + "SLX_NET_DOMAIN": "DNS-Dom\u00e4ne, in die sich die Clients eingliedern, sofern der DHCP Server keine solche vorgibt.", + "SLX_NTP_SERVER": "Adresse des NTP-Zeitservers. Es k\u00f6nnen mehrere Server mit Leerzeichen getrennt angegeben werden.Die Server werden der Reihe nach angefragt, bis ein antwortender Server gefunden wird.", + "SLX_PROXY_BLACKLIST": "Adressen bzw. Adressbereiche, f\u00fcr die der Proxyserver nicht verwendet werden soll (z.B. der Adressbereich der Einrichtung). G\u00fcltige Angaben sind einzelne IP-Adressen, sowie IP-Bereiche in CIDR-Notation (z.B. 1.2.0.0\/16). Mehrere Angaben k\u00f6nnen durch Leerzeichen getrennt werden.", + "SLX_PROXY_IP": "Die Adresse des zu verwendenden Proxy Servers.", + "SLX_PROXY_MODE": "Legt fest, ob zum Zugriff aufs Internet ein Proxy-Server ben\u00f6tigt wird.\r\n*off* = keinen Proxy benutzen.\r\n*on* = Proxy immer benutzen.\r\n*auto* = Proxy nur benutzen, wenn sich der Client-PC in einem privaten Adressbereich befindet.", + "SLX_PROXY_PORT": "Der Port des zu verwendenden Proxy Servers.", + "SLX_PROXY_TYPE": "Art des Proxys: *socks4*, *socks5*, *http-connect* (HTTP Proxy mit Unterst\u00fctzung der CONNECT-Methode), *http-relay* (Klassischer HTTP Proxy)", + "SLX_REMOTE_LOG_SESSIONS": "Legt fest, ob Logins und Logouts der Benutzer an den Satelliten gemeldet werden sollen.\r\n*yes* = Mit Benutzerkennung loggen\r\n*anonymous* = Anonym loggen\r\n*no* = Nicht loggen", + "SLX_ROOT_PASS": "Das root-Passwort des Grundsystems. Wird nur f\u00fcr Diagnosezwecke am Client ben\u00f6tigt.\r\nFeld leer lassen, um root-Logins zu verbieten.\r\n\/Hinweis\/: Das Passwort wird im Klartext in der lokalen Datenbank hinterlegt, jedoch immer gehasht an die Clients \u00fcbermittelt (SHA-512 mit Salt). Wenn Sie das Passwort auch im Satelliten nicht im Klartext speichern wollen, k\u00f6nnen Sie hier auch ein vorgehashtes Passwort eintragen (im *$6$....*-Format).", + "SLX_SHUTDOWN_SCHEDULE": "Feste Uhrzeit, zu der sich die Rechner ausschalten, auch wenn noch ein Benutzer aktiv ist.Mehrere Zeitpunkte k\u00f6nnen durch Leerzeichen getrennt angegeben werden.", + "SLX_SHUTDOWN_TIMEOUT": "Zeit in Sekunden, nach dem ein Rechner abgeschaltet wird, sofern kein Benutzer angemeldet ist.Feld leer lassen, um die Funktion zu deaktivieren.", + "SLX_VMCHOOSER_FORLOCATION": "Legt das Verhalten fest, wenn es Veranstaltungen gibt, die an einen bestimmten Ort\/Raum gebunden sind.\r\n*IGNORE*: Mit den restlichen, globalen Veranstaltungen alphabetisch sortiert auflisten.\r\n*BUMP*: Die spezifischen Veranstaltungen oben auflisten, die globalen darunter.\r\n*EXCLUSIVE*: Spezifische Veranstaltungen oben auflisten, globale Veranstaltungen zun\u00e4chst ausblenden. Die globalen Veranstaltungen befinden sich unter einem eingeklappten Listenknoten.", + "SLX_VMCHOOSER_TAB": "Bestimmt, welcher Karteireiter im vmchooser standardm\u00e4\u00dfig ausgew\u00e4hlt wird.\r\n*0*: Native Linux-Sessions\r\n*1*: Nutzerspezifische Kurse\r\n*2*: Alle Kurse\r\n*AUTO*: Hat der Rechner beschr\u00e4nkte Ressourcen, werden die Linux-Sitzungen angezeigt, sonst alle Kurse\r\n\r\nHat der Benutzer ein persistentes Home-Verzeichnis, wirkt sich diese Einstellung nur beim ersten Anmelden aus. Bei sp\u00e4teren Sitzungen markiert der vmchooser die zuletzt gestartete Sitzung und wechselt zum entsprechenden Karteireiter.", + "SLX_VMCHOOSER_TEMPLATES": "Legt fest, wie Veranstaltungen in der Sortierung behandelt werden, welche auf eine VM linken, die eine Vorlage ist.\r\n*IGNORE*: Wie regul\u00e4re Veranstaltungen behandeln\r\n*BUMP*: Weiter oben in der Liste einsortieren" +} \ No newline at end of file diff --git a/modules-available/baseconfig/lang/de/module.json b/modules-available/baseconfig/lang/de/module.json new file mode 100644 index 00000000..461bebdb --- /dev/null +++ b/modules-available/baseconfig/lang/de/module.json @@ -0,0 +1,3 @@ +{ + "module_name": "KonfigurationsVariablen" +} \ No newline at end of file diff --git a/modules-available/baseconfig/lang/de/setting.json b/modules-available/baseconfig/lang/de/setting.json deleted file mode 100644 index af1007be..00000000 --- a/modules-available/baseconfig/lang/de/setting.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "SLX_ADDONS": "Zu ladende Addons. Zur Zeit steht nur *vmware* zur Verf\u00fcgung.", - "SLX_BENCHMARK_VM": "Tragen Sie hier den exakten Namen einer Veranstaltung, wie sie im *vmchooser* auftaucht ein, um diese VM nach dem Booten automatisch zu starten. Dies ist n\u00fctzlich f\u00fcr Bootzeitmessungen. Feld leer lassen, um Funktion zu deaktivieren.", - "SLX_BIOS_CLOCK": "Legt fest, ob und wie die interne Uhr des Rechners im Bezug auf die Systemzeit des \/MiniLinux\/ gesetzt werden soll.\r\n*off* = Die interne Uhr des Rechners wird nicht ver\u00e4ndert.\r\n*local* = Die interne Uhr wird auf die Lokalzeit gesetzt. Bevorzugt wenn z.B. noch eine native Windows-Installation auf dem PC vorhanden ist.\r\n*utc* = Die interne Uhr wird auf die \/Koordinierte Weltzeit\/ gesetzt. Dies ist die g\u00e4ngige Einstellung in einem reinen Linux-Umfeld.", - "SLX_COMMON_SHARE_AUTH": "Authentifizierungsmethode f\u00fcr das gemeinsame Netzlaufwerk. *guest* bedeutet, dass keine Authentifizierung notwendig ist, *user* bedeutet, dass die Credentials des angemeldeten Benutzers verwendet werden.", - "SLX_COMMON_SHARE_PATH": "Netzwerkpfad des gemeinsamen Netzlaufwerks. Es werden NFS (keine Authentifizierung) und CIFS\/SMB (mit und ohne Authentifizierung) unterst\u00fctzt.", - "SLX_DEMO_PASS": "Passwort f\u00fcr den eingebauten *demo*-Account. Leer lassen, um das Einloggen zu verbieten.\r\nDas Passwort wird wie das root-Passwort nur gehasht an den Client \u00fcbertragen.", - "SLX_LOGOUT_TIMEOUT": "Zeit \/in Sekunden\/, die eine Benutzersitzung ohne Aktion sein darf, bevor sie beendet wird.Feld leer lassen, um die Funktion zu deaktivieren.", - "SLX_NET_DOMAIN": "DNS-Dom\u00e4ne, in die sich die Clients eingliedern, sofern der DHCP Server keine solche vorgibt.", - "SLX_NTP_SERVER": "Adresse des NTP-Zeitservers. Es k\u00f6nnen mehrere Server mit Leerzeichen getrennt angegeben werden.Die Server werden der Reihe nach angefragt, bis ein antwortender Server gefunden wird.", - "SLX_PROXY_BLACKLIST": "Adressen bzw. Adressbereiche, f\u00fcr die der Proxyserver nicht verwendet werden soll (z.B. der Adressbereich der Einrichtung). G\u00fcltige Angaben sind einzelne IP-Adressen, sowie IP-Bereiche in CIDR-Notation (z.B. 1.2.0.0\/16). Mehrere Angaben k\u00f6nnen durch Leerzeichen getrennt werden.", - "SLX_PROXY_IP": "Die Adresse des zu verwendenden Proxy Servers.", - "SLX_PROXY_MODE": "Legt fest, ob zum Zugriff aufs Internet ein Proxy-Server ben\u00f6tigt wird.\r\n*off* = keinen Proxy benutzen.\r\n*on* = Proxy immer benutzen.\r\n*auto* = Proxy nur benutzen, wenn sich der Client-PC in einem privaten Adressbereich befindet.", - "SLX_PROXY_PORT": "Der Port des zu verwendenden Proxy Servers.", - "SLX_PROXY_TYPE": "Art des Proxys: *socks4*, *socks5*, *http-connect* (HTTP Proxy mit Unterst\u00fctzung der CONNECT-Methode), *http-relay* (Klassischer HTTP Proxy)", - "SLX_REMOTE_LOG_SESSIONS": "Legt fest, ob Logins und Logouts der Benutzer an den Satelliten gemeldet werden sollen.\r\n*yes* = Mit Benutzerkennung loggen\r\n*anonymous* = Anonym loggen\r\n*no* = Nicht loggen", - "SLX_ROOT_PASS": "Das root-Passwort des Grundsystems. Wird nur f\u00fcr Diagnosezwecke am Client ben\u00f6tigt.\r\nFeld leer lassen, um root-Logins zu verbieten.\r\n\/Hinweis\/: Das Passwort wird im Klartext in der lokalen Datenbank hinterlegt, jedoch immer gehasht an die Clients \u00fcbermittelt (SHA-512 mit Salt). Wenn Sie das Passwort auch im Satelliten nicht im Klartext speichern wollen, k\u00f6nnen Sie hier auch ein vorgehashtes Passwort eintragen (im *$6$....*-Format).", - "SLX_SHUTDOWN_SCHEDULE": "Feste Uhrzeit, zu der sich die Rechner ausschalten, auch wenn noch ein Benutzer aktiv ist.Mehrere Zeitpunkte k\u00f6nnen durch Leerzeichen getrennt angegeben werden.", - "SLX_SHUTDOWN_TIMEOUT": "Zeit in Sekunden, nach dem ein Rechner abgeschaltet wird, sofern kein Benutzer angemeldet ist.Feld leer lassen, um die Funktion zu deaktivieren.", - "SLX_VMCHOOSER_FORLOCATION": "Legt das Verhalten fest, wenn es Veranstaltungen gibt, die an einen bestimmten Ort\/Raum gebunden sind.\r\n*IGNORE*: Mit den restlichen, globalen Veranstaltungen alphabetisch sortiert auflisten.\r\n*BUMP*: Die spezifischen Veranstaltungen oben auflisten, die globalen darunter.\r\n*EXCLUSIVE*: Spezifische Veranstaltungen oben auflisten, globale Veranstaltungen zun\u00e4chst ausblenden. Die globalen Veranstaltungen befinden sich unter einem eingeklappten Listenknoten.", - "SLX_VMCHOOSER_TAB": "Bestimmt, welcher Karteireiter im vmchooser standardm\u00e4\u00dfig ausgew\u00e4hlt wird.\r\n*0*: Native Linux-Sessions\r\n*1*: Nutzerspezifische Kurse\r\n*2*: Alle Kurse\r\n*AUTO*: Hat der Rechner beschr\u00e4nkte Ressourcen, werden die Linux-Sitzungen angezeigt, sonst alle Kurse\r\n\r\nHat der Benutzer ein persistentes Home-Verzeichnis, wirkt sich diese Einstellung nur beim ersten Anmelden aus. Bei sp\u00e4teren Sitzungen markiert der vmchooser die zuletzt gestartete Sitzung und wechselt zum entsprechenden Karteireiter.", - "SLX_VMCHOOSER_TEMPLATES": "Legt fest, wie Veranstaltungen in der Sortierung behandelt werden, welche auf eine VM linken, die eine Vorlage ist.\r\n*IGNORE*: Wie regul\u00e4re Veranstaltungen behandeln\r\n*BUMP*: Weiter oben in der Liste einsortieren" -} \ No newline at end of file diff --git a/modules-available/baseconfig/lang/en/cat_setting.json b/modules-available/baseconfig/lang/en/cat_setting.json deleted file mode 100644 index 7c0ab654..00000000 --- a/modules-available/baseconfig/lang/en/cat_setting.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "cat_1": "Inactivity and Shutdown", - "cat_2": "Internet Access", - "cat_3": "Time Synchronization", - "cat_4": "Basic System", - "cat_5": "Common network share", - "cat_6": "Uncategorized", - "cat_7": "vmchooser" -} \ No newline at end of file diff --git a/modules-available/baseconfig/lang/en/config-variable-categories.json b/modules-available/baseconfig/lang/en/config-variable-categories.json new file mode 100644 index 00000000..7c0ab654 --- /dev/null +++ b/modules-available/baseconfig/lang/en/config-variable-categories.json @@ -0,0 +1,9 @@ +{ + "cat_1": "Inactivity and Shutdown", + "cat_2": "Internet Access", + "cat_3": "Time Synchronization", + "cat_4": "Basic System", + "cat_5": "Common network share", + "cat_6": "Uncategorized", + "cat_7": "vmchooser" +} \ No newline at end of file diff --git a/modules-available/baseconfig/lang/en/config-variables.json b/modules-available/baseconfig/lang/en/config-variables.json new file mode 100644 index 00000000..36ac6e8c --- /dev/null +++ b/modules-available/baseconfig/lang/en/config-variables.json @@ -0,0 +1,23 @@ +{ + "SLX_ADDONS": "Addons to load. Currently, only *vmware* is available.", + "SLX_BENCHMARK_VM": "If non-empty, this should be the exact display name of an entry in *vmchooser*, so it will be automatically started after bootup. Useful for benchmarking.", + "SLX_BIOS_CLOCK": "Specifies whether and how the internal clock of the computer should be set in relation to the system time of the \/MiniLinux\/.\r\n*off* = The internal clock of the computer is not changed.\r\n*local* = The internal clock is set to local time. Preferably if, for example, there is still a native Windows installation available on the PC.\r\n*utc* = The internal clock is set to the \/Coordinated Universal Time\/. This is the most common setup in a pure Linux environment.", + "SLX_COMMON_SHARE_AUTH": "Athentication method for the common network share. *guest* means no authentication (public share), *user* means the user's credentials will be used.", + "SLX_COMMON_SHARE_PATH": "Path of network share. Supported are NFS (no authentication only) and CIFS\/SMB (with and without authentication).", + "SLX_DEMO_PASS": "Password for the *demo* account. Leave empty to disallow logging in as the demo user.\r\nLike the root password, the demo user's password will be sent to the client in its hashed form.", + "SLX_LOGOUT_TIMEOUT": "Time \/in seconds\/, in which a user session may remain without action before it is terminated.Leave field blank to disable the function.", + "SLX_NET_DOMAIN": "DNS domain in which the client integrate, provided the DHCP server does not specifies such.", + "SLX_NTP_SERVER": "Address of the NTP time server. Multiple servers can be specified separated by spaces.The servers are queried in sequence until a responding server is found.", + "SLX_PROXY_BLACKLIST": "Address or addresses ranges in which the proxy server is not used (for example the address range of the device). Valid entries are individual IP addresses and IP ranges in CIDR notation (for example 1.2.0.0\/16). Multiple selections can be separated by spaces.", + "SLX_PROXY_IP": "The address to use for the proxy server.", + "SLX_PROXY_MODE": "Determines whether a proxy server is required to access the Internet.\r\n*off* = do not use a Proxy.\r\n*on* = Always use proxy.\r\n*auto* = Only use proxy when the client PC is in a private address space.", + "SLX_PROXY_PORT": "The port to use for the proxy server.", + "SLX_PROXY_TYPE": "Type of the proxy.*socks4*, *socks5*, *http-connect* (HTTP proxy with support from the CONNECT method), *http-relay* (Classic HTTP proxy)", + "SLX_REMOTE_LOG_SESSIONS": "Determines whether logins and logouts of the users should be reported to the satellite.\r\n*yes* = log with user ID\r\n*anonymous* = anonymous logging\r\n*no* = no logging", + "SLX_ROOT_PASS": "The root password of the client system. Only required for diagnostic purposes on the client.Leave field blank to disallow root logins.\r\n\/Hint\/: The password SHA-512-with-salt hashed before it's being sent to the client. It's only stored in clear text on the Satellite Server. If you want to have it hashed on the server too, you can supply a pre-hashed passoword in \/$6$...$...\/-format.", + "SLX_SHUTDOWN_SCHEDULE": "Fixed time to turn off the computer, even if there is a user active.Several times can be specified, separated by spaces.", + "SLX_SHUTDOWN_TIMEOUT": "Time in seconds after which a computer is switched off, if no user is logged on.Leave blank to disable the function.", + "SLX_VMCHOOSER_FORLOCATION": "Defines how lectures special to the user's location are handled in the vmchooser.\r\n*IGNORE*: Sort them alphabetically among the global lectures.\r\n*BUMP*: Put them atop the global lectures.\r\n*EXCLUSIVE*: Put them atop the global lectures and aditionally collapse the node which contains the global lectures.", + "SLX_VMCHOOSER_TAB": "Defines which tab is show by default, if the user doesn't have stored a last used session on his persistent home directory.\r\n*0*: Native Linux sessions\r\n*1*: User specific lectures\r\n*2*: All lectures\r\n*AUTO*: If the computer has low system specs, show the Linux sessions, otherwise, show all lectures", + "SLX_VMCHOOSER_TEMPLATES": "Defines how lectures that link to template VMs are treated wrt sorting.\r\n*IGNORE*: Sort among regular lectures\r\n*BUMP*: Move to top of list" +} \ No newline at end of file diff --git a/modules-available/baseconfig/lang/en/setting.json b/modules-available/baseconfig/lang/en/setting.json deleted file mode 100644 index 36ac6e8c..00000000 --- a/modules-available/baseconfig/lang/en/setting.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "SLX_ADDONS": "Addons to load. Currently, only *vmware* is available.", - "SLX_BENCHMARK_VM": "If non-empty, this should be the exact display name of an entry in *vmchooser*, so it will be automatically started after bootup. Useful for benchmarking.", - "SLX_BIOS_CLOCK": "Specifies whether and how the internal clock of the computer should be set in relation to the system time of the \/MiniLinux\/.\r\n*off* = The internal clock of the computer is not changed.\r\n*local* = The internal clock is set to local time. Preferably if, for example, there is still a native Windows installation available on the PC.\r\n*utc* = The internal clock is set to the \/Coordinated Universal Time\/. This is the most common setup in a pure Linux environment.", - "SLX_COMMON_SHARE_AUTH": "Athentication method for the common network share. *guest* means no authentication (public share), *user* means the user's credentials will be used.", - "SLX_COMMON_SHARE_PATH": "Path of network share. Supported are NFS (no authentication only) and CIFS\/SMB (with and without authentication).", - "SLX_DEMO_PASS": "Password for the *demo* account. Leave empty to disallow logging in as the demo user.\r\nLike the root password, the demo user's password will be sent to the client in its hashed form.", - "SLX_LOGOUT_TIMEOUT": "Time \/in seconds\/, in which a user session may remain without action before it is terminated.Leave field blank to disable the function.", - "SLX_NET_DOMAIN": "DNS domain in which the client integrate, provided the DHCP server does not specifies such.", - "SLX_NTP_SERVER": "Address of the NTP time server. Multiple servers can be specified separated by spaces.The servers are queried in sequence until a responding server is found.", - "SLX_PROXY_BLACKLIST": "Address or addresses ranges in which the proxy server is not used (for example the address range of the device). Valid entries are individual IP addresses and IP ranges in CIDR notation (for example 1.2.0.0\/16). Multiple selections can be separated by spaces.", - "SLX_PROXY_IP": "The address to use for the proxy server.", - "SLX_PROXY_MODE": "Determines whether a proxy server is required to access the Internet.\r\n*off* = do not use a Proxy.\r\n*on* = Always use proxy.\r\n*auto* = Only use proxy when the client PC is in a private address space.", - "SLX_PROXY_PORT": "The port to use for the proxy server.", - "SLX_PROXY_TYPE": "Type of the proxy.*socks4*, *socks5*, *http-connect* (HTTP proxy with support from the CONNECT method), *http-relay* (Classic HTTP proxy)", - "SLX_REMOTE_LOG_SESSIONS": "Determines whether logins and logouts of the users should be reported to the satellite.\r\n*yes* = log with user ID\r\n*anonymous* = anonymous logging\r\n*no* = no logging", - "SLX_ROOT_PASS": "The root password of the client system. Only required for diagnostic purposes on the client.Leave field blank to disallow root logins.\r\n\/Hint\/: The password SHA-512-with-salt hashed before it's being sent to the client. It's only stored in clear text on the Satellite Server. If you want to have it hashed on the server too, you can supply a pre-hashed passoword in \/$6$...$...\/-format.", - "SLX_SHUTDOWN_SCHEDULE": "Fixed time to turn off the computer, even if there is a user active.Several times can be specified, separated by spaces.", - "SLX_SHUTDOWN_TIMEOUT": "Time in seconds after which a computer is switched off, if no user is logged on.Leave blank to disable the function.", - "SLX_VMCHOOSER_FORLOCATION": "Defines how lectures special to the user's location are handled in the vmchooser.\r\n*IGNORE*: Sort them alphabetically among the global lectures.\r\n*BUMP*: Put them atop the global lectures.\r\n*EXCLUSIVE*: Put them atop the global lectures and aditionally collapse the node which contains the global lectures.", - "SLX_VMCHOOSER_TAB": "Defines which tab is show by default, if the user doesn't have stored a last used session on his persistent home directory.\r\n*0*: Native Linux sessions\r\n*1*: User specific lectures\r\n*2*: All lectures\r\n*AUTO*: If the computer has low system specs, show the Linux sessions, otherwise, show all lectures", - "SLX_VMCHOOSER_TEMPLATES": "Defines how lectures that link to template VMs are treated wrt sorting.\r\n*IGNORE*: Sort among regular lectures\r\n*BUMP*: Move to top of list" -} \ No newline at end of file diff --git a/modules-available/baseconfig/lang/pt/config-variable-categories.json b/modules-available/baseconfig/lang/pt/config-variable-categories.json new file mode 100644 index 00000000..b04839e8 --- /dev/null +++ b/modules-available/baseconfig/lang/pt/config-variable-categories.json @@ -0,0 +1,7 @@ +{ + "cat_1": "Inatividade e Desligamento", + "cat_2": "Acesso \u00e0 Internet", + "cat_3": "Sincroniza\u00e7\u00e3o de Tempo", + "cat_4": "Sistema B\u00e1sico", + "cat_7": "vmchooser" +} \ No newline at end of file diff --git a/modules-available/baseconfig/lang/pt/config-variables.json b/modules-available/baseconfig/lang/pt/config-variables.json new file mode 100644 index 00000000..66ec3b1c --- /dev/null +++ b/modules-available/baseconfig/lang/pt/config-variables.json @@ -0,0 +1,16 @@ +{ + "SLX_ADDONS": "Para carregar addons. Atualmente apenas o vmware est\u00e1 dispon\u00edvel.", + "SLX_BIOS_CLOCK": "Especifica se e como o rel\u00f3gio interno do computador deve ser definido em rela\u00e7\u00e3o ao hor\u00e1rio do sistema do \/MiniLinux\/.*off* = O rel\u00f3gio interno do computador n\u00e3o \u00e9 alterado.*local* = O rel\u00f3gio interno est\u00e1 definido para a hora local. De prefer\u00eancia se, por exemplo, ainda existe uma instala\u00e7\u00e3o Windows nativo dispon\u00edvel no PC.*utc* = O rel\u00f3gio interno \u00e9 definido para o \/Tempo Universal Coordenado\/. Esta \u00e9 a configura\u00e7\u00e3o mais comum em um ambiente puramente Linux", + "SLX_LOGOUT_TIMEOUT": "Hora \/em segundos\/, em que uma sess\u00e3o de usu\u00e1rio pode permanecer sem a\u00e7\u00e3o antes de ser encerrada.Deixe o campo em branco para desativar a fun\u00e7\u00e3o.", + "SLX_NET_DOMAIN": "Dom\u00ednio DNS no qual o cliente se integra, desde que o servidor DHCP n\u00e3o especifique tal.", + "SLX_NTP_SERVER": "Endere\u00e7o do servidor de hor\u00e1rio NTP. V\u00e1rios servidores podem ser especificados separados por espa\u00e7os.Os servidores s\u00e3o consultados em seq\u00fc\u00eancia at\u00e9 que um servidor respondendo for encontrado.", + "SLX_PROXY_BLACKLIST": "Intervalos de endere\u00e7os em que o servidor proxy n\u00e3o \u00e9 usado (por exemplo, o intervalo de endere\u00e7o do dispositivo). As entradas v\u00e1lidas s\u00e3o endere\u00e7os IP individuais e intervalos de IP em nota\u00e7\u00e3o CIDR (por exemplo 1.2.0.0\/16). Sele\u00e7\u00f5es m\u00faltiplas podem ser separadas por espa\u00e7os.", + "SLX_PROXY_IP": "O endere\u00e7o de servidor proxy a ser usado.", + "SLX_PROXY_MODE": "Determina se um servidor proxy \u00e9 necess\u00e1rio para acessar a Internet.*off* = n\u00e3o utilizar proxy.*on* = sempre utilizar proxy.*auto* = apenas utilizar proxy quando o PC cliente estiver em um espa\u00e7o de endere\u00e7o privado.", + "SLX_PROXY_PORT": "A porta a ser utilizada pelo servidor proxy.", + "SLX_PROXY_TYPE": "Tipo do proxy.*socks4*, *socks5*,*http-connect* (Proxy HTTP com suporte ao m\u00e9todo CONNECT),*http-relay* (Cl\u00e1ssico proxy HTTP)", + "SLX_REMOTE_LOG_SESSIONS": "Determina se logins e logouts dos usu\u00e1rios devem ser reportados ao sat\u00e9lite.*yes* = Login com ID de usu\u00e1rio*anonymous* = login an\u00f4nimo*no* = sem login", + "SLX_ROOT_PASS": "A senha root do sistema base. Exigido somente para fins de diagn\u00f3stico no cliente.Deixar campo em branco para n\u00e3o permitir login com root.\/Dica\/: A senha \u00e9 criptografada com hash $6$, ent\u00e3o se torna ileg\u00edvel ap\u00f3s ser salva!", + "SLX_SHUTDOWN_SCHEDULE": "Hor\u00e1rio fixo para desligar o computador, at\u00e9 mesmo caso tenha um usu\u00e1rio ativo.M\u00faltiplos hor\u00e1rios podem ser especificados, separados por espa\u00e7os.", + "SLX_SHUTDOWN_TIMEOUT": "Tempo em segundos no qual um computador \u00e9 desligado, caso n\u00e3o tenha um usu\u00e1rio logado.Deixar em branco para desabilitar a fun\u00e7\u00e3o." +} \ No newline at end of file diff --git a/modules-available/baseconfig/page.inc.php b/modules-available/baseconfig/page.inc.php index 8f914376..e741dd2e 100644 --- a/modules-available/baseconfig/page.inc.php +++ b/modules-available/baseconfig/page.inc.php @@ -82,12 +82,12 @@ class Page_BaseConfig extends Page LEFT JOIN setting_global AS tbl USING (setting) ORDER BY cat_setting.sortval ASC, setting.setting ASC'); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $row['description'] = Util::markup(Page::translate($row['setting'], 'setting')); + $row['description'] = Util::markup(Dictionary::translateFile('config-variables', $row['setting'])); if (is_null($row['displayvalue'])) $row['displayvalue'] = $row['defaultvalue']; $row['item'] = $this->makeInput($row['validator'], $row['setting'], $row['displayvalue']); $settings[$row['catid']]['settings'][] = $row; if (!isset($settings[$row['catid']]['category_id'])) { - $settings[$row['catid']]['category_name'] = Page::translate('cat_' . $row['catid'], 'cat_setting'); + $settings[$row['catid']]['category_name'] = Dictionary::translateFile('config-variable-categories', 'cat_' . $row['catid']); $settings[$row['catid']]['category_id'] = $row['catid']; } } diff --git a/modules-available/baseconfig/templates/_page.html b/modules-available/baseconfig/templates/_page.html index 273ee50c..da155ad2 100644 --- a/modules-available/baseconfig/templates/_page.html +++ b/modules-available/baseconfig/templates/_page.html @@ -17,14 +17,11 @@ {{#settings}}
-
- -
-
+
{{setting}}
{{defaultvalue}}
-
+
{{{item}}}
diff --git a/modules-available/dozmod/lang/de/module.json b/modules-available/dozmod/lang/de/module.json new file mode 100644 index 00000000..fd4c6aff --- /dev/null +++ b/modules-available/dozmod/lang/de/module.json @@ -0,0 +1,4 @@ +{ + "module_name": "Dozentenmodul", + "page_title": "Verwalten des Dozentenmoduls" +} \ No newline at end of file diff --git a/modules-available/eventlog/lang/de/module.json b/modules-available/eventlog/lang/de/module.json new file mode 100644 index 00000000..8217fc02 --- /dev/null +++ b/modules-available/eventlog/lang/de/module.json @@ -0,0 +1,3 @@ +{ + "module_name": "Server-Log" +} \ No newline at end of file diff --git a/modules-available/eventlog/lang/en/module.json b/modules-available/eventlog/lang/en/module.json index bf1d01f0..0fc536f3 100644 --- a/modules-available/eventlog/lang/en/module.json +++ b/modules-available/eventlog/lang/en/module.json @@ -1,3 +1,3 @@ { - "module_name": "Client Log" + "module_name": "Server Log" } \ No newline at end of file diff --git a/modules-available/locations/lang/de/module.json b/modules-available/locations/lang/de/module.json new file mode 100644 index 00000000..b38fa89c --- /dev/null +++ b/modules-available/locations/lang/de/module.json @@ -0,0 +1,4 @@ +{ + "module_name": "R\u00e4ume\/Orte", + "page_title": "R\u00e4ume und Orte verwalten" +} \ No newline at end of file diff --git a/modules-available/main/hooks/translation.inc.php b/modules-available/main/hooks/translation.inc.php new file mode 100644 index 00000000..8c0e4b51 --- /dev/null +++ b/modules-available/main/hooks/translation.inc.php @@ -0,0 +1,30 @@ +getIdentifier()) + 1; + $want = array(); + foreach (Module::getAll() as $module) { + $cat = $module->getCategory(); + if (is_string($cat)) { + $want[substr($cat, $skip)] = true; + } + } + return $want; +}; diff --git a/modules-available/main/lang/de/categories.json b/modules-available/main/lang/de/categories.json new file mode 100644 index 00000000..3d9b50a3 --- /dev/null +++ b/modules-available/main/lang/de/categories.json @@ -0,0 +1,6 @@ +{ + "content": "Inhalt", + "settings": "Einstellungen", + "status": "Status", + "users": "Benutzer" +} \ No newline at end of file diff --git a/modules-available/main/lang/de/template-tags.json b/modules-available/main/lang/de/template-tags.json index d31fb64d..e9b829e8 100644 --- a/modules-available/main/lang/de/template-tags.json +++ b/modules-available/main/lang/de/template-tags.json @@ -1,35 +1,24 @@ { "lang_bootMenuWarning": "Das Bootmen\u00fc ist veraltet oder wurde noch nicht generiert.", - "lang_configurationBasic": "PXE\/Boot", - "lang_configurationVariables": "KonfigurationsVariablen", "lang_configure": "Konfigurieren", - "lang_dozmod": "Dozentenmodul", - "lang_eventLog": "Server Log", - "lang_internetAccess": "Internetzugriff", "lang_intro": "Dies ist die bwLehrpool Konfigurationsoberfl\u00e4che.", "lang_introGuest": "Dies ist das Administrations-Interface der lokalen bwLehrpool-Installation. Bitte authentifizieren Sie sich, um Einstellungen vorzunehmen.", "lang_language": "Sprachen", - "lang_localization": "Lokalisierung + Integration", - "lang_locations": "R\u00e4ume\/Orte", + "lang_loggedInPrefix": "Angemeldet als", + "lang_loggedInSuffix": " ", "lang_login": "Anmelden", "lang_logout": "Abmelden", "lang_minilinuxMissing": "Wichtige Dateien der MiniLinux-Installation fehlen.", "lang_needsSetup": "Einrichtung unvollst\u00e4ndig", - "lang_news": "vmChooser News", "lang_next": "Weiter", "lang_noExistingAccount": "Es existiert noch kein Administrator-Zugang f\u00fcr diesen Satelliten-Server.", "lang_numerOfImagesMarkedForDeletion": "Zur L\u00f6schung markierte Abbilder", "lang_register": "Registrieren", - "lang_server": "Server", - "lang_serverStatus": "Server Status", - "lang_settings": "Einstellungen", - "lang_status": "Status", "lang_systemConfiguration": "Systemkonfiguration", "lang_systemConfigurationNotChosen": "Es wurde noch keine Systemkonfiguration ausgew\u00e4hlt.", + "lang_toggleNavigation": "Navigation ein\/ausblenden", "lang_translations": "\u00dcbersetzungen", - "lang_vmLocation": "VM Speicherort", "lang_vmLocationNotSet": "Es ist noch kein Speicherort f\u00fcr die Virtuellen Maschinen festgelegt.", "lang_warning": "Warnung", - "lang_webInterface": "Web-Schnittstelle", "lang_welcome": "Willkommen" } \ No newline at end of file diff --git a/modules-available/main/lang/en/template-tags.json b/modules-available/main/lang/en/template-tags.json index f368e8b8..3483bcfe 100644 --- a/modules-available/main/lang/en/template-tags.json +++ b/modules-available/main/lang/en/template-tags.json @@ -1,41 +1,24 @@ { - "lang_backup": "Backup\/Restore", "lang_bootMenuWarning": "The boot menu is outdated or has not been generated.", - "lang_client": "Client", - "lang_clientLog": "Client Log", - "lang_clientStats": "Client statistics", - "lang_configurationBasic": "PXE\/Boot", - "lang_configurationVariables": "Configuration Variables", "lang_configure": "Configure", - "lang_dozmod": "Tutor module", - "lang_eventLog": "Server Log", - "lang_internetAccess": "Internet access", "lang_intro": "This is the bwLehrpool configuration interface.", "lang_introGuest": "This is the administration interface of the local bwLehrpool intallation. Please authenticate yourself to adjust settings.", "lang_language": "Language", - "lang_localization": "Localization", - "lang_locations": "Rooms\/Locations", "lang_loggedInPrefix": "Logged in as", "lang_loggedInSuffix": " ", "lang_login": "Login", "lang_logout": "Logout", "lang_minilinuxMissing": "Important files from the mini Linux installation are missing.", "lang_needsSetup": "Setup incomplete", - "lang_news": "vmChooser news", "lang_next": "Next", "lang_noExistingAccount": "No account has been created yet. Sign up to become the administrator.", "lang_numerOfImagesMarkedForDeletion": "Images marked for deletion", "lang_register": "Register", - "lang_server": "Server", - "lang_serverStatus": "Server status", - "lang_settings": "Settings", - "lang_status": "Status", "lang_systemConfiguration": "System Configuration", "lang_systemConfigurationNotChosen": "A system configuration has not been chosen yet.", + "lang_toggleNavigation": "toggle navigation", "lang_translations": "Translations", - "lang_vmLocation": "VM Location", "lang_vmLocationNotSet": "A location for the virtual machine is not set yet.", "lang_warning": "Warning", - "lang_webInterface": "Web interface", "lang_welcome": "Welcome" } \ No newline at end of file diff --git a/modules-available/main/lang/pt/categories.json b/modules-available/main/lang/pt/categories.json new file mode 100644 index 00000000..4b6ed82f --- /dev/null +++ b/modules-available/main/lang/pt/categories.json @@ -0,0 +1,6 @@ +{ + "content": "Conte\u00fado", + "settings": "Configura\u00e7\u00f5es", + "status": "Status", + "users": "Usu\u00e1rios" +} diff --git a/modules-available/main/page.inc.php b/modules-available/main/page.inc.php index 369d4b54..0a9acd81 100644 --- a/modules-available/main/page.inc.php +++ b/modules-available/main/page.inc.php @@ -25,8 +25,6 @@ class Page_Main extends Page protected function doRender() { - // Render::setTitle('abc'); - if (!User::isLoggedIn()) { Render::addTemplate('page-main-guest', array( 'register' => (Database::queryFirst('SELECT userid FROM user LIMIT 1') === false) diff --git a/modules-available/main/templates/page-login.html b/modules-available/main/templates/page-login.html deleted file mode 100644 index 247e9a55..00000000 --- a/modules-available/main/templates/page-login.html +++ /dev/null @@ -1,11 +0,0 @@ - \ No newline at end of file diff --git a/modules-available/main/templates/page-minilinux.html b/modules-available/main/templates/page-minilinux.html deleted file mode 100644 index dc13e6b0..00000000 --- a/modules-available/main/templates/page-minilinux.html +++ /dev/null @@ -1,14 +0,0 @@ -
-
{{lang_listObtained}}
-
- - \ No newline at end of file diff --git a/modules-available/main/templates/page-news.html b/modules-available/main/templates/page-news.html deleted file mode 100644 index 8e400498..00000000 --- a/modules-available/main/templates/page-news.html +++ /dev/null @@ -1,57 +0,0 @@ -
-
- {{lang_editNews}} -
-
-

{{lang_newsIntro}}

-
-
- - -
-
- - -
-

{{lang_latestUpdate}}: {{latestDate}}

- - -
-
-
- -
-
- {{lang_newsOld}} -
-
-
-
- - - - - - - - - - - - {{#list}} - - - - - - - {{/list}} - -
{{lang_date}}{{lang_title}}{{lang_content}}
{{date}}{{title}}{{content}} - {{lang_show}} - -
-
-
-
-
diff --git a/modules-available/main/templates/page-syslog.html b/modules-available/main/templates/page-syslog.html deleted file mode 100644 index 98e94291..00000000 --- a/modules-available/main/templates/page-syslog.html +++ /dev/null @@ -1,58 +0,0 @@ -

{{lang_clientLog}}

-
- -
- {{lang_filter}} - - - {{lang_not}} - - - - -
-
-{{{pagenav}}} - - - - - - - - - - {{#list}} - - - - - - - - {{/list}} - -
{{lang_when}}{{lang_client}}{{lang_event}}{{lang_details}}
{{date}}{{clientip}}{{description}}{{#extra}} - » - - {{/extra}}
-{{{pagenav}}} - - - - diff --git a/modules-available/main/templates/page-vmstore.html b/modules-available/main/templates/page-vmstore.html deleted file mode 100644 index fe2c5225..00000000 --- a/modules-available/main/templates/page-vmstore.html +++ /dev/null @@ -1,111 +0,0 @@ -
- - - - -
-
- {{lang_vmLocation}} -
-
-

{{lang_vmLocationChoose}}

-
-
- {{lang_intern}} -
-
- {{lang_noAdditionalInformation}} -
-
-
-
- NFS - -
-
- - -
-
-
-
- CIFS -
-
- - -
- -
- - {{lang_username}} - - - - {{lang_password}} - - -
-
- -
- - {{lang_username}} - - - - {{lang_password}} - - -
-
-
- -
-
-
- - - - diff --git a/modules-available/minilinux/lang/de/module.json b/modules-available/minilinux/lang/de/module.json new file mode 100644 index 00000000..e5284ac0 --- /dev/null +++ b/modules-available/minilinux/lang/de/module.json @@ -0,0 +1,4 @@ +{ + "module_name": "bwLehrpool MiniLinux", + "page_title": "MiniLinux verwalten und aktualisieren" +} \ No newline at end of file diff --git a/modules-available/news/lang/de/module.json b/modules-available/news/lang/de/module.json new file mode 100644 index 00000000..f44a64e5 --- /dev/null +++ b/modules-available/news/lang/de/module.json @@ -0,0 +1,3 @@ +{ + "module_name": "vmChooser News" +} \ No newline at end of file diff --git a/modules-available/serversetup/lang/de/module.json b/modules-available/serversetup/lang/de/module.json new file mode 100644 index 00000000..eb777343 --- /dev/null +++ b/modules-available/serversetup/lang/de/module.json @@ -0,0 +1,4 @@ +{ + "module_name": "PXE\/Boot", + "page_title": "PXE- und Boot-Einstellungen" +} \ No newline at end of file diff --git a/modules-available/support/lang/de/module.json b/modules-available/support/lang/de/module.json new file mode 100644 index 00000000..13b2b8f0 --- /dev/null +++ b/modules-available/support/lang/de/module.json @@ -0,0 +1,3 @@ +{ + "module_name": "Support" +} \ No newline at end of file diff --git a/modules-available/sysconfig/lang/de/module.json b/modules-available/sysconfig/lang/de/module.json new file mode 100644 index 00000000..dfd47099 --- /dev/null +++ b/modules-available/sysconfig/lang/de/module.json @@ -0,0 +1,4 @@ +{ + "module_name": "Lokalisierung + Integration", + "page_title": "Lokalisierung + Integration" +} \ No newline at end of file diff --git a/modules-available/sysconfig/lang/en/module.json b/modules-available/sysconfig/lang/en/module.json index f6454e24..9125fb13 100644 --- a/modules-available/sysconfig/lang/en/module.json +++ b/modules-available/sysconfig/lang/en/module.json @@ -1,3 +1,4 @@ { - "module_name": "Modules" + "module_name": "Localization", + "page_title": "Localize and integrate" } \ No newline at end of file diff --git a/modules-available/syslog/lang/en/module.json b/modules-available/syslog/lang/en/module.json index 0fc536f3..bbe80ee1 100644 --- a/modules-available/syslog/lang/en/module.json +++ b/modules-available/syslog/lang/en/module.json @@ -1,3 +1,4 @@ { - "module_name": "Server Log" + "module_name": "Client Log", + "page_title": "Log messages \u2013 Clients" } \ No newline at end of file diff --git a/modules-available/systemstatus/lang/de/module.json b/modules-available/systemstatus/lang/de/module.json new file mode 100644 index 00000000..e69c3fb0 --- /dev/null +++ b/modules-available/systemstatus/lang/de/module.json @@ -0,0 +1,3 @@ +{ + "module_name": "System-Status" +} \ No newline at end of file diff --git a/modules-available/systemstatus/lang/en/module.json b/modules-available/systemstatus/lang/en/module.json index 126d6bb8..bb201773 100644 --- a/modules-available/systemstatus/lang/en/module.json +++ b/modules-available/systemstatus/lang/en/module.json @@ -1,3 +1,3 @@ { - "module_name": "Server" + "module_name": "System Status" } \ No newline at end of file diff --git a/modules-available/translation/lang/de/messages.json b/modules-available/translation/lang/de/messages.json new file mode 100644 index 00000000..645d678b --- /dev/null +++ b/modules-available/translation/lang/de/messages.json @@ -0,0 +1,3 @@ +{ + "i18n-invalid-lang": "Ung\u00fcltige Sprache: {{0}}" +} \ No newline at end of file diff --git a/modules-available/translation/lang/de/module.json b/modules-available/translation/lang/de/module.json new file mode 100644 index 00000000..c3bf2f78 --- /dev/null +++ b/modules-available/translation/lang/de/module.json @@ -0,0 +1,3 @@ +{ + "module_name": "\u00dcbersetzungen" +} \ No newline at end of file diff --git a/modules-available/translation/lang/de/template-tags.json b/modules-available/translation/lang/de/template-tags.json index f84bb0af..613a8fa1 100644 --- a/modules-available/translation/lang/de/template-tags.json +++ b/modules-available/translation/lang/de/template-tags.json @@ -9,9 +9,13 @@ "lang_editModules": "Modul bearbeiten", "lang_editSettings": "Einstellungstexte bearbeiten", "lang_editTemplates": "Template-Texte bearbeiten", + "lang_hint": "Hinweis", "lang_langAdministration": "Templates", - "lang_missing": "Fehlt", + "lang_mainHeading": "\u00dcbersetzungen verwalten", + "lang_messages": "Benachrichtigungen", + "lang_missing": "Fehlend", "lang_module": "Modul", + "lang_otherStrings": "Andere Texte", "lang_sample": "Beispiel", "lang_save": "Speichern", "lang_status": "Status", @@ -21,5 +25,6 @@ "lang_templateHint": "Hinweis: Gelbe Linie zeigt eine \u00dcbersetzung fehlt und roten Linien zeigen ein Tag wird nicht von das Template verwendet.", "lang_templates": "Templates", "lang_translation": "\u00dcbersetzung", - "lang_unused": "Ungenutzt" + "lang_unused": "Ungenutzt", + "lang_unusedUnreliableHint": "Die Erkennung von ungenutzten Tags bezieht nur aktivierte Module mit ein. Es k\u00f6nnte sein, dass ein ungenutzt gemeldeter Tag in einem nicht aktivierten Modul verwendet wird." } \ No newline at end of file diff --git a/modules-available/translation/lang/en/template-tags.json b/modules-available/translation/lang/en/template-tags.json index 48389f9b..84b3ba26 100644 --- a/modules-available/translation/lang/en/template-tags.json +++ b/modules-available/translation/lang/en/template-tags.json @@ -9,9 +9,13 @@ "lang_editModules": "Edit Module Translations", "lang_editSettings": "Edit configuration variables related strings", "lang_editTemplates": "Edit template strings", + "lang_hint": "Notice", "lang_langAdministration": "Templates", + "lang_mainHeading": "Translation management", + "lang_messages": "Messages", "lang_missing": "Missing", "lang_module": "Module", + "lang_otherStrings": "Other strings", "lang_sample": "Sample", "lang_save": "Save", "lang_status": "Status", @@ -21,5 +25,6 @@ "lang_templateHint": "Hint: Yellow lines indicate a translation is missing and red lines indicate a tag is not being used by the template.", "lang_templates": "Templates", "lang_translation": "Translation", - "lang_unused": "Unused" + "lang_unused": "Unused", + "lang_unusedUnreliableHint": "Detection of unused tags only includes currently activated modules. It's possible that a tag marked \"unused\" is actually refered to in a module not activated." } \ No newline at end of file diff --git a/modules-available/translation/page.inc.php b/modules-available/translation/page.inc.php index 674756a2..1713efe9 100644 --- a/modules-available/translation/page.inc.php +++ b/modules-available/translation/page.inc.php @@ -42,7 +42,7 @@ class Page_Translation extends Page public function __construct() { - $this->builtInSections = array('template', 'messages', 'custom'); + $this->builtInSections = array('template', 'messages', 'module', 'custom'); } private function isValidSection($section) @@ -159,50 +159,22 @@ class Page_Translation extends Page $this->showMessagesEdit(); return; } + + // Module + if ($this->section === 'module') { + $this->ensureValidDestLanguage(); + $this->showModuleEdit(); + return; + } - //load the page accordingly to the link - switch ($this->section) { - case 'messages': - //renders the message edit page - Render::addTemplate('edit', array( - 'path' => 'messages', - 'langs' => $langs, - 'tags' => $this->loadMessageEditArray() - )); - break; - case 'hardcoded': - //renders the hardcoded messages edit page - Render::addTemplate('edit', array( - 'path' => 'messages-hardcoded', - 'langs' => $langs, - 'tags' => $this->loadHardcodedStringEditArray() - )); - break; - case 'settings': - //renders the settings related edit page - Render::addTemplate('edit', array( - 'path' => 'cat_setting', - 'langs' => $langs, - 'tags' => $this->loadCategoriesArray() - )); - Render::addTemplate('edit', array( - 'path' => 'setting', - 'langs' => $langs, - 'tags' => $this->loadSettingsArray() - )); - break; - case 'config-module': - //renders the hardcoded messages edit page - Render::addTemplate('edit', array( - 'path' => 'config-module', - 'langs' => $langs, - 'tags' => $this->buildTranslationTable('config-module') - )); - break; - default: - //renders main page with selection of what part to edit - Render::addTemplate('_page'); + // Custom + if ($this->section === 'custom') { + $this->ensureValidDestLanguage(); + $this->showCustomEdit(); + return; } + + $this->redirect(); } private function showListOfModules() @@ -237,16 +209,20 @@ class Page_Translation extends Page $this->showModuleTemplates(); // Messages $this->showModuleMessages(); + // Other/hardcoded strings + $this->showModuleStrings(); + // Module specific + $this->showModuleCustom(); } private function showModuleTemplates() { $templateTags = $this->loadUsedTemplateTags(); $data = array('module' => $this->module->getIdentifier()); - $list = array(); + $templateNames = array(); $data['tagcount'] = 0; foreach ($templateTags as $templates) { - $list = array_merge($list, $templates); + $templateNames = array_merge($templateNames, $templates); $data['tagcount']++; } foreach (Dictionary::getLanguages(true) as $lang) { @@ -259,7 +235,7 @@ class Page_Translation extends Page ); } $data['templates'] = array(); - foreach (array_unique($list) as $template) { + foreach (array_unique($templateNames) as $template) { $data['templates'][] = array('template' => $template); } Render::addTemplate('template-list', $data); @@ -269,14 +245,14 @@ class Page_Translation extends Page { $messageTags = $this->loadUsedMessageTags(); $data = array('module' => $this->module->getIdentifier()); - $list = array(); + $phpFiles = array(); $data['messagecount'] = 0; foreach ($messageTags as $templates) { - $list = array_merge($list, array_keys($templates['files'])); + $phpFiles = array_merge($phpFiles, array_keys($templates['files'])); $data['messagecount']++; } foreach (Dictionary::getLanguages(true) as $lang) { - list($missing, $unused) = $this->getModuleTranslationStatus($lang['cc'], 'messages', $messageTags); + list($missing, $unused) = $this->getModuleTranslationStatus($lang['cc'], 'messages', false, $messageTags); $data['langs'][] = array( 'cc' => $lang['cc'], 'name' => $lang['name'], @@ -285,11 +261,57 @@ class Page_Translation extends Page ); } $data['files'] = array(); - foreach (array_unique($list) as $template) { + foreach (array_unique($phpFiles) as $template) { $data['files'][] = array('file' => $template); } Render::addTemplate('message-list', $data); } + + private function showModuleStrings() + { + $moduleTags = $this->loadUsedModuleTags(); + $data = array('module' => $this->module->getIdentifier()); + $data['tagcount'] = count($moduleTags); + foreach (Dictionary::getLanguages(true) as $lang) { + list($missing, $unused) = $this->getModuleTranslationStatus($lang['cc'], 'module', true, $moduleTags); + $data['langs'][] = array( + 'cc' => $lang['cc'], + 'name' => $lang['name'], + 'missing' => $missing, + 'unused' => $unused + ); + } + Render::addTemplate('string-list', $data); + } + + private function showModuleCustom() + { + if ($this->customHandler === false) + return; + foreach ($this->customHandler['subsections'] as $subsection) { + $this->showModuleCustomSubsection($subsection); + } + } + + private function showModuleCustomSubsection($subsection) + { + $moduleTags = $this->loadUsedCustomTags($subsection); + $data = array( + 'subsection' => $subsection, + 'module' => $this->module->getIdentifier(), + 'tagcount' => count($moduleTags), + ); + foreach (Dictionary::getLanguages(true) as $lang) { + list($missing, $unused) = $this->getModuleTranslationStatus($lang['cc'], $subsection, false, $moduleTags); + $data['langs'][] = array( + 'cc' => $lang['cc'], + 'name' => $lang['name'], + 'missing' => $missing, + 'unused' => $unused + ); + } + Render::addTemplate('custom-list', $data); + } private function showTemplateEdit() { @@ -313,10 +335,34 @@ class Page_Translation extends Page )); } + private function showModuleEdit() + { + Render::addTemplate('edit', array( + 'destlang' => $this->destLang, + 'language' => Dictionary::getLanguageName($this->destLang), + 'tags' => $this->loadModuleEditArray(), + 'module' => $this->module->getIdentifier(), + 'section' => $this->section + )); + } + + private function showCustomEdit() + { + Render::addTemplate('edit', array( + 'destlang' => $this->destLang, + 'language' => Dictionary::getLanguageName($this->destLang), + 'tags' => $this->loadCustomEditArray(), + 'module' => $this->module->getIdentifier(), + 'section' => $this->section, + 'subsection' => $this->subsection + )); + } + /** * Get all tags used by templates of the given module. - * @param \Module $module module in question, false to use the one being edited - * @return array index is tag, value is array of templates using that tag + * @param \Module $module module in question, false to use the one being edited. + * + * @return array of array(tag => array of templates using that tag) */ private function loadUsedTemplateTags($module = false) { @@ -368,6 +414,41 @@ class Page_Translation extends Page $this->getModulePhpFiles($module)); return $tags; } + + /** + * Get all module tags used/required. + * + * @param type $module + * @return array of array(tagname => (bool)required) + */ + private function loadUsedModuleTags($module = false) + { + if ($module === false) { + $module = $this->module; + } + $tags = $this->loadTagsFromPhp('/Dictionary\s*::\s*translate\s*\(\s*[\'"](?[^\'"\.]*)[\'"]\s*\)/i', + $this->getModulePhpFiles($module)); + foreach ($tags as &$tag) { + $tag = true; + } + unset($tag); + // Fixup special tags + if ($module->getCategory() === false) { + unset($tags['module_name']); + unset($tags['page_title']); + } else { + $tags['module_name'] = true; + $tags['page_title'] = false; + } + return $tags; + } + + private function loadUsedCustomTags($subsection) + { + if (!isset($this->customHandler['grep_'.$subsection])) + return array(); + return $this->customHandler['grep_'.$subsection]($this->module); + } private function getTagsFromTemplate($templateFile) { @@ -395,53 +476,49 @@ class Page_Translation extends Page */ private function getModuleTemplateStatus($lang, $tags = false, $module = false) { - if ($module === false) { - $module = $this->module; - } - if ($tags === false) { - $tags = $this->loadUsedTemplateTags(); - } - $globalTranslation = Dictionary::getArray('main', 'global-template-tags', $lang); - $translation = Dictionary::getArray($module->getIdentifier(), 'template-tags', $lang) + $globalTranslation; - $matches = 0; - $unused = 0; - $expected = count($tags); - foreach ($translation as $key => $value) { - if(!isset($tags[$key])) { - if (!in_array($key, $globalTranslation)) { - $unused++; - } - } else { - $matches++; - } - - } - $missing = $expected - $matches; - return array($missing, $unused); + return $this->getModuleTranslationStatus($lang, 'template-tags', true, $tags, $module); } /** - * Get missing and unused counters for given module's templates. + * Get missing and unused counters for given translation unit. + * This is a more general version of the getModuleTemplateStatus function, + * which is special since it uses fallback to global translations. * - * @param type $lang lang to use - * @param type $tags - * @param type $module + * @param string $lang lang cc to use + * @param string $file the name of the translation file to load for checking + * @param boolean $fallback whether to check the global-tags of the main module as fallback + * @param array $tags list of tags that are expected to exist. Tags are the array keys! + * @param \Module $module the module to work with, defaults to the currently edited module * @return array list(missingCount, unusedCount) */ - private function getModuleTranslationStatus($lang, $file, $tags, $module = false) + private function getModuleTranslationStatus($lang, $file, $fallback, $tags, $module = false) { if ($module === false) { $module = $this->module; } - $translation = Dictionary::getArray($module->getIdentifier(), $file, $lang); + if ($fallback) { + $globalTranslation = Dictionary::getArray('main', 'global-tags', $lang); + } else { + $globalTranslation = array(); + } + $translation = Dictionary::getArray($module->getIdentifier(), $file, $lang) + $globalTranslation; $matches = 0; $unused = 0; - $expected = count($tags); - foreach ($translation as $key => $value) { + $expected = 0; + foreach ($tags as $v) { + if ($v !== false) { + $expected++; + } + } + foreach (array_keys($translation) as $key) { if(!isset($tags[$key])) { - $unused++; + if (!in_array($key, $globalTranslation)) { + $unused++; + } } else { - $matches++; + if ($tags[$key] !== false) { + $matches++; + } } } @@ -506,51 +583,6 @@ class Page_Translation extends Page return $this->getAllFiles('modules/' . $module->getIdentifier(), '.php'); } - /** - * Checks the JSON tags from a template - * @param string the template's path - * @param string the selected language - * @param string tags that should be in the json file - * @return string|boolean the information about the JSON tags, false if template has no lang-tags - */ - private function checkJson($path, $lang, $expectedTags) - { - //if there was not a valid template's path - if (!$path) { - return "Translation missing"; - } - // How many tags do we expect in the translation - $htmlCount = count($expectedTags); - - //initialize the count variables - $matchCount = 0; - $unusedCount = 0; - - //loads the JSON tags and count the matches - $json = Dictionary::getArray(substr($path, strlen("modules/")), $lang); - //return print_r($json) . "\nvs\n" . print_r($expectedTags); - foreach ($json as $key => $value) { - if (!in_array($key, $expectedTags)) { - $unusedCount++; - } else if (!empty($value)) { - $matchCount++; - } - } - $diff = $htmlCount - $matchCount; - - if ($diff == 0 && $unusedCount == 0) - return ''; - //build the return string - $str = ""; - if ($diff > 0) - $str .= $diff . " JSON tag(s) are missing"; - if ($diff > 0 && $unusedCount > 0) - $str .= "
"; - if ($unusedCount > 0) - $str .= $unusedCount . " JSON tag(s) are not being used"; - return $str; - } - /** * Get array to pass to edit page with all the tags and translations. * @@ -563,7 +595,7 @@ class Page_Translation extends Page if ($tags === false) return false; $table = $this->buildTranslationTable('template-tags', array_keys($tags), true); - $global = Dictionary::getArray($this->module->getIdentifier(), 'global-template-tags', $this->destLang); + $global = Dictionary::getArray($this->module->getIdentifier(), 'global-tags', $this->destLang); foreach ($table as &$entry) { if (empty($entry['translation']) && isset($global[$entry['tag']])) { $entry['placeholder'] = $global[$entry['tag']]; @@ -602,6 +634,41 @@ class Page_Translation extends Page return $table; } + /** + * Get array to pass to edit page with all the message ids. + * + * @param string $path the template's path + * @return array structure to pass to the tags list in the edit template + */ + private function loadModuleEditArray() + { + $tags = $this->loadUsedModuleTags(); + $table = $this->buildTranslationTable('module', array_keys($tags), true); + return $table; + } + + /** + * Get array to pass to edit page with all the message ids. + * + * @param string $path the template's path + * @return array structure to pass to the tags list in the edit template + */ + private function loadCustomEditArray() + { + $tags = $this->loadUsedCustomTags($this->subsection); + $table = $this->buildTranslationTable($this->subsection, array_keys($tags), true); + return $table; + } + + /** + * Quick and dirty method to count the parameters of a message/translate invocation. + * Expects the rest of an invocation, so e.g. addMessage('foo-foo', 'hi'); becomes + * , 'hi'); or addMessage('foo'); becomes just ); + * This obviously fails if the call is spread over multiple lines. + * + * @param string $str the partial method call + * @return int number of arguments to the method, minus the message id + */ private function countMessageParams($str) { $quote = false; @@ -611,28 +678,36 @@ class Page_Translation extends Page $depth = 0; for ($i = 0; $i < $len; ++$i) { $char = $str{$i}; + // Last char was backslash? Ignore this char if ($escape) { $escape = false; continue; } - if ($quote === false) { - if ($char === ',') { - if ($depth === 0) { - $count++; - } - } elseif ($char === '"' || $char === "'") { - $quote = $char; - } elseif ($char === '{' || $char === '(' || $char === '[') { - $depth++; - } elseif ($char === '}' || $char === ')' || $char === ']') { - $depth--; - } - } else { + // We're inside quotes, watch for end or backslash + if ($quote !== false) { if ($char === $quote) { $quote = false; } elseif ($char === '\\') { $escape = true; } + continue; + } + // We're not inside quotes + // Check if we have a parameter delimiter + if ($char === ',') { + // Check we're not in a nested method call + if ($depth === 0) { + $count++; // Increase parameter counter + } + } elseif ($char === '"' || $char === "'") { + // Start of string + $quote = $char; + } elseif ($char === '{' || $char === '(' || $char === '[') { + // Nested method etc. + $depth++; + } elseif ($char === '}' || $char === ')' || $char === ']') { + // End nested method + $depth--; } } return $count; @@ -659,7 +734,7 @@ class Page_Translation extends Page $tags = array(); // Now find all tags in all php files. Only works for literal usage, not something like $foo = 'bar'; Dictionary::translate($foo); foreach ($files as $file) { - $content = @file_get_contents($file); + $content = file_get_contents($file); if ($content === false || preg_match_all($regexp, $content, $out, PREG_SET_ORDER) < 1) continue; foreach ($out as $set) { @@ -701,30 +776,8 @@ class Page_Translation extends Page } } if ($findAlreadyTranslated) { - $srcLangs = array_merge(array(LANG), array('en'), Dictionary::getLanguages()); - $srcLangs = array_unique($srcLangs); - $key = array_search($this->destLang, $srcLangs); - if ($key !== false) { - unset($srcLangs[$key]); - } - foreach ($srcLangs as $lang) { - $otherLang = Dictionary::getArray($this->module->getIdentifier(), $file, $lang); - if (!is_array($otherLang)) - continue; - $missing = false; - foreach (array_keys($tags) as $tag) { - if (isset($tags[$tag]['samplelang'])) - continue; - if (!isset($otherLang[$tag])) { - $missing = true; - } else { - $tags[$tag]['samplelang'] = $lang; - $tags[$tag]['sampletext'] = $otherLang[$tag]; - } - } - if (!$missing) - break; - } + // For each tag, include a translated string from another language as reference + $this->findTranslationSamples($file, $tags); } $tagid = 0; foreach ($tags as &$tag) { @@ -738,27 +791,42 @@ class Page_Translation extends Page } } } - // Finally remove $lang from the keys so mustache will iterate over them via {{#..}} + // Finally remove tagname from the keys so mustache will iterate over them via {{#..}} return array_values($tags); } /** - * Change the color of the table line according to the tag status - * @param string the JSON's path - * @param string the selected tag - * @return string the css class of the line + * Finds translation samples for the given tags in the given file, looking in all + * languages except the one currently being translated to. Prefers the language the + * user selected, then english, then everything else. + * + * @param string $file translation unit + * @param type $tags list of tags, formatted as used in buildTranslationTable() */ - private function getTagColor($missingCount) + private function findTranslationSamples($file, &$tags) { - //return danger in case the tag is not found in the template - if ($missingCount < 0) - return 'danger'; - - //return warning in case at least one of the tag's values is empty - if ($missingCount > 0) - return 'warning'; - //if it's ok don't change the class - return ''; + $srcLangs = array_unique(array_merge(array(LANG), array('en'), Dictionary::getLanguages())); + if (($key = array_search($this->destLang, $srcLangs)) !== false) { + unset($srcLangs[$key]); + } + foreach ($srcLangs as $lang) { + $otherLang = Dictionary::getArray($this->module->getIdentifier(), $file, $lang); + if (!is_array($otherLang)) + continue; + $missing = false; + foreach (array_keys($tags) as $tag) { + if (isset($tags[$tag]['samplelang'])) + continue; + if (!isset($otherLang[$tag])) { + $missing = true; + } else { + $tags[$tag]['samplelang'] = $lang; + $tags[$tag]['sampletext'] = $otherLang[$tag]; + } + } + if (!$missing) + break; + } } private function getJsonFile() @@ -771,6 +839,9 @@ class Page_Translation extends Page if ($this->section === 'template') { return $prefix . '/template-tags.json'; } + if ($this->section === 'module') { + return $prefix . '/module.json'; + } // Custom submodule if ($this->section === 'custom') { if ($this->customHandler === false || !isset($this->customHandler['subsections'])) { @@ -781,7 +852,7 @@ class Page_Translation extends Page Message::addError('invalid-custom-handler', $this->subsection); $this->redirect(1); } - return $prefix . '/' . $this->subsection; + return $prefix . '/' . $this->subsection . '.json'; } Message::addError('invalid-section', $this->section); $this->redirect(1); @@ -851,35 +922,5 @@ class Page_Translation extends Page Message::addSuccess('updated-tags'); } - - /** - * Load all settings categories for editing. - * - * @return array - */ - private function loadCategoriesArray() - { - $want = array(); - $res = Database::simpleQuery("SELECT catid FROM cat_setting ORDER BY catid ASC"); - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $want[] = 'cat_' . $row['catid']; - } - return $this->buildTranslationTable('settings/cat_setting', $want); - } - - /** - * Load all settings categories for editing. - * - * @return array - */ - private function loadSettingsArray() - { - $want = array(); - $res = Database::simpleQuery("SELECT setting FROM setting ORDER BY setting ASC"); - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $want[] = $row['setting']; - } - return $this->buildTranslationTable('settings/setting', $want); - } } diff --git a/modules-available/translation/templates/_page.html b/modules-available/translation/templates/_page.html deleted file mode 100644 index 45732c5b..00000000 --- a/modules-available/translation/templates/_page.html +++ /dev/null @@ -1,18 +0,0 @@ -

{{lang_mainHeading}}

- diff --git a/modules-available/translation/templates/custom-list.html b/modules-available/translation/templates/custom-list.html new file mode 100644 index 00000000..42ee98ad --- /dev/null +++ b/modules-available/translation/templates/custom-list.html @@ -0,0 +1,21 @@ +
+
+ {{subsection}} +
+
+
+
+ {{#langs}} + {{name}} » +
    +
  • {{lang_missing}}: {{missing}}
  • +
  • {{lang_unused}}: {{unused}}
  • +
+ {{/langs}} +
+
+ {{lang_tags}}: {{tagcount}} +
+
+
+
diff --git a/modules-available/translation/templates/module-list.html b/modules-available/translation/templates/module-list.html index 589fa0d4..81dc741c 100644 --- a/modules-available/translation/templates/module-list.html +++ b/modules-available/translation/templates/module-list.html @@ -1,11 +1,5 @@ -
-
- {{lang_langAdministration}} -
-
-

{{lang_adminInfo}}

-
-
+

{{lang_translationHeading}}

+
diff --git a/modules-available/translation/templates/string-list.html b/modules-available/translation/templates/string-list.html new file mode 100644 index 00000000..f1301494 --- /dev/null +++ b/modules-available/translation/templates/string-list.html @@ -0,0 +1,21 @@ +
+
+ {{lang_otherStrings}} +
+
+
+
+ {{#langs}} + {{name}} » +
    +
  • {{lang_missing}}: {{missing}}
  • +
  • {{lang_unused}}: {{unused}}
  • +
+ {{/langs}} +
+
+ {{lang_tags}}: {{tagcount}} +
+
+
+
diff --git a/modules-available/vmstore/lang/de/module.json b/modules-available/vmstore/lang/de/module.json new file mode 100644 index 00000000..87be6cae --- /dev/null +++ b/modules-available/vmstore/lang/de/module.json @@ -0,0 +1,4 @@ +{ + "module_name": "VM Speicherort", + "page_title": "Speicherort f\u00fcr VMs festlegen" +} \ No newline at end of file diff --git a/modules-available/vmstore/lang/en/module.json b/modules-available/vmstore/lang/en/module.json index 67e63451..95b2e66d 100644 --- a/modules-available/vmstore/lang/en/module.json +++ b/modules-available/vmstore/lang/en/module.json @@ -1,3 +1,4 @@ { - "module_name": "Virtual Machine" + "module_name": "VM storage location", + "page_title": "Setting VM storage location" } \ No newline at end of file diff --git a/modules-available/webinterface/lang/de/module.json b/modules-available/webinterface/lang/de/module.json new file mode 100644 index 00000000..4b96a1fe --- /dev/null +++ b/modules-available/webinterface/lang/de/module.json @@ -0,0 +1,4 @@ +{ + "module_name": "Web-Schnittstelle", + "page_title": "Web-Schnittstelle konfigurieren" +} \ No newline at end of file -- cgit v1.2.3-55-g7522