From 79a5eef220054e8e2e3d1d278475bfe00bf0cdfd Mon Sep 17 00:00:00 2001 From: OliverKrueger Date: Fri, 23 Oct 2009 00:47:16 +0000 Subject: [PATCH] Item1918: added more MAKETEXTs and moved translations from JS to meta-tags. git-svn-id: http://svn.foswiki.org/trunk/TagsPlugin@5363 0b4bb1d4-4e5a-0410-9cc4-b2b747904278 --- data/System/TagsPluginUserSelector.txt | 4 ++-- data/System/TagsPluginViewsTagSearch.txt | 16 +++++++-------- data/System/TagsPluginWebSelector.txt | 4 ++-- lib/Foswiki/Plugins/TagsPlugin.pm | 14 +++++++++++++ pub/System/TagsPlugin/tagsplugin-base.js | 26 ++++++++++++------------ 5 files changed, 39 insertions(+), 25 deletions(-) diff --git a/data/System/TagsPluginUserSelector.txt b/data/System/TagsPluginUserSelector.txt index 64ebba8..11743ae 100644 --- a/data/System/TagsPluginUserSelector.txt +++ b/data/System/TagsPluginUserSelector.txt @@ -16,8 +16,8 @@ If you want to customize the "user buttons", this is the right place. ---++ Implementation -%STARTINCLUDE% Users: - %ICON{filter}% all +%STARTINCLUDE% %MAKETEXT{"Users"}%: + %ICON{filter}% %MAKETEXT{"all"}% %ICON{filter}% %SPACEOUT{"%WIKINAME%"}% %TAGGROUPS{format=" $percntICON{filter}$percnt $percntSPACEOUT{\"$group\"}$percnt" sep="$n" }%%STOPINCLUDE% diff --git a/data/System/TagsPluginViewsTagSearch.txt b/data/System/TagsPluginViewsTagSearch.txt index 80d47df..8f3e237 100644 --- a/data/System/TagsPluginViewsTagSearch.txt +++ b/data/System/TagsPluginViewsTagSearch.txt @@ -2,26 +2,26 @@ %META:TOPICPARENT{name="TagsPlugin"}% ----+++ list of everyone's tags on the current topic +---+++ %MAKETEXT{"list of everyone's tags on the current topic"}% %TAGSEARCH{ web="%BASEWEB%" topic="%BASETOPIC%" }% ----+++ list of %NOP%%WIKINAME%'s tags on the current topic +---+++ %MAKETEXT{"list of %NOP%%WIKINAME%'s tags on the current topic"}% %TAGSEARCH{ web="%BASEWEB%" topic="%BASETOPIC%" user="%WIKINAME%" }% ----+++ tag cloud of everyone's tags +---+++ %MAKETEXT{"tag cloud of everyone's tags"}% %TAGCLOUD{ terms="$percntTAGSEARCH{ query=\"tag\" format=\"$tag:$count\" sep=\", \" }$percnt" }% ----+++ tag cloud of everyone's tags on topic ?mytopic=%URLPARAM{"mytopic" default="undef"}% +---+++ %MAKETEXT{"tag cloud of everyone's tags on topic"}% ?mytopic=%URLPARAM{"mytopic" default="undef"}% %TAGCLOUD{ terms="$percntTAGSEARCH{ query=\"tag\" topic=\"$percntURLPARAM{mytopic}$percnt\" format=\"$tag:$count\" sep=\", \" }$percnt" }% ----+++ List of topics tagged with ?tag=%URLPARAM{tag}% (inverse tag lookup) +---+++ %MAKETEXT{"Inverse tag lookup: List of topics tagged with"}% ?tag=%URLPARAM{tag}% %TAGSEARCH{ query="topic" tag="%URLPARAM{tag}%" }% ----+++ Complete list by topics +---+++ %MAKETEXT{"Complete list by topics"}% %TAGSEARCH{ query="topic" - header="|*Tag*|*Topic*|*User*|$n" + header="|*%MAKETEXT{"Tag"}%*|*%MAKETEXT{"Topic"}%*|*%MAKETEXT{"User"}%*|$n" format="| $tag | [[$item][$item]] | $user |" sep="$n" }% - \ No newline at end of file + diff --git a/data/System/TagsPluginWebSelector.txt b/data/System/TagsPluginWebSelector.txt index 0535500..629f96f 100644 --- a/data/System/TagsPluginWebSelector.txt +++ b/data/System/TagsPluginWebSelector.txt @@ -16,8 +16,8 @@ If you want to customize the "web buttons", this is the right place. ---++ Implementation -%STARTINCLUDE% Webs: - %ICON{filter}% all +%STARTINCLUDE% %MAKETEXT{"Webs"}%: + %ICON{filter}% %MAKETEXT{"all"}% %FLEXWEBLIST{ webs="public, -Trash" format=" $percntICON{filter}$percnt $name" diff --git a/lib/Foswiki/Plugins/TagsPlugin.pm b/lib/Foswiki/Plugins/TagsPlugin.pm index 7dffce3..ff8e608 100644 --- a/lib/Foswiki/Plugins/TagsPlugin.pm +++ b/lib/Foswiki/Plugins/TagsPlugin.pm @@ -84,6 +84,20 @@ sub initPlugin { my $header = ''."\n"; $header .= ''."\n"; $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; + $header .= ''."\n"; $header .= ''."\n"; Foswiki::Func::addToHEAD('TAGSPLUGIN', "\n".$header ); diff --git a/pub/System/TagsPlugin/tagsplugin-base.js b/pub/System/TagsPlugin/tagsplugin-base.js index b370759..667efe2 100644 --- a/pub/System/TagsPlugin/tagsplugin-base.js +++ b/pub/System/TagsPlugin/tagsplugin-base.js @@ -95,7 +95,7 @@ $("#tagsplugin_dialog_details") .dialog('option', 'modal', true) .dialog('option', 'width', 460) - .dialog('option', 'title', 'Tag Details on '+tag) + .dialog('option', 'title', foswiki.tagsplugin.translation.TagDetailsOn+' '+tag) .dialog("open") .bind( 'dialogclose', @@ -167,19 +167,19 @@ tagsplugin_fe_refreshTagList(); break; case 400: - tagsplugin_alert("Assuming you are logged-in and assuming you provided a tag name you probably just revealed a software bug. I'm sorry about that. (400)"); + tagsplugin_alert( foswiki.tagsplugin.translation.Tag400 ); break; case 401: - tagsplugin_alert("According to my data, you are not logged in. Please log-in before you retry."); + tagsplugin_alert( foswiki.tagsplugin.translation.Tag401 ); break; case 403: - tagsplugin_alert("I'm sorry, but you are not allowed to do that."); + tagsplugin_alert( foswiki.tagsplugin.translation.Tag403 ); break; case 500: - tagsplugin_alert("Something beyond your sphere of influence went wrong. Most probably a problem with the database. May I kindly ask you to inform your administrator? Thank you."); + tagsplugin_alert( foswiki.tagsplugin.translation.Tag500 ); break; default: - tagsplugin_alert("Unknown error in tagsplugin_be_tag."); + tagsplugin_alert( foswiki.tagsplugin.translation.TagUnknown ); break; } $("#tagsplugin_processing img").hide(); @@ -202,22 +202,22 @@ tagsplugin_fe_refreshTagList(); break; case 400: - tagsplugin_alert("Assuming you are logged in you probably just revealed a software bug. I'm sorry about that. (400)"); + tagsplugin_alert( foswiki.tagsplugin.translation.Untag400 ); break; case 401: - tagsplugin_alert("According to my data, you are not logged in. Please log-in before you retry."); + tagsplugin_alert( foswiki.tagsplugin.translation.Untag401 ); break; case 403: - tagsplugin_alert("I'm sorry, but you are not allowed to do that."); + tagsplugin_alert( foswiki.tagsplugin.translation.Untag403 ); break; case 404: - tagsplugin_alert("I'm sorry, but either the tag or the topic does not exist."); + tagsplugin_alert( foswiki.tagsplugin.translation.Untag404 ); break; case 500: - tagsplugin_alert("Something beyond your sphere of influence went wrong. Most probably a problem with the database. May I kindly ask you to inform your administrator? Thank you."); + tagsplugin_alert( foswiki.tagsplugin.translation.Untag500 ); break; default: - tagsplugin_alert("Unknown error in tagsplugin_be_untag."); + tagsplugin_alert( foswiki.tagsplugin.translation.UntagUnknown ); break; } $("#tagsplugin_processing img").hide(); @@ -232,7 +232,7 @@ .html(text) .dialog('option', 'modal', true) .dialog('option', 'width', 460) - .dialog('option', 'title', 'May I kindly ask for your attention?') + .dialog('option', 'title', foswiki.tagsplugin.translation.Attention ) .dialog('option', 'buttons', { "Ok": function() { $(this).dialog("close"); } }) .dialog("open") .bind(