From 82f9aff6a65b1acaeec6cfde9a2848cb9cb92e03 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 17 May 2015 11:16:17 +0200 Subject: started to localize the styler plugin --- lib/plugins/styler/admin.php | 37 +++++++++++++++++++++++++++--------- lib/plugins/styler/lang/en/intro.txt | 2 ++ lib/plugins/styler/lang/en/lang.php | 9 +++++++-- lib/plugins/styler/script.js | 2 +- 4 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 lib/plugins/styler/lang/en/intro.txt (limited to 'lib/plugins') diff --git a/lib/plugins/styler/admin.php b/lib/plugins/styler/admin.php index bb9426e12..bfc6cd32b 100644 --- a/lib/plugins/styler/admin.php +++ b/lib/plugins/styler/admin.php @@ -25,6 +25,15 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { return true; } + /** + * @param string $language + * @return string + */ + public function getMenuText($language) { + $js = $this->getLang('js'); + return $js['menu']; + } + /** * handle the different actions (also called from ajax) */ @@ -41,6 +50,7 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { */ public function html() { echo '
'; + ptln('

'.$this->getMenuText('').'

'); $this->form(false); echo '
'; } @@ -63,15 +73,13 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { $target = wl($ID, array('do' => 'admin', 'page' => 'styler')); } - ptln('

'.$this->getLang('menu').'

'); - if(empty($replacements)) { - echo '

Sorry, this template does not support this functionality.

'; + echo '

'.$this->getLang('error').'

'; } else { - echo '

Intro blah... for the currently active template ("'.$tpl.'")... not all variables preview...

'; + echo $this->locale_xhtml('intro'); echo '
'; - echo '

Template variables

'; + echo ''; foreach($replacements as $key => $value) { echo ''; @@ -80,11 +88,22 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { echo ''; } echo '
'; - echo ''; - echo ''; #FIXME only if preview.ini exists - echo ''; #FIXME only if local.ini exists - echo ''; + + echo '

'; + echo ''; + echo ''; #FIXME only if preview.ini exists + echo '

'; + + echo '

'; + echo ''; + echo '

'; + + echo '

'; + echo ''; #FIXME only if local.ini exists + echo '

'; + echo '
'; + } } diff --git a/lib/plugins/styler/lang/en/intro.txt b/lib/plugins/styler/lang/en/intro.txt new file mode 100644 index 000000000..bb9e3ff33 --- /dev/null +++ b/lib/plugins/styler/lang/en/intro.txt @@ -0,0 +1,2 @@ +This tool allows you to change certain style settings of your currently selected template +all changes are stored in a local configuration file and are upgrade safe. \ No newline at end of file diff --git a/lib/plugins/styler/lang/en/lang.php b/lib/plugins/styler/lang/en/lang.php index dfb472f11..2dd7921b0 100644 --- a/lib/plugins/styler/lang/en/lang.php +++ b/lib/plugins/styler/lang/en/lang.php @@ -6,10 +6,15 @@ */ // menu entry for admin plugins -// $lang['menu'] = 'Your menu entry'; +$lang['js']['menu'] = 'Template Style Settings'; // custom language strings for the plugin -// $lang['fixme'] = 'FIXME'; +$lang['error'] = 'Sorry, this template does not support this functionality.'; + +$lang['btn_preview'] = 'Preview your changes'; +$lang['btn_save'] = 'Save your changes'; +$lang['btn_reset'] = 'Reset your current changes'; +$lang['btn_revert'] = 'Revert all styles back to the template\'s default'; diff --git a/lib/plugins/styler/script.js b/lib/plugins/styler/script.js index b3cadfd5e..d472c4fe7 100644 --- a/lib/plugins/styler/script.js +++ b/lib/plugins/styler/script.js @@ -23,7 +23,7 @@ jQuery(function () { // open the dialog $dialog.dialog({ - 'title': 'Template Variables', + 'title': LANG.plugins.styler.menu, 'width': 500, 'top': 50, 'position': { 'my': 'left top', 'at': 'left top', 'of': window }, -- cgit v1.2.3