aboutsummaryrefslogtreecommitdiffstats
path: root/stattrans.pl
diff options
context:
space:
mode:
authorDenis Barbier <barbier>2002-11-10 19:17:56 +0000
committerDenis Barbier <barbier>2002-11-10 19:17:56 +0000
commit51ba425dad07eae03ec4a9960fce13f0829587d7 (patch)
treee591df8043e68bc01e1b2e7082751216e45bf49b /stattrans.pl
parent0657d9dee5298a4fc15a264a6d2d8023f7522f9f (diff)
Do not abort when no translatable strings are found in PO files
CVS version numbers stattrans.pl: 1.41 -> 1.42
Diffstat (limited to 'stattrans.pl')
-rwxr-xr-xstattrans.pl12
1 files changed, 9 insertions, 3 deletions
diff --git a/stattrans.pl b/stattrans.pl
index 8cb267c06bf..5891b75fa68 100755
--- a/stattrans.pl
+++ b/stattrans.pl
@@ -214,9 +214,15 @@ foreach $lang (@search_in) {
$po_untranslated{$domain}{$lang} = ($line =~ /(\d+) untranslated/ ? $1 : "0");
$po_total{$domain} = $po_translated{$domain}{$lang} + $po_fuzzy{$domain}{$lang} + $po_untranslated{$domain}{$lang};
- $percent_po_t{$domain}{$lang} = int ($po_translated{$domain}{$lang}/$po_total{$domain} * 100 + .5);
- $percent_po_f{$domain}{$lang} = int ($po_fuzzy{$domain}{$lang}/$po_total{$domain} * 100 + .5);
- $percent_po_u{$domain}{$lang} = int ($po_untranslated{$domain}{$lang}/$po_total{$domain} * 100 + .5);
+ if ($po_total{$domain} > 0) {
+ $percent_po_t{$domain}{$lang} = int ($po_translated{$domain}{$lang}/$po_total{$domain} * 100 + .5);
+ $percent_po_f{$domain}{$lang} = int ($po_fuzzy{$domain}{$lang}/$po_total{$domain} * 100 + .5);
+ $percent_po_u{$domain}{$lang} = int ($po_untranslated{$domain}{$lang}/$po_total{$domain} * 100 + .5);
+ } else {
+ $percent_po_t{$domain}{$lang} = 0;
+ $percent_po_f{$domain}{$lang} = 0;
+ $percent_po_u{$domain}{$lang} = 0;
+ }
}
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy