diff options
author | Simon Rettberg | 2016-05-04 18:27:28 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-05-04 18:27:28 +0200 |
commit | 80424b29e00609bf837119fa810b5afdadf2b4e9 (patch) | |
tree | e59c49265aeb219c4137bdf21e71262201345b99 /modules-available/baseconfig | |
parent | WIP (diff) | |
download | slx-admin-80424b29e00609bf837119fa810b5afdadf2b4e9.tar.gz slx-admin-80424b29e00609bf837119fa810b5afdadf2b4e9.tar.xz slx-admin-80424b29e00609bf837119fa810b5afdadf2b4e9.zip |
Work on translations: templates and messages work
Diffstat (limited to 'modules-available/baseconfig')
-rw-r--r-- | modules-available/baseconfig/hooks/translation.inc.php | 39 | ||||
-rw-r--r-- | modules-available/baseconfig/lang/de/template-tags.json (renamed from modules-available/baseconfig/lang/de/templates/_page.json) | 0 | ||||
-rw-r--r-- | modules-available/baseconfig/lang/en/module.json | 24 | ||||
-rw-r--r-- | modules-available/baseconfig/lang/en/template-tags.json | 27 | ||||
-rw-r--r-- | modules-available/baseconfig/lang/en/templates/_page.json | 7 | ||||
-rw-r--r-- | modules-available/baseconfig/lang/pt/module.json | 24 | ||||
-rw-r--r-- | modules-available/baseconfig/lang/pt/template-tags.json | 26 |
7 files changed, 92 insertions, 55 deletions
diff --git a/modules-available/baseconfig/hooks/translation.inc.php b/modules-available/baseconfig/hooks/translation.inc.php new file mode 100644 index 00000000..84a6d33a --- /dev/null +++ b/modules-available/baseconfig/hooks/translation.inc.php @@ -0,0 +1,39 @@ +<?php + +$HANDLER = array(); + +/** + * List of valid subsections + */ +$HANDLER['subsections'] = array( + 'categories', 'settings' +); + +/* + * Handlers for the subsections that will return an array of expected tags. + * This is optional, if you don't want to define expected tags, don't create a function. + */ + +/** + * Configuration categories + */ +$HANDLER['grep']['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']; + } + return $want; +}; + +/** + * Configuration variables + */ +$HANDLER['grep']['settings'] = 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']; + } + return $want; +}; diff --git a/modules-available/baseconfig/lang/de/templates/_page.json b/modules-available/baseconfig/lang/de/template-tags.json index 0f4819b4..0f4819b4 100644 --- a/modules-available/baseconfig/lang/de/templates/_page.json +++ b/modules-available/baseconfig/lang/de/template-tags.json diff --git a/modules-available/baseconfig/lang/en/module.json b/modules-available/baseconfig/lang/en/module.json index 9345c27c..38bbca7b 100644 --- a/modules-available/baseconfig/lang/en/module.json +++ b/modules-available/baseconfig/lang/en/module.json @@ -1,27 +1,3 @@ { - "lang_basicConfiguration": "Basic Configuration", - "lang_catPartition": "Partition Managment", - "lang_catUser": "User Managment", - "lang_close": "Close", - "lang_confirm": "Would you like to save the settings on [ \/srv\/openslx\/www\/boot\/config ] ?", - "lang_create": "Create", - "lang_delete": "Delete", - "lang_help": "Help", - "lang_helpId": "Partition Id", - "lang_helpMountPoint": "Must be a directory: \/example\/directory\/", - "lang_helpOptions": "Currently, only option 'bootable' is available", - "lang_helpSize": "Must be in Gigabytes e.g. 15G", - "lang_newPartition": "New Partition", - "lang_newUser": "New User", - "lang_partitionId": "Id", - "lang_partitionMountPoint": "Mount Point", - "lang_partitionOptions": "Options", - "lang_partitionSize": "Size", - "lang_reset": "Reset", - "lang_resetConfirm": "Do you really wish to reset the variable to their default values?", - "lang_resetDefault": "Reset Default", - "lang_save": "Save", - "lang_userName": "Username", - "lang_userPasswd": "Password", "module_name": "Variables" }
\ No newline at end of file diff --git a/modules-available/baseconfig/lang/en/template-tags.json b/modules-available/baseconfig/lang/en/template-tags.json new file mode 100644 index 00000000..3609f6fa --- /dev/null +++ b/modules-available/baseconfig/lang/en/template-tags.json @@ -0,0 +1,27 @@ +{ + "lang_basicConfiguration": "Basic Configuration", + "lang_catPartition": "Partition Managment", + "lang_catUser": "User Managment", + "lang_clientRelatedConfig": "The options on this page are related to the bwLehrpool client machines.", + "lang_close": "Close", + "lang_confirm": "Would you like to save the settings on [ \/srv\/openslx\/www\/boot\/config ] ?", + "lang_create": "Create", + "lang_delete": "Delete", + "lang_help": "Help", + "lang_helpId": "Partition Id", + "lang_helpMountPoint": "Must be a directory: \/example\/directory\/", + "lang_helpOptions": "Currently, only option 'bootable' is available", + "lang_helpSize": "Must be in Gigabytes e.g. 15G", + "lang_newPartition": "New Partition", + "lang_newUser": "New User", + "lang_partitionId": "Id", + "lang_partitionMountPoint": "Mount Point", + "lang_partitionOptions": "Options", + "lang_partitionSize": "Size", + "lang_reset": "Reset", + "lang_resetConfirm": "Do you really wish to reset the variable to their default values?", + "lang_resetDefault": "Reset Default", + "lang_save": "Save", + "lang_userName": "Username", + "lang_userPasswd": "Password" +}
\ No newline at end of file diff --git a/modules-available/baseconfig/lang/en/templates/_page.json b/modules-available/baseconfig/lang/en/templates/_page.json deleted file mode 100644 index 6429a835..00000000 --- a/modules-available/baseconfig/lang/en/templates/_page.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "lang_basicConfiguration": "Basic Configuration", - "lang_clientRelatedConfig": "The options on this page are related to the bwLehrpool client machines.", - "lang_close": "Close", - "lang_reset": "Reset", - "lang_save": "Save" -}
\ No newline at end of file diff --git a/modules-available/baseconfig/lang/pt/module.json b/modules-available/baseconfig/lang/pt/module.json index 0ac0a075..dca9eb8b 100644 --- a/modules-available/baseconfig/lang/pt/module.json +++ b/modules-available/baseconfig/lang/pt/module.json @@ -1,27 +1,3 @@ { - "lang_basicConfiguration": "Configura\u00e7\u00e3o B\u00e1sica", - "lang_catPartition": "Gerenciamento de Parti\u00e7\u00f5es", - "lang_catUser": "Gerenciamente de Usu\u00e1rios", - "lang_close": "Fechar", - "lang_confirm": "Voc\u00ea deseja salvar configura\u00e7\u00f5es em [ \/srv\/openslx\/www\/boot\/default\/config ] ?", - "lang_create": "Criar", - "lang_delete": "Deletar", - "lang_help": "Ajuda", - "lang_helpId": "Id da parti\u00e7\u00e3o", - "lang_helpMountPoint": "Precisa ser um diret\u00f3rio: \/exemplo\/diret\u00f3rio\/", - "lang_helpOptions": "Atualmente, apenas a op\u00e7\u00e3o 'bootable' est\u00e1 dispon\u00edvel", - "lang_helpSize": "Precisa estar em Gigabytes, por exemplo 15G", - "lang_newPartition": "Nova Parti\u00e7\u00e3o", - "lang_newUser": "Novo Usu\u00e1rio", - "lang_partitionId": "Id", - "lang_partitionMountPoint": "Mount Point", - "lang_partitionOptions": "Op\u00e7\u00f5es", - "lang_partitionSize": "Tamanho", - "lang_reset": "Limpar", - "lang_resetConfirm": "Voc\u00ea realmente deseja restaurar as vari\u00e1veis para seus valores padr\u00f5es?", - "lang_resetDefault": "Restaurar Padr\u00e3o", - "lang_save": "Salvar", - "lang_userName": "Nome", - "lang_userPasswd": "Senha", "module_name": "Vari\u00e1veis" }
\ No newline at end of file diff --git a/modules-available/baseconfig/lang/pt/template-tags.json b/modules-available/baseconfig/lang/pt/template-tags.json new file mode 100644 index 00000000..1ab41b16 --- /dev/null +++ b/modules-available/baseconfig/lang/pt/template-tags.json @@ -0,0 +1,26 @@ +{ + "lang_basicConfiguration": "Configura\u00e7\u00e3o B\u00e1sica", + "lang_catPartition": "Gerenciamento de Parti\u00e7\u00f5es", + "lang_catUser": "Gerenciamente de Usu\u00e1rios", + "lang_close": "Fechar", + "lang_confirm": "Voc\u00ea deseja salvar configura\u00e7\u00f5es em [ \/srv\/openslx\/www\/boot\/default\/config ] ?", + "lang_create": "Criar", + "lang_delete": "Deletar", + "lang_help": "Ajuda", + "lang_helpId": "Id da parti\u00e7\u00e3o", + "lang_helpMountPoint": "Precisa ser um diret\u00f3rio: \/exemplo\/diret\u00f3rio\/", + "lang_helpOptions": "Atualmente, apenas a op\u00e7\u00e3o 'bootable' est\u00e1 dispon\u00edvel", + "lang_helpSize": "Precisa estar em Gigabytes, por exemplo 15G", + "lang_newPartition": "Nova Parti\u00e7\u00e3o", + "lang_newUser": "Novo Usu\u00e1rio", + "lang_partitionId": "Id", + "lang_partitionMountPoint": "Mount Point", + "lang_partitionOptions": "Op\u00e7\u00f5es", + "lang_partitionSize": "Tamanho", + "lang_reset": "Limpar", + "lang_resetConfirm": "Voc\u00ea realmente deseja restaurar as vari\u00e1veis para seus valores padr\u00f5es?", + "lang_resetDefault": "Restaurar Padr\u00e3o", + "lang_save": "Salvar", + "lang_userName": "Nome", + "lang_userPasswd": "Senha" +}
\ No newline at end of file |