summaryrefslogtreecommitdiffstats
path: root/modules-available/translation
diff options
context:
space:
mode:
authorSimon Rettberg2016-05-11 19:00:30 +0200
committerSimon Rettberg2016-05-11 19:00:30 +0200
commit1cc1c2ed092c46eb35893c1d85accb24cf43d7f9 (patch)
tree95c1302f4a1ae441e174a1dca64133e2873f8297 /modules-available/translation
parentAdd PhpStorm prefs (diff)
downloadslx-admin-1cc1c2ed092c46eb35893c1d85accb24cf43d7f9.tar.gz
slx-admin-1cc1c2ed092c46eb35893c1d85accb24cf43d7f9.tar.xz
slx-admin-1cc1c2ed092c46eb35893c1d85accb24cf43d7f9.zip
Still working in modularization cleanup and refinement
Diffstat (limited to 'modules-available/translation')
-rw-r--r--modules-available/translation/lang/de/template-tags.json6
-rw-r--r--modules-available/translation/lang/en/template-tags.json5
-rw-r--r--modules-available/translation/page.inc.php14
-rw-r--r--modules-available/translation/templates/custom-list.html38
-rw-r--r--modules-available/translation/templates/edit.html6
-rw-r--r--modules-available/translation/templates/message-list.html54
-rw-r--r--modules-available/translation/templates/string-list.html38
-rw-r--r--modules-available/translation/templates/template-list.html48
8 files changed, 109 insertions, 100 deletions
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*[\'"](?<module>[^\'"\.]*)\.(?<tag>[^\'"]*)[\'"]\s*(?<data>\)|\,.*)/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 @@
-<div class="panel panel-default">
- <div class="panel-heading">
- {{subsection}}
- </div>
- <div class="panel-body">
- <div class="row">
- <div class="col-sm-6">
- {{#langs}}
- <a href="?do=Translation&amp;module={{module}}&amp;section=custom&amp;subsection={{subsection}}&amp;destlang={{cc}}">{{name}} &raquo;</a>
- <ul>
- <li>{{lang_missing}}: {{missing}}</li>
- <li>{{lang_unused}}: {{unused}}</li>
- </ul>
- {{/langs}}
- </div>
- <div class="col-sm-6">
- {{lang_tags}}: {{tagcount}}
+<div class="col-lg-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{subsection}}
+ </div>
+ <div class="panel-body">
+ <div class="row">
+ <div class="col-sm-6">
+ {{#langs}}
+ <a href="?do=Translation&amp;module={{module}}&amp;section=custom&amp;subsection={{subsection}}&amp;destlang={{cc}}">{{name}} &raquo;</a>
+ <ul>
+ <li>{{lang_missing}}: {{missing}}</li>
+ <li>{{lang_unused}}: {{unused}}</li>
+ </ul>
+ {{/langs}}
+ </div>
+ <div class="col-sm-6">
+ {{lang_tags}}: {{tagcount}}
+ </div>
</div>
</div>
</div>
-</div>
+</div> \ 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 @@
<input type="hidden" name="subsection" value="{{subsection}}">
<input type="hidden" name="token" value="{{token}}">
<a class="btn btn-primary" href='?do=Translation' >{{lang_back}}</a>
- <button class="btn btn-primary" type="button" onclick="addTag()" >{{lang_createTag}}</button>
+ <button class="btn btn-primary" type="button" onclick="slxAddTag()" >{{lang_createTag}}</button>
<button type="submit" class="btn btn-primary" name="update" value="true">{{lang_save}}</button>
<div class="row">
<div class="col-xs-4 col-sm-3">{{lang_tag}}</div>
@@ -54,7 +54,7 @@
<div class="col-xs-2 col-sm-2 col-lg-1">
<button type="button" class="btn btn-danger btn-xs" onclick="slxDelTag({{tagid}})" tabindex="-1">
<span class="glyphicon glyphicon-remove"></span>
- <span class="hidden-xs">{{lang_deleteTAG}}</span>
+ <span class="hidden-xs">{{lang_delete}}</span>
</button>
</div>
</div>
@@ -81,7 +81,7 @@
' <div class="hidden-xs col-sm-4">' +
' </div>' +
' <div class="col-xs-2 col-sm-1">' +
- ' <button type="button" class="btn btn-danger btn-xs" onclick="slxDelNew(' + slxNewTagCounter + ')"><span class="glyphicon glyphicon-remove"></span> {{lang_deleteTAG}}</button>' +
+ ' <button type="button" class="btn btn-danger btn-xs" onclick="slxDelNew(' + slxNewTagCounter + ')" tabindex="-1"><span class="glyphicon glyphicon-remove"></span> {{lang_delete}}</button>' +
' </div>' +
'</div>'
);
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 @@
-<div class="panel panel-default">
- <div class="panel-heading">
- {{lang_messages}}
- </div>
- <div class="panel-body">
- <div class="row">
- <div class="col-sm-6">
- {{#langs}}
- <a href="?do=Translation&amp;module={{module}}&amp;section=messages&amp;destlang={{cc}}">{{name}} &raquo;</a>
- <ul>
- <li>{{lang_missing}}: {{missing}}</li>
- <li>{{lang_unused}}: {{unused}}</li>
- </ul>
- {{/langs}}
- </div>
- <div class="col-sm-6">
- <div>{{lang_messages}}: {{messagecount}}</div>
- <ul>
- {{#files}}
- <li>{{file}}</li>
- {{/files}}
- </ul>
- <div>
- <span class="label label-info">{{lang_hint}}</span>
- {{lang_unusedUnreliableHint}}
+<div class="col-lg-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{lang_messages}}
+ </div>
+ <div class="panel-body">
+ <div class="row">
+ <div class="col-sm-6">
+ {{#langs}}
+ <a href="?do=Translation&amp;module={{module}}&amp;section=messages&amp;destlang={{cc}}">{{name}} &raquo;</a>
+ <ul>
+ <li>{{lang_missing}}: {{missing}}</li>
+ <li>{{lang_unused}}: {{unused}}</li>
+ </ul>
+ {{/langs}}
</div>
+ <div class="col-sm-6 slx-textpreview-200">
+ <div>{{lang_messages}}: {{messagecount}}</div>
+ <ul>
+ {{#files}}
+ <li>{{file}}</li>
+ {{/files}}
+ </ul>
+ </div>
+ </div>
+ <div>
+ <span class="label label-info">{{lang_hint}}</span>
+ {{lang_unusedUnreliableHint}}
</div>
</div>
</div>
-</div>
+</div> \ 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 @@
-<div class="panel panel-default">
- <div class="panel-heading">
- {{lang_otherStrings}}
- </div>
- <div class="panel-body">
- <div class="row">
- <div class="col-sm-6">
- {{#langs}}
- <a href="?do=Translation&amp;module={{module}}&amp;section=module&amp;destlang={{cc}}">{{name}} &raquo;</a>
- <ul>
- <li>{{lang_missing}}: {{missing}}</li>
- <li>{{lang_unused}}: {{unused}}</li>
- </ul>
- {{/langs}}
- </div>
- <div class="col-sm-6">
- {{lang_tags}}: {{tagcount}}
+<div class="col-lg-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{lang_otherStrings}}
+ </div>
+ <div class="panel-body">
+ <div class="row">
+ <div class="col-sm-6">
+ {{#langs}}
+ <a href="?do=Translation&amp;module={{module}}&amp;section=module&amp;destlang={{cc}}">{{name}} &raquo;</a>
+ <ul>
+ <li>{{lang_missing}}: {{missing}}</li>
+ <li>{{lang_unused}}: {{unused}}</li>
+ </ul>
+ {{/langs}}
+ </div>
+ <div class="col-sm-6">
+ {{lang_tags}}: {{tagcount}}
+ </div>
</div>
</div>
</div>
-</div>
+</div> \ 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 @@
-<div class="panel panel-default">
- <div class="panel-heading">
- {{lang_templates}}
- </div>
- <div class="panel-body">
- <div class="row">
- <div class="col-sm-6">
- {{#langs}}
- <a href="?do=Translation&amp;module={{module}}&amp;section=template&amp;destlang={{cc}}">{{name}} &raquo;</a>
- <ul>
- <li>{{lang_missing}}: {{missing}}</li>
- <li>{{lang_unused}}: {{unused}}</li>
- </ul>
- {{/langs}}
- </div>
- <div class="col-sm-6">
- {{lang_tags}}: {{tagcount}}
- <ul>
- {{#templates}}
- <li>{{template}}</li>
- {{/templates}}
- </ul>
+<div class="col-lg-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{lang_templates}}
+ </div>
+ <div class="panel-body">
+ <div class="row">
+ <div class="col-sm-6">
+ {{#langs}}
+ <a href="?do=Translation&amp;module={{module}}&amp;section=template&amp;destlang={{cc}}">{{name}} &raquo;</a>
+ <ul>
+ <li>{{lang_missing}}: {{missing}}</li>
+ <li>{{lang_unused}}: {{unused}}</li>
+ </ul>
+ {{/langs}}
+ </div>
+ <div class="col-sm-6">
+ {{lang_tags}}: {{tagcount}}
+ <ul>
+ {{#templates}}
+ <li>{{template}}</li>
+ {{/templates}}
+ </ul>
+ </div>
</div>
</div>
</div>
-</div>
+</div> \ No newline at end of file