# HG changeset patch # User Ruslan Ermilov # Date 1342776475 0 # Node ID 89a4e934d2078c74b2b8f46068920171359f636b # Parent 992a542565b1bcb737be3c02e57e91e76bcc149f Emit a warning with a link to English original if translation is outdated. diff --git a/GNUmakefile b/GNUmakefile --- a/GNUmakefile +++ b/GNUmakefile @@ -23,6 +23,8 @@ endef define XSLT xmllint --noout --valid $2 xsltproc -o $3 \ + $(shell f=`echo $2 | sed 's;^xml/[^/]*/;xml/en/;'`; \ + [ -f $$f ] && echo --stringparam ORIGIN "../$$f") \ $(shell echo $4 \ | sed -e "s/\([^= ]*\)=\([^= ]*\)/--param \1 \"'\2'\"/g") \ $1 $2 diff --git a/xml/i18n.xml b/xml/i18n.xml --- a/xml/i18n.xml +++ b/xml/i18n.xml @@ -19,6 +19,9 @@ This directive appeared in version This directive appeared in versions Alphabetical Index of Directives +This translation may be out of date. +Check the English version +for recent changes. @@ -33,6 +36,9 @@ Эта директива появилась в версии Эта директива появилась в версиях Алфавитный указатель директив +Этот перевод может быть устаревшим. +Смотрите английскую версию +для ознакомления с последними изменениями. diff --git a/xsls/article.xsls b/xsls/article.xsls --- a/xsls/article.xsls +++ b/xsls/article.xsls @@ -15,6 +15,7 @@ X:strip-space elements = "article sectio --> X:param XML = "'../xml'"; X:param YEAR; +X:param ORIGIN; X:var LINK = "/article/@link | /module/@link"; X:var LANG = "/article/@lang | /module/@lang"; diff --git a/xsls/body.xsls b/xsls/body.xsls --- a/xsls/body.xsls +++ b/xsls/body.xsls @@ -39,6 +39,27 @@ X:template body (lang) { + X:if "$ORIGIN and document($ORIGIN)/*/@rev and + (not(@rev) or @rev != document($ORIGIN)/*/@rev)" { + + + X:if "@lang = 'he'" { X:attribute "class" { X:text{ltr} } } + +
+ + X:if "document(concat($XML, '/i18n.xml')) + /i18n/text[@lang = $lang]/item[@id='outdated']" { + !! "document(concat($XML, '/i18n.xml')) + /i18n/text[@lang = $lang]/item[@id='outdated']"; + } else { + !! "document(concat($XML, '/i18n.xml')) + /i18n/text[@lang = 'en']/item[@id='outdated']"; + } + +
+
+ } + X:if "@toc = 'yes' and section[@id and @name]" {
X:for-each "section[@id and @name]" { diff --git a/xsls/link.xsls b/xsls/link.xsls --- a/xsls/link.xsls +++ b/xsls/link.xsls @@ -7,6 +7,10 @@ X:stylesheet { X:template = "img" { !!; } +X:template = "origin" { + !!; +} + X:template = "link[@url]" { X:if "count(node()) != 0" { !!; } else { !{@url} }