summaryrefslogtreecommitdiffstats
path: root/modules-available/main/hooks
diff options
context:
space:
mode:
authorSimon Rettberg2016-05-10 16:57:06 +0200
committerSimon Rettberg2016-05-10 16:57:06 +0200
commit2fa2bb665d8ca5e837147f85267f865f1b8b0503 (patch)
treeb2e49bb825e1cc421597a681351d04b97c91834c /modules-available/main/hooks
parentMessage string editing works now (diff)
downloadslx-admin-2fa2bb665d8ca5e837147f85267f865f1b8b0503.tar.gz
slx-admin-2fa2bb665d8ca5e837147f85267f865f1b8b0503.tar.xz
slx-admin-2fa2bb665d8ca5e837147f85267f865f1b8b0503.zip
Translating module strings and custom sections works
Diffstat (limited to 'modules-available/main/hooks')
-rw-r--r--modules-available/main/hooks/translation.inc.php30
1 files changed, 30 insertions, 0 deletions
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 @@
+<?php
+
+$HANDLER = array();
+
+/**
+ * List of valid subsections
+ */
+$HANDLER['subsections'] = array(
+ 'categories'
+);
+
+/*
+ * 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) {
+ $skip = strlen($module->getIdentifier()) + 1;
+ $want = array();
+ foreach (Module::getAll() as $module) {
+ $cat = $module->getCategory();
+ if (is_string($cat)) {
+ $want[substr($cat, $skip)] = true;
+ }
+ }
+ return $want;
+};