[Debian-l10n-devel] Improvements for "already translated" screen
victory
victory.deb at gmail.com
Wed May 11 19:28:46 UTC 2016
CAUTION: the patch is NOT TESTED in any way
saying just desc_id numbers is very unhelpful so let's make them links
the desc_id list becomes uniq as a spin-off
--
victory
no need to CC me :-)
---
>From 81de3f79cce4216a54afec89f053ff4d7bad1f2a Mon Sep 17 00:00:00 2001
From: victory <victory.deb at gmail.com>
Date: Thu, 12 May 2016 03:56:06 +0900
Subject: Improvements for already translated package: links to ddt.cgi, do
not repeat same numbers.
diff --git a/ddtss/ddts_lib.pm b/ddtss/ddts_lib.pm
index b64c0dc..44ad44e 100644
--- a/ddtss/ddts_lib.pm
+++ b/ddtss/ddts_lib.pm
@@ -378,6 +378,18 @@ sub get_untrans
status "WARNING: All found descriptions locked (force=$force)";
die "All descriptions for package $package already fetched by others\n";
} else {
+ my %d;
+ # saying just desc_id numbers is very unhelpful so let's make them links
+ # processing in reverse order so removing item do not affect next item
+ for ( my $i = $#all_descr - 1; $i > 0; $i-- ){
+ my $n = $all_descr[$i];
+ # these 3 lines makes @all_descr array uniq
+ splice (@all_descr, $i, 1) if ($d{$n});
+ next if ($d{$n});
+ $d{$n} = 1;
+
+ $all_descr[$i] = qq|<a href="ddt.cgi?desc_id=$n&language=$lang_postfix">$n</a>|;
+ }
status "WARNING: All found descriptions skipped (force=$force)";
die "All descriptions for package $package already translated (checked ".join(",", at all_descr).")\n";
}
More information about the Debian-l10n-devel
mailing list