summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjhilden <jakobhilden@gmail.com>2009-08-28 20:53:06 -0400
committerjhilden <jakobhilden@gmail.com>2009-08-28 20:53:06 -0400
commitc234f9fd392d355bb7a143e28474bb689ed65e48 (patch)
treedec3a3c6eff4869440a796a1e79232008f56c1c2
parent1ce8643b8056266139552045fcdb48bbdb9c665b (diff)
improved translations admin interface
-rw-r--r--modules/gallery/controllers/l10n_client.php13
-rw-r--r--modules/gallery/views/admin_languages.html.php80
-rw-r--r--themes/admin_default/css/admin_screen.css12
3 files changed, 75 insertions, 30 deletions
diff --git a/modules/gallery/controllers/l10n_client.php b/modules/gallery/controllers/l10n_client.php
index 831c79c1..0775791e 100644
--- a/modules/gallery/controllers/l10n_client.php
+++ b/modules/gallery/controllers/l10n_client.php
@@ -90,10 +90,15 @@ class L10n_Client_Controller extends Controller {
}
$session = Session::instance();
- $session->set("l10n_mode",
- !$session->get("l10n_mode", false));
-
- url::redirect("albums/1");
+ $l10n_mode = $session->get("l10n_mode", false);
+ $session->set("l10n_mode", !$l10n_mode);
+
+ $redirect_url = "admin/languages";
+ if (!$l10n_mode) {
+ $redirect_url .= "#l10n-client";
+ }
+
+ url::redirect($redirect_url);
}
private static function _l10n_client_search_form() {
diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php
index fc3a87dc..4025437a 100644
--- a/modules/gallery/views/admin_languages.html.php
+++ b/modules/gallery/views/admin_languages.html.php
@@ -2,7 +2,7 @@
<div id="gLanguages">
<h1> <?= t("Languages") ?> </h1>
<p>
- <?= t("Here you can install new languages, update installed ones and set the default language for your Gallery.") ?>
+ <?= t("Install new languages, update installed ones and set the default language for your Gallery.") ?>
</p>
<form id="gLanguagesForm" method="post" action="<?= url::site("admin/languages/save") ?>">
@@ -40,31 +40,61 @@
</form>
<script type="text/javascript">
- var old_default_locale = "<?= $default_locale ?>";
-
- $("input[name='installed_locales[]']").change(function (event) {
- if (this.checked) {
- $("input[type='radio'][value='" + this.value + "']").enable();
- } else {
- if ($("input[type='radio'][value='" + this.value + "']").selected()) { // if you deselect your default language, switch to some other installed language
- $("input[type='radio'][value='" + old_default_locale + "']").attr("checked", "checked");
- }
- $("input[type='radio'][value='" + this.value + "']").attr("disabled", "disabled");
- }
- });
-
+ var old_default_locale = "<?= $default_locale ?>";
+
+ $("input[name='installed_locales[]']").change(function (event) {
+ if (this.checked) {
+ $("input[type='radio'][value='" + this.value + "']").enable();
+ } else {
+ if ($("input[type='radio'][value='" + this.value + "']").selected()) { // if you deselect your default language, switch to some other installed language
+ $("input[type='radio'][value='" + old_default_locale + "']").attr("checked", "checked");
+ }
+ $("input[type='radio'][value='" + this.value + "']").attr("disabled", "disabled");
+ }
+ });
+
$("#gLanguagesForm").ajaxForm({
- dataType: "json",
- success: function(data) {
- if (data.result == "success") {
- el = $('<a href="<?= url::site("admin/maintenance/start/gallery_task::update_l10n?csrf=$csrf") ?>"></a>'); // this is a little hack to trigger the update_l10n task in a dialog
- el.gallery_dialog();
- el.trigger('click');
- }
- }
- });
- </script>
+ dataType: "json",
+ success: function(data) {
+ if (data.result == "success") {
+ el = $('<a href="<?= url::site("admin/maintenance/start/gallery_task::update_l10n?csrf=$csrf") ?>"></a>'); // this is a little hack to trigger the update_l10n task in a dialog
+ el.gallery_dialog();
+ el.trigger('click');
+ }
+ }
+ });
+ </script>
+</div>
- <h2> <?= t("Your Own Translations") ?> </h2>
+<div id="gTranslations">
+ <h1> <?= t("Translations") ?> </h1>
+ <p>
+ <?= t("Create your own translations and share them with the rest of the Gallery community.") ?>
+ </p>
+
+ <h3><?= t("Translating Gallery") ?></h3>
+
+ <div class="gBlock">
+ <a href="http://codex.gallery2.org/Gallery3:Localization" target="_blank"
+ class="gDocLink ui-state-default ui-corner-all ui-icon ui-icon-help"
+ title="<?= t("Localization documentation") ?>">
+ <?= t("Localization documentation") ?>
+ </a>
+
+ <p><strong><?= t("Step 1") ?>:</strong> <?= t("Make sure the target language is installed and updated (check above).") ?></p>
+
+ <p><strong><?= t("Step 2") ?>:</strong> <?= t("Make sure the target language is the active one (currently '").locales::display_name()."')." ?></p>
+
+ <p><strong><?= t("Step 3") ?>:</strong> <?= t("Start the translation mode and the translation interface will appear at the bottom of each Gallery page.") ?></p>
+
+ <a href="<?= url::site("l10n_client/toggle_l10n_mode?csrf=".access::csrf_token()) ?>"
+ class="gButtonLink ui-state-default ui-corner-all ui-icon-left">
+ <span class="ui-icon ui-icon-power"></span>
+ <?= t((Session::instance()->get("l10n_mode", false)) ? "Stop translation mode" : "Start translation mode") ?>
+ </a>
+ </div>
+
+ <h3>Sharing your translations</h3>
+
<?= $share_translations_form ?>
</div>
diff --git a/themes/admin_default/css/admin_screen.css b/themes/admin_default/css/admin_screen.css
index 913631dc..3083114c 100644
--- a/themes/admin_default/css/admin_screen.css
+++ b/themes/admin_default/css/admin_screen.css
@@ -463,8 +463,18 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser {
background-color: #C5DBEC;
font-weight: bold;
}
-#gLanguagesForm input, #gShareTranslationsForm, #gLanguages h2 {
+#gLanguagesForm input {
clear: both;
}
+#gTranslations {
+ padding: 2em 0 0 0;
+ clear: both;
+}
+#gTranslations .gButtonLink {
+ padding: .5em;
+}
+.gDocLink {
+ float: right;
+}