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/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 --------------------- 11 files changed, 46 insertions(+), 285 deletions(-) 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 (limited to 'modules-available/main') 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 @@ -
-

{{lang_enter}}

- - - - - {{lang_register}} - -
\ 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}} - - -
-
-
- -
-
-
- - - - -- cgit v1.2.3-55-g7522