[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Marking translations outdated
From: |
Ineiev |
Subject: |
Re: Marking translations outdated |
Date: |
Mon, 17 Jan 2011 19:51:36 +0000 |
User-agent: |
Thunderbird 2.0.0.14 (X11/20080501) |
Generally, are there any better ideas than inserting
<!--#include virtual="/server/outdated.$lang.html" -->
after
<!--#include virtual="/server/banner.$lang.html" -->
?
Ineiev wrote:
> Where /server/outdated.html might look like
> <!-- begin server/outdated.html -->
> <div class="outdated-notice">
> <p>Attention! This translation is likely to be out-of-date.</p>
> </div>
> <!-- end server/outdated.html -->
>
> The missing bits are the definition of outdated-notice class in some CSS
On fsfe.org this is done with a clause like this in their CSS:
div.outdated-notice {
border: 0.3em dashed red;
padding: 0.5em 0 1em 2.5em;
margin: 0 0 1.5em 0;
}
> The outdated translations are tracked via msgfmt --statistics;
> a note can be added to the HTML files after /server/banner.$lang.html
> this way:
>
> --- GNUmakefile.orig 2011-01-16 08:23:21.727324144 +0000
> +++ GNUmakefile 2011-01-16 08:47:11.699074394 +0000
...
I think this is a more working patch:
--- GNUmakefile.orig 2011-01-16 08:23:21.000000000 +0000
+++ GNUmakefile 2011-01-17 19:22:27.141333117 +0000
@@ -89,5 +89,6 @@
body-include-1 \
body-include-2 \
- footer-text
+ footer-text \
+ outdated
template-translated-base := $(addprefix $(template-dir)/,$(template-files))
template-pots := $(addsuffix .pot, \
@@ -176,5 +177,13 @@
define generate-html
$(PO4A_TRANSLATE) $(PO4A-XHTMLFLAGS) $(PO4A-TRANSLATEFLAGS) \
- --master $$< --po $$$$PO --localized $$$$OUT
+ --master $$< --po $$$$PO --localized $$$$OUT; \
+ $(MSGFMT) --statistics -o /dev/null $$$$PO 2>&1 \
+ | ($(EGREP) '(fuzzy|untranslated)' > /dev/null \
+ && ($(SED) --in-place \
+ "/^<!--#include virtual=\"\/server\/outdated/d;/^<!--#include
virtual=\"\/server\/banner/s%^\(.*\)$$$$%\1\n<!--#include
virtual=\"/server/outdated.$$$$LANG_CODE.html\" -->%" $$$$HTML; \
+ $(SED) --in-place \
+ "/^<!--#include virtual=\"\/server\/banner/s%^\(.*\)$$$$%\1\n<!--#include
virtual=\"/server/outdated.$$$$LANG_CODE.html\" -->%" $$$$OUT \
+ ) \
+ ) || true
endef
@@ -288,5 +297,6 @@
|| (touch $$$$PO ; exit 1)
$$(addfile)
- PO=$(template-dir)/po/$$(*F).$(1).po OUT=$$@ ; $(generate-html)
+ PO=$(template-dir)/po/$$(*F).$(1).po OUT=$$@ LANG_CODE=$(1) HTML=$$@; \
+ $(generate-html)
$(SED) --in-place \
':egin;N;$$$$!begin;s/\([ \t]*\n[ \t]*\)\{3,\}<!--/\n\n<!--/g' $$@
@@ -445,6 +455,6 @@
$(rootdir)/po/home.pot
$$(fixperm)
- PO=$(rootdir)/po/home.$(1).po OUT=$(rootdir)/po/home.$(1).m4 ; \
- $(generate-html)
+ PO=$(rootdir)/po/home.$(1).po OUT=$(rootdir)/po/home.$(1).m4 \
+ LANG_CODE=$(1) HTML=$$@ ; $(generate-html)
$(SED) --in-place \
"s/\(<gnun>m4_include(\`.*\)\([.]html')<\/gnun>\)/\1.$(1)\2/g" \
@@ -527,5 +537,5 @@
# is no real need to determine them and run the command conditionally.
$$(fixperm)
- PO=$(1).po OUT=$(1).m4 ; $(generate-html)
+ PO=$(1).po OUT=$(1).m4 LANG_CODE=$(2) HTML=$$@ ; $(generate-html)
$(SED) --in-place \
"s/\(<gnun>m4_include(\`.*\)\([.]html')<\/gnun>\)/\1.$(2)\2/g" $(1).m4