aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2018-06-08 02:45:59 +0100
committerSteve McIntyre <steve@einval.com>2018-06-08 02:45:59 +0100
commit71c961157c9050457b7420dea87838e2e1749154 (patch)
tree94770a19cf5b71cd69f5b6cb3ed07ed74ce228c4
parent24a8bbc5bf2fd2fbe025f0baa536bf1126f83723 (diff)
Deal with translated pages including headers/footers/navbars etc.
If any of the included files use wml::debian::translation-check with a version, that over-rides the version defined in the start file and this can totally break the translation checks. The check is then made against the start file, but using the version defined in the included file. :-( Fix things up to allow for this *and* check the versions of both the start file *and* the included file: * Add a sym-link of translation-check.wml as "translation-check-inc.wml" to defeat wml's tracking of what files have been #use'd already. Otherwise we'll only check the included file and never check the start file. * Switch all the .inc files to use the new translation-check-inc.wml instead of translation-check.wml * Also add an extra argument "force_file" to allow the included files to declare their filename so *that* is checked instead of the start file Quite involved, but it works...
-rw-r--r--bulgarian/Bugs/footer.inc2
-rw-r--r--bulgarian/Bugs/pkgreport-opts.inc2
-rw-r--r--bulgarian/distrib/search_contents-form.inc2
-rw-r--r--bulgarian/distrib/search_packages-form.inc2
-rw-r--r--croatian/Bugs/otherpages.inc2
-rw-r--r--danish/blends/gis/navbar.inc2
-rw-r--r--danish/blends/hamradio/navbar.inc2
l---------english/template/debian/translation-check-inc.wml1
-rw-r--r--english/template/debian/translation-check.wml28
-rw-r--r--hungarian/Bugs/otherpages.inc2
-rw-r--r--romanian/blends/gis/navbar.inc3
-rw-r--r--romanian/blends/hamradio/navbar.inc2
12 files changed, 31 insertions, 19 deletions
diff --git a/bulgarian/Bugs/footer.inc b/bulgarian/Bugs/footer.inc
index cbb90abd2b1..952fc47c801 100644
--- a/bulgarian/Bugs/footer.inc
+++ b/bulgarian/Bugs/footer.inc
@@ -1,4 +1,4 @@
-#use wml::debian::translation-check translation="7d6a152a603ed4837e979269b73d047605208359"
+#use wml::debian::translation-check-inc translation="7d6a152a603ed4837e979269b73d047605208359" force_file="Bugs/footer.inc"
<hrline/>
<address>
diff --git a/bulgarian/Bugs/pkgreport-opts.inc b/bulgarian/Bugs/pkgreport-opts.inc
index 9c84c832ef0..dec3431518a 100644
--- a/bulgarian/Bugs/pkgreport-opts.inc
+++ b/bulgarian/Bugs/pkgreport-opts.inc
@@ -1,6 +1,6 @@
#use wml::debian::language_names
#use wml::debian::common_tags
-#use wml::debian::translation-check translation="6c09c87719ede90b6ec0d2e2480b1f57a54eb8f8"
+#use wml::debian::translation-check-inc translation="6c09c87719ede90b6ec0d2e2480b1f57a54eb8f8" force_file="Bugs/pkgreport-opts.inc"
<bind-gettext-domain domain="bugs" />
diff --git a/bulgarian/distrib/search_contents-form.inc b/bulgarian/distrib/search_contents-form.inc
index 3f23df119ea..658165e3b60 100644
--- a/bulgarian/distrib/search_contents-form.inc
+++ b/bulgarian/distrib/search_contents-form.inc
@@ -1,6 +1,6 @@
#use wml::debian::language_names
#use wml::debian::common_tags
-#use wml::debian::translation-check translation="a1e8656d43afe0da1fe31c91bbecc3ce19cd9da3"
+#use wml::debian::translation-check-inc translation="a1e8656d43afe0da1fe31c91bbecc3ce19cd9da3" force_file="distrib/search_contents-form.inc"
<bind-gettext-domain domain="distrib" />
diff --git a/bulgarian/distrib/search_packages-form.inc b/bulgarian/distrib/search_packages-form.inc
index 4bec631b334..501c89971d3 100644
--- a/bulgarian/distrib/search_packages-form.inc
+++ b/bulgarian/distrib/search_packages-form.inc
@@ -1,6 +1,6 @@
#use wml::debian::language_names
#use wml::debian::common_tags
-#use wml::debian::translation-check translation="c9572f22f4a5fc60f741c1ce9d1f15161bcde1ea"
+#use wml::debian::translation-check-inc translation="c9572f22f4a5fc60f741c1ce9d1f15161bcde1ea" force_file="distrib/search_packages-form.inc"
<bind-gettext-domain domain="distrib" />
diff --git a/croatian/Bugs/otherpages.inc b/croatian/Bugs/otherpages.inc
index da15cd65e0a..d96d71f563d 100644
--- a/croatian/Bugs/otherpages.inc
+++ b/croatian/Bugs/otherpages.inc
@@ -1,4 +1,4 @@
-#use wml::debian::translation-check translation="fce042d9dcdefa00f89c0eafd4e31a5a2d7ef7db"
+#use wml::debian::translation-check-inc translation="fce042d9dcdefa00f89c0eafd4e31a5a2d7ef7db" force_file="Bugs/otherpages.inc"
<p>Druge BTS stranice:
diff --git a/danish/blends/gis/navbar.inc b/danish/blends/gis/navbar.inc
index 75572612e38..fa994f9acda 100644
--- a/danish/blends/gis/navbar.inc
+++ b/danish/blends/gis/navbar.inc
@@ -1,5 +1,5 @@
#use wml::debian::blends::gis
-#use wml::debian::translation-check translation="ff9649c8aa2e1aa09d934c939de35d1476aabd4a"
+#use wml::debian::translation-check-inc translation="ff9649c8aa2e1aa09d934c939de35d1476aabd4a" force_file="blends/gis/navbar.inc"
{#alternate_navbar#:
<div id="second-nav">
diff --git a/danish/blends/hamradio/navbar.inc b/danish/blends/hamradio/navbar.inc
index a690a7668ad..0dd11038928 100644
--- a/danish/blends/hamradio/navbar.inc
+++ b/danish/blends/hamradio/navbar.inc
@@ -1,5 +1,5 @@
#use wml::debian::blends::hamradio
-#use wml::debian::translation-check translation="6e56b4e2dbb6e975651897056c57191cdc6f00b4"
+#use wml::debian::translation-check-inc translation="6e56b4e2dbb6e975651897056c57191cdc6f00b4" force_file="blends/hamradio/navbar.inc"
{#alternate_navbar#:
<div id="second-nav">
diff --git a/english/template/debian/translation-check-inc.wml b/english/template/debian/translation-check-inc.wml
new file mode 120000
index 00000000000..9e28241c1fa
--- /dev/null
+++ b/english/template/debian/translation-check-inc.wml
@@ -0,0 +1 @@
+translation-check.wml \ No newline at end of file
diff --git a/english/template/debian/translation-check.wml b/english/template/debian/translation-check.wml
index 6f2cd89a656..33c43107f33 100644
--- a/english/template/debian/translation-check.wml
+++ b/english/template/debian/translation-check.wml
@@ -5,10 +5,10 @@
# This file is used to track when translations go out-of-date, and it is
# used by including this in the head of the translated file:
#
-# #use wml::debian::translation-check translation="X.xx"
+# #use wml::debian::translation-check translation="XXXXXXXXXXXXXXXXXX"
#
-# where X.xx is the current GIT revision number of the file you have
-# translated.
+# where XXXXXXXXXXXXXXXXXX is the current git revision of the file you
+# have translated.
#
# There are also some additional parameters that you can use on the #use
# line:
@@ -19,13 +19,13 @@
# to the name in languages.wml
#
# mindelta="number"
-# which defines the maximum difference in GIT revisions before the
+# which defines the maximum difference in git revisions before the
# translation is considered aged. The default value is 1. For less important
# pages, set it to 2, which means that not every change is considered making
# the translation aged. The value for the <aged/> tag is displayed.
#
# maxdelta="number"
-# which defines the maximum difference in GIT revisions before the
+# which defines the maximum difference in git revisions before the
# translation is considered to be outdated (and the value of the <outdated/>
# tag is displayed). The default value is 5. For very important pages, set
# it to be less. A value of 1 means that every change is considered making
@@ -72,7 +72,7 @@ use Local::VCS ':all';
sub check_translation {
# Input parameters:
- my ($translation, $file, $original, $mindelta, $maxdelta) = @_;
+ my ($translation, $file, $original, $mindelta, $maxdelta, $force_file) = @_;
my $parents, $level, $relative_dir, $output;
my @relative_dir = ();
@@ -86,7 +86,7 @@ sub check_translation {
$min_versions = $mindelta || 1;
# Set this to >= 1 to get debugging output.
- # Remember, if you checkin to GIT this needs to be set to 0!
+ # Remember, if you commit to git this needs to be set to 0!
$debug = 0;
# This is the language code of the original (to make a link)
@@ -111,8 +111,18 @@ sub check_translation {
pop @relative_dir;
@relative_dir = reverse @relative_dir;
$relative_dir = join '/', @relative_dir;
- my $orig_file = "$parents/$original_dir/$relative_dir/$file";
+ my $orig_file = "$parents/$original_dir/$relative_dir/$file";
+ if (defined $force_file && length($force_file) > 1) {
+ if ($debug) {
+ print "Ignoring $file, forcing to $force_file instead\n";
+ print "original $orig_file\n";
+ }
+ $orig_file = "$parents/$original_dir/$force_file";
+ if ($debug) {
+ print "now $orig_file\n";
+ }
+ }
my $VCS = Local::VCS->new();
my %file_info = $VCS->file_info($orig_file);
$version = $file_info{'cmt_rev'};
@@ -157,7 +167,7 @@ sub check_translation {
# The call to the subroutine is done here
{#check_trans#:\
-<: check_translation ("$(translation)","$WML_SRC_FILENAME","$(original)","$(mindelta)","$(maxdelta)") :>\
+<: check_translation ("$(translation)","$WML_SRC_FILENAME","$(original)","$(mindelta)","$(maxdelta)","$(force_file)") :>\
:#check_trans#}
# This template was originally made by Javier Fernández-Sanguino, described
diff --git a/hungarian/Bugs/otherpages.inc b/hungarian/Bugs/otherpages.inc
index f3771aee34a..037dba951a5 100644
--- a/hungarian/Bugs/otherpages.inc
+++ b/hungarian/Bugs/otherpages.inc
@@ -1,4 +1,4 @@
-#use wml::debian::translation-check translation="c57eea2e295b4c8e57b0998c9edc22613239fa0f"
+#use wml::debian::translation-check-inc translation="c57eea2e295b4c8e57b0998c9edc22613239fa0f" force_file="Bugs/otherpages.inc"
<p>További oldalak:</p>
<ul>
diff --git a/romanian/blends/gis/navbar.inc b/romanian/blends/gis/navbar.inc
index a8784bdb1d6..876f751ec83 100644
--- a/romanian/blends/gis/navbar.inc
+++ b/romanian/blends/gis/navbar.inc
@@ -1,5 +1,5 @@
#use wml::debian::blends::gis
-#use wml::debian::translation-check translation="ff9649c8aa2e1aa09d934c939de35d1476aabd4a" maintainer="Ana Custura"
+#use wml::debian::translation-check-inc translation="ff9649c8aa2e1aa09d934c939de35d1476aabd4a" maintainer="Ana Custura" force_file="blends/gis/navbar.inc"
{#alternate_navbar#:
<div id="second-nav">
<p><a href="$(HOME)/blends/gis/">Debian&nbsp;GIS&nbsp;Blend</a></p>
@@ -23,3 +23,4 @@
</ul>
</div>
:#alternate_navbar#}
+
diff --git a/romanian/blends/hamradio/navbar.inc b/romanian/blends/hamradio/navbar.inc
index f748692fe7e..555a5cf5a6e 100644
--- a/romanian/blends/hamradio/navbar.inc
+++ b/romanian/blends/hamradio/navbar.inc
@@ -1,5 +1,5 @@
#use wml::debian::blends::hamradio
-#use wml::debian::translation-check translation="6e56b4e2dbb6e975651897056c57191cdc6f00b4" maintainer="Ana Custura"
+#use wml::debian::translation-check-inc translation="6e56b4e2dbb6e975651897056c57191cdc6f00b4" maintainer="Ana Custura" force_file="blends/hamradio/navbar.inc"
{#alternate_navbar#:
<div id="second-nav">
<p><a href="$(HOME)/blends/hamradio/">Debian&nbsp;Hamradio&nbsp;Blend</a></p>

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