From 1cc1c2ed092c46eb35893c1d85accb24cf43d7f9 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 11 May 2016 19:00:30 +0200 Subject: Still working in modularization cleanup and refinement --- .../translation/lang/de/template-tags.json | 6 +-- .../translation/lang/en/template-tags.json | 5 +- modules-available/translation/page.inc.php | 14 ++++-- .../translation/templates/custom-list.html | 38 +++++++-------- modules-available/translation/templates/edit.html | 6 +-- .../translation/templates/message-list.html | 54 +++++++++++----------- .../translation/templates/string-list.html | 38 +++++++-------- .../translation/templates/template-list.html | 48 ++++++++++--------- 8 files changed, 109 insertions(+), 100 deletions(-) (limited to 'modules-available/translation') diff --git a/modules-available/translation/lang/de/template-tags.json b/modules-available/translation/lang/de/template-tags.json index 9b4da6bd..83871e46 100644 --- a/modules-available/translation/lang/de/template-tags.json +++ b/modules-available/translation/lang/de/template-tags.json @@ -1,8 +1,6 @@ { "lang_adminInfo": "Dies ist eine Liste aller Templates. Die \"Status\"-Spalte zeigt an, wenn f\u00fcr ein Template \u00fcbersetzungen fehlen, oder veraltete Tags definiert sind.", - "lang_back": "Zur\u00fcck", "lang_createTag": "Tag erstellen", - "lang_deleteTAG": "L\u00f6schen", "lang_editConfigModule": "Konfigurationsmodulbezeichnungsphrasen editieren", "lang_editHardcoded": "Hardcoded-Texte bearbeiten", "lang_editMessages": "Nachrichten bearbeiten", @@ -11,7 +9,6 @@ "lang_editTemplates": "Template-Texte bearbeiten", "lang_global": "Global", "lang_globalTooltip": "Dieser Tag ist global verf\u00fcgbar und braucht normalerweise nicht explizit f\u00fcr dieses Modul \u00fcbersetzt zu werden", - "lang_hint": "Hinweis", "lang_langAdministration": "Templates", "lang_mainHeading": "\u00dcbersetzungen verwalten", "lang_messages": "Benachrichtigungen", @@ -19,7 +16,6 @@ "lang_module": "Modul", "lang_otherStrings": "Andere Texte", "lang_sample": "Beispiel", - "lang_save": "Speichern", "lang_status": "Status", "lang_tag": "Tag", "lang_tags": "Tags", @@ -29,5 +25,5 @@ "lang_translation": "\u00dcbersetzung", "lang_translationHeading": "Verwalten der \u00dcbersetzungen", "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." + "lang_unusedUnreliableHint": "Die Erkennung ungenutzter 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 1b5e6dc8..75564bc3 100644 --- a/modules-available/translation/lang/en/template-tags.json +++ b/modules-available/translation/lang/en/template-tags.json @@ -1,8 +1,6 @@ { "lang_adminInfo": "This is a list of all templates. The \"status\"-column tells if there are translations missing, or unused tags are defined.", - "lang_back": "Back", "lang_createTag": "Create TAG", - "lang_deleteTAG": "Delete", "lang_editConfigModule": "Edit config module strings", "lang_editHardcoded": "Edit hardcoded strings", "lang_editMessages": "Edit Messages", @@ -11,7 +9,6 @@ "lang_editTemplates": "Edit template strings", "lang_global": "Global", "lang_globalTooltip": "This tag is global; usually there is no need to translate it explicitly for this module", - "lang_hint": "Notice", "lang_langAdministration": "Templates", "lang_mainHeading": "Translation management", "lang_messages": "Messages", @@ -19,7 +16,6 @@ "lang_module": "Module", "lang_otherStrings": "Other strings", "lang_sample": "Sample", - "lang_save": "Save", "lang_status": "Status", "lang_tag": "Tag", "lang_tags": "Tags", @@ -27,6 +23,7 @@ "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_translationHeading": "Manage translations", "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 f3474acd..1fc3a0fe 100644 --- a/modules-available/translation/page.inc.php +++ b/modules-available/translation/page.inc.php @@ -205,6 +205,7 @@ class Page_Translation extends Page 'module' => $this->module->getIdentifier(), 'moduleName' => $this->module->getDisplayName() )); + Render::openTag('div', array('class' => 'row')); // Templates $this->showModuleTemplates(); // Messages @@ -213,6 +214,7 @@ class Page_Translation extends Page $this->showModuleStrings(); // Module specific $this->showModuleCustom(); + Render::closeTag('div'); } private function showModuleTemplates() @@ -403,8 +405,13 @@ class Page_Translation extends Page if ($module === false) { $module = $this->module; } + $allFiles = $this->getAllFiles('modules', '.php'); + if ($module->getIdentifier() === 'main') { + $allFiles = array_merge($allFiles, $this->getAllFiles('apis', '.php'), $this->getAllFiles('inc', '.php')); + $allFiles[] = 'index.php'; + } $tags = $this->loadTagsFromPhp('/Message\s*::\s*add\w+\s*\(\s*[\'"](?[^\'"\.]*)\.(?[^\'"]*)[\'"]\s*(?\)|\,.*)/i', - $this->getAllFiles('modules', '.php')); + $allFiles); // Filter out tags that don't refer to this module foreach (array_keys($tags) as $tag) { // Figure out if this is a message from this module or not @@ -869,6 +876,7 @@ class Page_Translation extends Page } Message::addError('invalid-section', $this->section); $this->redirect(1); + return false; } /** @@ -878,7 +886,7 @@ class Page_Translation extends Page { $this->ensureValidDestLanguage(); if ($this->module === false) { - Message::addError('main.no-module-given'); + Message::addError('no-module-given'); $this->redirect(); } $file = $this->getJsonFile(); @@ -906,7 +914,7 @@ class Page_Translation extends Page $translation = Request::post('new-text', array(), 'array'); foreach (Request::post('new-id', array(), 'array') as $k => $tag) { - if (empty($translation[$k])) + if (empty($translation[$k]) || empty($tag)) continue; $data[(string)$tag] = (string)$translation[$k]; } diff --git a/modules-available/translation/templates/custom-list.html b/modules-available/translation/templates/custom-list.html index 42ee98ad..ee9463f0 100644 --- a/modules-available/translation/templates/custom-list.html +++ b/modules-available/translation/templates/custom-list.html @@ -1,21 +1,23 @@ -
-
- {{subsection}} -
-
-
-
- {{#langs}} - {{name}} » -
    -
  • {{lang_missing}}: {{missing}}
  • -
  • {{lang_unused}}: {{unused}}
  • -
- {{/langs}} -
-
- {{lang_tags}}: {{tagcount}} +
+
+
+ {{subsection}} +
+
+
+
+ {{#langs}} + {{name}} » +
    +
  • {{lang_missing}}: {{missing}}
  • +
  • {{lang_unused}}: {{unused}}
  • +
+ {{/langs}} +
+
+ {{lang_tags}}: {{tagcount}} +
-
+
\ No newline at end of file diff --git a/modules-available/translation/templates/edit.html b/modules-available/translation/templates/edit.html index af176c03..082e2cb5 100644 --- a/modules-available/translation/templates/edit.html +++ b/modules-available/translation/templates/edit.html @@ -14,7 +14,7 @@ {{lang_back}} - +
{{lang_tag}}
@@ -54,7 +54,7 @@
@@ -81,7 +81,7 @@ ' ' + '
' + - ' ' + + ' ' + '
' + '
' ); diff --git a/modules-available/translation/templates/message-list.html b/modules-available/translation/templates/message-list.html index 06cb4964..7e611a05 100644 --- a/modules-available/translation/templates/message-list.html +++ b/modules-available/translation/templates/message-list.html @@ -1,30 +1,32 @@ -
-
- {{lang_messages}} -
-
-
-
- {{#langs}} - {{name}} » -
    -
  • {{lang_missing}}: {{missing}}
  • -
  • {{lang_unused}}: {{unused}}
  • -
- {{/langs}} -
-
-
{{lang_messages}}: {{messagecount}}
-
    - {{#files}} -
  • {{file}}
  • - {{/files}} -
-
- {{lang_hint}} - {{lang_unusedUnreliableHint}} +
+
+
+ {{lang_messages}} +
+
+
+
+ {{#langs}} + {{name}} » +
    +
  • {{lang_missing}}: {{missing}}
  • +
  • {{lang_unused}}: {{unused}}
  • +
+ {{/langs}}
+
+
{{lang_messages}}: {{messagecount}}
+
    + {{#files}} +
  • {{file}}
  • + {{/files}} +
+
+
+
+ {{lang_hint}} + {{lang_unusedUnreliableHint}}
-
+
\ No newline at end of file diff --git a/modules-available/translation/templates/string-list.html b/modules-available/translation/templates/string-list.html index f1301494..064e0ccf 100644 --- a/modules-available/translation/templates/string-list.html +++ b/modules-available/translation/templates/string-list.html @@ -1,21 +1,23 @@ -
-
- {{lang_otherStrings}} -
-
-
-
- {{#langs}} - {{name}} » -
    -
  • {{lang_missing}}: {{missing}}
  • -
  • {{lang_unused}}: {{unused}}
  • -
- {{/langs}} -
-
- {{lang_tags}}: {{tagcount}} +
+
+
+ {{lang_otherStrings}} +
+
+
+
+ {{#langs}} + {{name}} » +
    +
  • {{lang_missing}}: {{missing}}
  • +
  • {{lang_unused}}: {{unused}}
  • +
+ {{/langs}} +
+
+ {{lang_tags}}: {{tagcount}} +
-
+
\ No newline at end of file diff --git a/modules-available/translation/templates/template-list.html b/modules-available/translation/templates/template-list.html index 5d3689ad..2de7c2f8 100644 --- a/modules-available/translation/templates/template-list.html +++ b/modules-available/translation/templates/template-list.html @@ -1,26 +1,28 @@ -
-
- {{lang_templates}} -
-
-
-
- {{#langs}} - {{name}} » -
    -
  • {{lang_missing}}: {{missing}}
  • -
  • {{lang_unused}}: {{unused}}
  • -
- {{/langs}} -
-
- {{lang_tags}}: {{tagcount}} -
    - {{#templates}} -
  • {{template}}
  • - {{/templates}} -
+
+
+
+ {{lang_templates}} +
+
+
+
+ {{#langs}} + {{name}} » +
    +
  • {{lang_missing}}: {{missing}}
  • +
  • {{lang_unused}}: {{unused}}
  • +
+ {{/langs}} +
+
+ {{lang_tags}}: {{tagcount}} +
    + {{#templates}} +
  • {{template}}
  • + {{/templates}} +
+
-
+
\ No newline at end of file -- cgit v1.2.3-55-g7522