po: cosmetic changes to percent translated display
authorintrigeri <intrigeri@boum.org>
Fri, 2 Jan 2009 11:35:46 +0000 (12:35 +0100)
committerintrigeri <intrigeri@boum.org>
Fri, 2 Jan 2009 11:36:07 +0000 (12:36 +0100)
Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/po.pm

index c8b5e8fdef481b2dc9ba35afe22e5b89bb1d9a1e..61331edebf3a2c6a67fa709fb14defbf783d1d34 100644 (file)
@@ -541,7 +541,7 @@ sub mynicepagetitle ($;$) {
        my $res = $origsubs{'nicepagetitle'}->($page, $unescaped);
        return $res unless istranslation($page);
        return $res unless $config{po_translation_status_in_links};
-       return $res.' ('.percenttranslated($page).' %)';
+       return $res.' ('.percenttranslated($page).'&nbsp;%)';
 }
 
 # ,----
@@ -795,6 +795,7 @@ sub percenttranslated ($) {
                'file_out_charset' => 'utf-8',
        ) or error("[po/percenttranslated:$page]: failed to translate");
        my ($percent,$hit,$queries) = $doc->stats();
+       $percent =~ s/\.[0-9]+$//;
        return $percent;
 }