summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-07 12:04:45 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-07 12:04:45 +0000
commit4d8b2d84d5635e0e718e9f66fcdf6e20587fbc2c (patch)
tree8c9b1a229b4d8fe3870caf1e008f5b879b6e49e2 /IkiWiki/Plugin
parent5d57a8436f2c41687cf047abf0cbd31af61de83c (diff)
more i18n improvements
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/aggregate.pm2
-rw-r--r--IkiWiki/Plugin/conditional.pm2
-rw-r--r--IkiWiki/Plugin/googlecalendar.pm2
-rw-r--r--IkiWiki/Plugin/img.pm14
-rw-r--r--IkiWiki/Plugin/linkmap.pm2
-rw-r--r--IkiWiki/Plugin/pagecount.pm1
-rw-r--r--IkiWiki/Plugin/shortcut.pm2
-rw-r--r--IkiWiki/Plugin/sparkline.pm16
-rw-r--r--IkiWiki/Plugin/table.pm6
-rw-r--r--IkiWiki/Plugin/template.pm4
10 files changed, 26 insertions, 25 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index a6f850236..b1b069b00 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -58,7 +58,7 @@ sub preprocess (@) { #{{{
foreach my $required (qw{name url}) {
if (! exists $params{$required}) {
- return "[[".sprintf(gettext("aggregate plugin missing %s parameter"), $required)."]]";
+ return "[[aggregate ".sprintf(gettext("missing %s parameter"), $required)."]]";
}
}
diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm
index 293fbc191..ed533109a 100644
--- a/IkiWiki/Plugin/conditional.pm
+++ b/IkiWiki/Plugin/conditional.pm
@@ -17,7 +17,7 @@ sub preprocess_if (@) { #{{{
my %params=@_;
if (! exists $params{test} || ! exists $params{then}) {
- return "[[if requires \"test\" and \"then\" parameters]]";
+ return "[[if ".gettext('"test" and "then" parameters are required')."]]";
}
my $result=0;
diff --git a/IkiWiki/Plugin/googlecalendar.pm b/IkiWiki/Plugin/googlecalendar.pm
index 7620384f5..3f5102210 100644
--- a/IkiWiki/Plugin/googlecalendar.pm
+++ b/IkiWiki/Plugin/googlecalendar.pm
@@ -19,7 +19,7 @@ sub preprocess (@) { #{{{
# Avoid XSS attacks..
my ($url)=$params{html}=~m#iframe\s+src="http://www\.google\.com/calendar/embed\?([^"<>]+)"#;
if (! defined $url || ! length $url) {
- return "[[".gettext("googlecalendar failed to find url in html")."]]";
+ return "[[googlecalendar ".gettext("failed to find url in html")."]]";
}
my ($height)=$params{html}=~m#height="(\d+)"#;
my ($width)=$params{html}=~m#width="(\d+)"#;
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index 9135c688f..0606f5001 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -32,7 +32,8 @@ sub preprocess (@) { #{{{
}
add_depends($params{page}, $image);
- my $file = bestlink($params{page}, $image) || return "[[img $image not found]]";
+ my $file = bestlink($params{page}, $image)
+ || return "[[img ".sprintf(gettext("%s not found"), $image)."]]";
my $dir = IkiWiki::dirname($file);
my $base = IkiWiki::basename($file);
@@ -45,21 +46,22 @@ sub preprocess (@) { #{{{
if ($size ne 'full') {
my ($w, $h) = ($size =~ /^(\d+)x(\d+)$/);
- return "[[img bad size \"$size\"]]" unless (defined $w && defined $h);
+ return "[[img ".sprintf(gettext('bad size "%s"'), $size)."]]"
+ unless (defined $w && defined $h);
my $outfile = "$config{destdir}/$dir/${w}x${h}-$base";
$imglink = "$dir/${w}x${h}-$base";
if (-e $outfile && (-M srcfile($file) >= -M $outfile)) {
$r = $im->Read($outfile);
- return "[[img failed to read $outfile: $r]]" if $r;
+ return "[[img ".sprintf(gettext("failed to read %s: %s"), $outfile, $r)."]]" if $r;
}
else {
$r = $im->Read(srcfile($file));
- return "[[img failed to read $file: $r]]" if $r;
+ return "[[img ".sprintf(gettext("failed to read %s: %s"), $file, $r)."]]" if $r;
$r = $im->Resize(geometry => "${w}x${h}");
- return "[[img failed to resize: $r]]" if $r;
+ return "[[img ".sprinftf(gettext("failed to resize: %s"), $r)."]]" if $r;
# don't actually write file in preview mode
if (! $params{preview}) {
@@ -74,7 +76,7 @@ sub preprocess (@) { #{{{
}
else {
$r = $im->Read(srcfile($file));
- return "[[img failed to read $file: $r]]" if $r;
+ return "[[img ".sprintf(gettext("failed to read %s: %s"), $file, $r)."]]" if $r;
$imglink = $file;
}
diff --git a/IkiWiki/Plugin/linkmap.pm b/IkiWiki/Plugin/linkmap.pm
index 528d51697..80257097a 100644
--- a/IkiWiki/Plugin/linkmap.pm
+++ b/IkiWiki/Plugin/linkmap.pm
@@ -96,7 +96,7 @@ sub genmap ($) { #{{{
waitpid $pid, 0;
$SIG{PIPE}="DEFAULT";
if ($sigpipe) {
- return "[[".gettext("linkmap failed to run dot")."]]";
+ return "[[linkmap ".gettext("failed to run dot")."]]";
}
return $ret;
diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm
index 5ba7ee50b..313ffdff0 100644
--- a/IkiWiki/Plugin/pagecount.pm
+++ b/IkiWiki/Plugin/pagecount.pm
@@ -1,5 +1,4 @@
#!/usr/bin/perl
-# Provides [[pagecount ]] to count the number of pages.
package IkiWiki::Plugin::pagecount;
use warnings;
diff --git a/IkiWiki/Plugin/shortcut.pm b/IkiWiki/Plugin/shortcut.pm
index 1f9d0a77a..7b89bf879 100644
--- a/IkiWiki/Plugin/shortcut.pm
+++ b/IkiWiki/Plugin/shortcut.pm
@@ -21,7 +21,7 @@ sub preprocess_shortcut (@) { #{{{
my %params=@_;
if (! defined $params{name} || ! defined $params{url}) {
- return "[[".gettext("shortcut missing name or url parameter")."]]";
+ return "[[shortcut ".gettext("missing name or url parameter")."]]";
}
hook(type => "preprocess", no_override => 1, id => $params{name},
diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm
index 63c2cf943..425b9826b 100644
--- a/IkiWiki/Plugin/sparkline.pm
+++ b/IkiWiki/Plugin/sparkline.pm
@@ -60,13 +60,13 @@ sub preprocess (@) { #{{{
}
}
elsif (! length $value) {
- return "[[".gettext("sparkline parse error")." \"$key\"]]";
+ return "[[sparkline ".gettext("parse error")." \"$key\"]]";
}
elsif ($key eq 'featurepoint') {
my ($x, $y, $color, $diameter, $text, $location)=
split(/\s*,\s*/, $value);
if (! defined $diameter || $diameter < 0) {
- return "[[".gettext("sparkline bad featurepoint diameter")."]]";
+ return "[[sparkline ".gettext("bad featurepoint diameter")."]]";
}
$x=int($x);
$y=int($y);
@@ -76,7 +76,7 @@ sub preprocess (@) { #{{{
if (defined $location) {
$location=$locmap{$location};
if (! defined $location) {
- return "[[".gettext("sparkline bad featurepoint location")."]]";
+ return "[[sparkline ".gettext("bad featurepoint location")."]]";
}
}
$php.=qq{\$sparkline->SetFeaturePoint($x, $y, '$color', $diameter};
@@ -87,23 +87,23 @@ sub preprocess (@) { #{{{
}
if ($c eq 0) {
- return "[[".gettext("sparkline missing values")."]]";
+ return "[[sparkline ".gettext("missing values")."]]";
}
my $height=int($params{height} || 20);
if ($height < 2 || $height > 100) {
- return "[[".gettext("sparkline bad height value")."]]";
+ return "[[sparkline ".gettext("bad height value")."]]";
}
if ($style eq "Bar") {
$php.=qq{\$sparkline->Render($height);\n};
}
else {
if (! exists $params{width}) {
- return "[[".gettext("sparkline missing width parameter")."]]";
+ return "[[sparkline ".gettext("missing width parameter")."]]";
}
my $width=int($params{width});
if ($width < 2 || $width > 1024) {
- return "[[".gettext("sparkline bad width value")."]]";
+ return "[[sparkline ".gettext("bad width value")."]]";
}
$php.=qq{\$sparkline->RenderResampled($width, $height);\n};
}
@@ -141,7 +141,7 @@ sub preprocess (@) { #{{{
waitpid $pid, 0;
$SIG{PIPE}="DEFAULT";
if ($sigpipe) {
- return "[[".gettext("sparkline failed to run php")."]]";
+ return "[[sparkline ".gettext("failed to run php")."]]";
}
if (! $params{preview}) {
diff --git a/IkiWiki/Plugin/table.pm b/IkiWiki/Plugin/table.pm
index e4d987dd3..c08087c71 100644
--- a/IkiWiki/Plugin/table.pm
+++ b/IkiWiki/Plugin/table.pm
@@ -31,7 +31,7 @@ sub preprocess (@) { #{{{
}
if (defined $params{file}) {
if (! $pagesources{$params{file}}) {
- return "[[table cannot find file]]";
+ return "[[table ".gettext("cannot find file")."]]";
}
$params{data} = readfile(srcfile($params{file}));
}
@@ -56,7 +56,7 @@ sub preprocess (@) { #{{{
@data=read_dsv(\%params);
}
else {
- return "[[table unknown data format]]";
+ return "[[table ".gettext("unknown data format")."]]";
}
my $header;
@@ -64,7 +64,7 @@ sub preprocess (@) { #{{{
$header=shift @data;
}
if (! @data) {
- return "[[table has empty data]]";
+ return "[[table ".gettext("empty data")."]]";
}
my $html = tidy_up(open_table(\%params, $header),
diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm
index 16a3c1e37..690443558 100644
--- a/IkiWiki/Plugin/template.pm
+++ b/IkiWiki/Plugin/template.pm
@@ -16,7 +16,7 @@ sub preprocess (@) { #{{{
my %params=@_;
if (! exists $params{id}) {
- return "[[".gettext("template missing id parameter")."]]";
+ return "[[template ".gettext("missing id parameter")."]]";
}
my $template_page="templates/$params{id}";
@@ -42,7 +42,7 @@ sub preprocess (@) { #{{{
);
};
if ($@) {
- return "[[".gettext("template failed to process:")." $@]]";
+ return "[[template ".gettext("failed to process:")." $@]]";
}
foreach my $param (keys %params) {