diff options
author | dakkar <dakkar@luxion> | 2009-01-08 16:34:23 +0000 |
---|---|---|
committer | dakkar <dakkar@luxion> | 2009-01-08 16:34:23 +0000 |
commit | 74927a08f548ed3ce6bc330ddce605abb9a02a07 (patch) | |
tree | 1b4e82fdaa6cc8f43a51e0bd22649fc00bce52e7 | |
parent | e pure i feed multilnigua (diff) | |
download | WebCoso-74927a08f548ed3ce6bc330ddce605abb9a02a07.tar.gz WebCoso-74927a08f548ed3ce6bc330ddce605abb9a02a07.tar.bz2 WebCoso-74927a08f548ed3ce6bc330ddce605abb9a02a07.zip |
aggirato il problema dei titoli che in alcune lingue non esistono
git-svn-id: svn://luxion/repos/WebCoso/trunk@407 fcb26f47-9200-0410-b104-b98ab5b095f3
32 files changed, 231 insertions, 65 deletions
diff --git a/lib/WebCoso/Common.pm b/lib/WebCoso/Common.pm index 6c9a433..f01e739 100644 --- a/lib/WebCoso/Common.pm +++ b/lib/WebCoso/Common.pm @@ -8,6 +8,7 @@ use DateTime; use DateTime::Format::DateParse; use Log::Log4perl ':easy'; use List::MoreUtils 'uniq'; +use List::Util 'first'; our $SRCPATH='src'; our $DSTPATH='dst'; @@ -91,10 +92,23 @@ sub isLang { sub getTitleFor { my ($fc,$lang,$path,$name)=@_; DEBUG("getTitleFor($lang,$path,$name)"); - my $doc_name=srcXMLFor($lang,$path,$name); - DEBUG("getTitleFor -> $doc_name"); + my ($doc_name,$doc); + + if (ref($lang)) { # assume it's an array + for my $l (@$lang) { + $doc_name=srcXMLFor($l,$path,$name); + DEBUG("getTitleFor -> try $doc_name"); + $doc=$fc->get($doc_name); + last if $doc; + } + } + else { + $doc_name=srcXMLFor($lang,$path,$name); + DEBUG("getTitleFor -> $doc_name"); + + $doc=$fc->get($doc_name); + } - my $doc=$fc->get($doc_name); unless ($doc) { LOGWARN("No document for <$doc_name>, returning <$name>"); return "$name"; # force it to a string, since it might be an XML Node diff --git a/lib/WebCoso/XSLT.pm b/lib/WebCoso/XSLT.pm index 9cbeab0..28643c5 100644 --- a/lib/WebCoso/XSLT.pm +++ b/lib/WebCoso/XSLT.pm @@ -20,7 +20,7 @@ sub new { $self->{xslt_proc}=XML::LibXSLT->new(); $self->{xslt_proc}->register_function($NS,'title-for', - sub{$self->getTitleXML(WebCoso::Common::getTitleFor($self->{fc},@_))}); + sub{$self->getTitleForXML(@_)}); $self->{xslt_proc}->register_function($NS,'dst-uri-for', sub{WebCoso::Common::dstUriFor(@_)}); $self->{xslt_proc}->register_function($NS,'tagged',sub{$self->getTagsXML}); @@ -158,6 +158,29 @@ sub getDatesXML { } } +sub getTitleForXML { + my ($self,$lang,$path,$name)=@_; + + my $lang_cleaned; + if (ref($lang) && $lang->can('get_nodelist')) { + DEBUG('getTitleForXML with multple languages'); + for my $node ($lang->get_nodelist) { + my $val=$node->findvalue('normalize-space(string(.))'); + DEBUG(" <$val>"); + push @{$lang_cleaned},$val if length($val)>0; + } + } + else { + DEBUG('getTitleForXML with a single language'); + $lang_cleaned=$lang; + } + return $self->getTitleXML(WebCoso::Common::getTitleFor( + $self->{fc}, + $lang_cleaned, + $path, + $name)); +} + sub getTitleXML { my ($self,$title)=@_; diff --git a/t/test-site-output/bar/baz/document.en.html b/t/test-site-output/bar/baz/document.en.html index 7621bb1..93628a2 100644 --- a/t/test-site-output/bar/baz/document.en.html +++ b/t/test-site-output/bar/baz/document.en.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>bar-baz english </title></head><body><div><h1>bar-baz english </h1><p>sticaz @@ -15,7 +15,10 @@ </a> (<a href="/bar/baz/it">it</a> | en) </li></ul></dd><dt>Category 'two' -</dt><dd><ul><li><a href="/foo/">foo page +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (en) + </li><li><a href="/foo/">foo page </a> (<a href="/foo/it">it</a> | en) </li><li><a href="/bar/">bar (from template) @@ -23,4 +26,4 @@ (<a href="/bar/it">it</a> | en) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:24:24</div></body></html> diff --git a/t/test-site-output/bar/baz/document.it.html b/t/test-site-output/bar/baz/document.it.html index c257503..9c95c18 100644 --- a/t/test-site-output/bar/baz/document.it.html +++ b/t/test-site-output/bar/baz/document.it.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>bar-baz italiano </title></head><body><div><h1>bar-baz italiano </h1><p>sticaz @@ -14,11 +14,14 @@ </a> (it | <a href="/bar/baz/en">en</a>) </li></ul></dd><dt>Categoria 'two' -</dt><dd><ul><li><a href="/foo/">Pagina <em>foo</em></a> +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (<a href="/en-only/en">en</a>) + </li><li><a href="/foo/">Pagina <em>foo</em></a> (it | <a href="/foo/en">en</a>) </li><li><a href="/bar/">bar (generato) </a> (it | <a href="/bar/en">en</a>) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:24:24</div></body></html> diff --git a/t/test-site-output/bar/document.en.html b/t/test-site-output/bar/document.en.html index a84b6e8..05956e1 100644 --- a/t/test-site-output/bar/document.en.html +++ b/t/test-site-output/bar/document.en.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>bar (from template) </title></head><body><div><h1>bar (from template) </h1><ul><li>line 1 @@ -18,7 +18,10 @@ </a> (<a href="/bar/baz/it">it</a> | en) </li></ul></dd><dt>Category 'two' -</dt><dd><ul><li><a href="/foo/">foo page +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (en) + </li><li><a href="/foo/">foo page </a> (<a href="/foo/it">it</a> | en) </li><li><a href="/bar/">bar (from template) @@ -26,4 +29,4 @@ (<a href="/bar/it">it</a> | en) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:24:24</div></body></html> diff --git a/t/test-site-output/bar/document.it.html b/t/test-site-output/bar/document.it.html index f90b351..88418dd 100644 --- a/t/test-site-output/bar/document.it.html +++ b/t/test-site-output/bar/document.it.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>bar (generato) </title></head><body><div><h1>bar (generato) </h1><ul><li>line 1 @@ -17,11 +17,14 @@ </a> (it | <a href="/bar/baz/en">en</a>) </li></ul></dd><dt>Categoria 'two' -</dt><dd><ul><li><a href="/foo/">Pagina <em>foo</em></a> +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (<a href="/en-only/en">en</a>) + </li><li><a href="/foo/">Pagina <em>foo</em></a> (it | <a href="/foo/en">en</a>) </li><li><a href="/bar/">bar (generato) </a> (it | <a href="/bar/en">en</a>) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:24:24</div></body></html> diff --git a/t/test-site-output/document.en.html b/t/test-site-output/document.en.html index f88fe09..1725e9e 100644 --- a/t/test-site-output/document.en.html +++ b/t/test-site-output/document.en.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Main page </title></head><body><div><h1>Main page </h1><ul><li><a href="foo/">foo page @@ -15,7 +15,10 @@ </a> (<a href="/bar/baz/it">it</a> | en) </li></ul></dd><dt>Category 'two' -</dt><dd><ul><li><a href="/foo/">foo page +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (en) + </li><li><a href="/foo/">foo page </a> (<a href="/foo/it">it</a> | en) </li><li><a href="/bar/">bar (from template) @@ -23,4 +26,4 @@ (<a href="/bar/it">it</a> | en) </li></ul></dd></dl></div><div> Creato: 2008-03-01 10:04:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:24:24</div></body></html> diff --git a/t/test-site-output/document.it.html b/t/test-site-output/document.it.html index 8c17a42..cdb014b 100644 --- a/t/test-site-output/document.it.html +++ b/t/test-site-output/document.it.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Pagina principale </title></head><body><div><h1>Pagina principale </h1><ul><li><a href="foo/">Pagina <em>foo</em></a></li><li><a href="bar/">bar!</a></li><li><a href="bar/baz/">baz</a></li></ul></div><div><dl><dt>Categoria 'uno' @@ -13,11 +13,14 @@ </a> (it | <a href="/bar/baz/en">en</a>) </li></ul></dd><dt>Categoria 'two' -</dt><dd><ul><li><a href="/foo/">Pagina <em>foo</em></a> +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (<a href="/en-only/en">en</a>) + </li><li><a href="/foo/">Pagina <em>foo</em></a> (it | <a href="/foo/en">en</a>) </li><li><a href="/bar/">bar (generato) </a> (it | <a href="/bar/en">en</a>) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:24:24</div></body></html> diff --git a/t/test-site-output/en-only/document.en.html b/t/test-site-output/en-only/document.en.html new file mode 100644 index 0000000..ac7f65d --- /dev/null +++ b/t/test-site-output/en-only/document.en.html @@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>document in English +</title></head><body><div><h1>document in English +</h1><p>only in English! +</p></div><div><dl><dt>Category 'one' +</dt><dd><ul><li><a href="/bar/baz/">bar-baz english +</a> + (<a href="/bar/baz/it">it</a> | en) + </li><li><a href="/foo/">foo page +</a> + (<a href="/foo/it">it</a> | en) + </li></ul></dd><dt>Category 'three/bis' +</dt><dd><ul><li><a href="/bar/baz/">bar-baz english +</a> + (<a href="/bar/baz/it">it</a> | en) + </li></ul></dd><dt>Category 'two' +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (en) + </li><li><a href="/foo/">foo page +</a> + (<a href="/foo/it">it</a> | en) + </li><li><a href="/bar/">bar (from template) +</a> + (<a href="/bar/it">it</a> | en) + </li></ul></dd></dl></div><div> + Creato: 1970-01-01 00:00:00 + Ultima modifica: 2009-01-08 16:27:30</div></body></html> diff --git a/t/test-site-output/feed.it.xml b/t/test-site-output/feed.it.xml index 099020e..f8958ba 100644 --- a/t/test-site-output/feed.it.xml +++ b/t/test-site-output/feed.it.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE a:feed PUBLIC "" ""> -<a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" xml:base="http://www.thenautilus.net/"><a:author><a:name>Gianni Ceccarelli</a:name><a:email>dakkar@thenautilus.net</a:email></a:author><a:id>http://www.thenautilus.net/</a:id><a:link rel="alternate" type="text/html" href="http://www.thenautilus.net/"/><a:title type="text">thenautilus.net</a:title><a:updated>2008-03-01T09:37:45+0000</a:updated><a:entry><a:id/><a:updated>2007-09-09T11:18:59+0000</a:updated><a:link rel="alternate" type="text/html">/bar/baz/</a:link><a:title type="xhtml"><div xml:base="/bar/baz/">bar-baz italiano +<a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" xml:base="http://www.thenautilus.net/"><a:author><a:name>Gianni Ceccarelli</a:name><a:email>dakkar@thenautilus.net</a:email></a:author><a:id>http://www.thenautilus.net/</a:id><a:link rel="alternate" type="text/html" href="http://www.thenautilus.net/"/><a:title type="text">thenautilus.net</a:title><a:updated>2009-01-08T16:27:01+0000</a:updated><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2007-09-09T11:18:59+0000</a:updated><a:link rel="alternate" type="text/html" href="/bar/baz/"/><a:title type="xhtml"><div xml:base="/bar/baz/">bar-baz italiano </div></a:title><a:content type="xhtml"><div xml:base="/bar/baz/"><p>sticaz -</p></div></a:content><a:category term="one" label="Categoria 'uno'"/><a:category term="three/bis" label="Categoria 'three/bis'"/></a:entry><a:entry><a:id/><a:updated>2007-09-09T12:01:07+0000</a:updated><a:link rel="alternate" type="text/html">/bar/</a:link><a:title type="xhtml"><div xml:base="/bar/">bar (generato) +</p></div></a:content><a:category term="one" label="Categoria 'uno'"/><a:category term="three/bis" label="Categoria 'three/bis'"/></a:entry><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2007-09-09T12:01:07+0000</a:updated><a:link rel="alternate" type="text/html" href="/bar/"/><a:title type="xhtml"><div xml:base="/bar/">bar (generato) </div></a:title><a:content type="xhtml"><div xml:base="/bar/"><ul><li>line 1 </li><li>line 2 </li><li>line 3 </li></ul><p>link: <a href="baz/">bar-baz italiano -</a></p></div></a:content><a:category term="two" label="Categoria 'two'"/></a:entry><a:entry><a:id/><a:updated>2007-09-09T12:01:07+0000</a:updated><a:link rel="alternate" type="text/html">/</a:link><a:title type="xhtml"><div xml:base="/">Pagina principale -</div></a:title><a:content type="xhtml"><div xml:base="/"><ul><li><a href="foo/">Pagina <em>foo</em></a></li><li><a href="bar/">bar!</a></li><li><a href="bar/baz/">baz</a></li></ul></div></a:content></a:entry><a:entry><a:id/><a:updated>2008-01-02T13:55:03+0000</a:updated><a:link rel="alternate" type="text/html">/foo/</a:link><a:title type="xhtml"><div xml:base="/foo/">Pagina <em>foo</em></div></a:title><a:content type="xhtml"><div xml:base="/foo/"><p>foo +</a></p></div></a:content><a:category term="two" label="Categoria 'two'"/></a:entry><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2007-09-09T12:01:07+0000</a:updated><a:link rel="alternate" type="text/html" href="/"/><a:title type="xhtml"><div xml:base="/">Pagina principale +</div></a:title><a:content type="xhtml"><div xml:base="/"><ul><li><a href="foo/">Pagina <em>foo</em></a></li><li><a href="bar/">bar!</a></li><li><a href="bar/baz/">baz</a></li></ul></div></a:content></a:entry><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2008-01-02T13:55:03+0000</a:updated><a:link rel="alternate" type="text/html" href="/foo/"/><a:title type="xhtml"><div xml:base="/foo/">Pagina <em>foo</em></div></a:title><a:content type="xhtml"><div xml:base="/foo/"><p>foo </p></div></a:content><a:category term="one" label="Categoria 'uno'"/><a:category term="two" label="Categoria 'two'"/></a:entry></a:feed> diff --git a/t/test-site-output/foo/document.en.html b/t/test-site-output/foo/document.en.html index a69175e..7ac8437 100644 --- a/t/test-site-output/foo/document.en.html +++ b/t/test-site-output/foo/document.en.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>foo page </title></head><body><div><h1>foo page </h1><p>foo @@ -15,7 +15,10 @@ </a> (<a href="/bar/baz/it">it</a> | en) </li></ul></dd><dt>Category 'two' -</dt><dd><ul><li><a href="/foo/">foo page +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (en) + </li><li><a href="/foo/">foo page </a> (<a href="/foo/it">it</a> | en) </li><li><a href="/bar/">bar (from template) @@ -23,4 +26,4 @@ (<a href="/bar/it">it</a> | en) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:24:24</div></body></html> diff --git a/t/test-site-output/foo/document.it.html b/t/test-site-output/foo/document.it.html index 5a7fe12..f2720d3 100644 --- a/t/test-site-output/foo/document.it.html +++ b/t/test-site-output/foo/document.it.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Pagina foo</title></head><body><div><h1>Pagina <em>foo</em></h1><p>foo </p></div><div><dl><dt>Categoria 'uno' </dt><dd><ul><li><a href="/bar/baz/">bar-baz italiano @@ -12,11 +12,14 @@ </a> (it | <a href="/bar/baz/en">en</a>) </li></ul></dd><dt>Categoria 'two' -</dt><dd><ul><li><a href="/foo/">Pagina <em>foo</em></a> +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (<a href="/en-only/en">en</a>) + </li><li><a href="/foo/">Pagina <em>foo</em></a> (it | <a href="/foo/en">en</a>) </li><li><a href="/bar/">bar (generato) </a> (it | <a href="/bar/en">en</a>) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:24:24</div></body></html> diff --git a/t/test-site-output/tags/one/document.en.html b/t/test-site-output/tags/one/document.en.html index 99e7b46..0214576 100644 --- a/t/test-site-output/tags/one/document.en.html +++ b/t/test-site-output/tags/one/document.en.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Category 'one' </title></head><body><div><h1>Category 'one' </h1><ul><li><a href="/bar/baz/">bar-baz english @@ -16,7 +16,10 @@ </a> (<a href="/bar/baz/it">it</a> | en) </li></ul></dd><dt>Category 'two' -</dt><dd><ul><li><a href="/foo/">foo page +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (en) + </li><li><a href="/foo/">foo page </a> (<a href="/foo/it">it</a> | en) </li><li><a href="/bar/">bar (from template) @@ -24,4 +27,4 @@ (<a href="/bar/it">it</a> | en) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:30:06</div></body></html> diff --git a/t/test-site-output/tags/one/document.it.html b/t/test-site-output/tags/one/document.it.html index 57876be..046559b 100644 --- a/t/test-site-output/tags/one/document.it.html +++ b/t/test-site-output/tags/one/document.it.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Categoria 'uno' </title></head><body><div><h1>Categoria 'uno' </h1><ul><li><a href="/bar/baz/">bar-baz italiano @@ -14,11 +14,14 @@ </a> (it | <a href="/bar/baz/en">en</a>) </li></ul></dd><dt>Categoria 'two' -</dt><dd><ul><li><a href="/foo/">Pagina <em>foo</em></a> +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (<a href="/en-only/en">en</a>) + </li><li><a href="/foo/">Pagina <em>foo</em></a> (it | <a href="/foo/en">en</a>) </li><li><a href="/bar/">bar (generato) </a> (it | <a href="/bar/en">en</a>) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:30:06</div></body></html> diff --git a/t/test-site-output/tags/one/feed.en.xml b/t/test-site-output/tags/one/feed.en.xml index 2a88222..a33bebc 100644 --- a/t/test-site-output/tags/one/feed.en.xml +++ b/t/test-site-output/tags/one/feed.en.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE a:feed PUBLIC "" ""> -<a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xml:base="http://www.thenautilus.net/"><a:author><a:name>Gianni Ceccarelli</a:name><a:email>dakkar@thenautilus.net</a:email></a:author><a:id>http://www.thenautilus.net/</a:id><a:link rel="alternate" type="text/html" href="http://www.thenautilus.net/tags/one/"/><a:title type="text">thenautilus.net</a:title><a:updated>2008-03-01T09:37:45+0000</a:updated><a:entry><a:id/><a:updated>2007-09-09T11:18:59+0000</a:updated><a:link rel="alternate" type="text/html">/foo/</a:link><a:title type="xhtml"><div xml:base="/foo/">foo page +<a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xml:base="http://www.thenautilus.net/"><a:author><a:name>Gianni Ceccarelli</a:name><a:email>dakkar@thenautilus.net</a:email></a:author><a:id>http://www.thenautilus.net/</a:id><a:link rel="alternate" type="text/html" href="http://www.thenautilus.net/tags/one/"/><a:title type="text">thenautilus.net</a:title><a:updated>2009-01-08T16:27:01+0000</a:updated><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2007-09-09T11:18:59+0000</a:updated><a:link rel="alternate" type="text/html" href="/foo/"/><a:title type="xhtml"><div xml:base="/foo/">foo page </div></a:title><a:content type="xhtml"><div xml:base="/foo/"><p>foo -</p></div></a:content><a:category term="one" label="Category 'one'"/><a:category term="two" label="Category 'two'"/></a:entry><a:entry><a:id/><a:updated>2007-09-09T11:18:59+0000</a:updated><a:link rel="alternate" type="text/html">/bar/baz/</a:link><a:title type="xhtml"><div xml:base="/bar/baz/">bar-baz english +</p></div></a:content><a:category term="one" label="Category 'one'"/><a:category term="two" label="Category 'two'"/></a:entry><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2007-09-09T11:18:59+0000</a:updated><a:link rel="alternate" type="text/html" href="/bar/baz/"/><a:title type="xhtml"><div xml:base="/bar/baz/">bar-baz english </div></a:title><a:content type="xhtml"><div xml:base="/bar/baz/"><p>sticaz </p></div></a:content><a:category term="one" label="Category 'one'"/><a:category term="three/bis" label="Category 'three/bis'"/></a:entry></a:feed> diff --git a/t/test-site-output/tags/one/feed.it.xml b/t/test-site-output/tags/one/feed.it.xml index 42c77d0..d0be744 100644 --- a/t/test-site-output/tags/one/feed.it.xml +++ b/t/test-site-output/tags/one/feed.it.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE a:feed PUBLIC "" ""> -<a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" xml:base="http://www.thenautilus.net/"><a:author><a:name>Gianni Ceccarelli</a:name><a:email>dakkar@thenautilus.net</a:email></a:author><a:id>http://www.thenautilus.net/</a:id><a:link rel="alternate" type="text/html" href="http://www.thenautilus.net/tags/one/"/><a:title type="text">thenautilus.net</a:title><a:updated>2008-03-01T09:37:45+0000</a:updated><a:entry><a:id/><a:updated>2007-09-09T11:18:59+0000</a:updated><a:link rel="alternate" type="text/html">/bar/baz/</a:link><a:title type="xhtml"><div xml:base="/bar/baz/">bar-baz italiano +<a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" xml:base="http://www.thenautilus.net/"><a:author><a:name>Gianni Ceccarelli</a:name><a:email>dakkar@thenautilus.net</a:email></a:author><a:id>http://www.thenautilus.net/</a:id><a:link rel="alternate" type="text/html" href="http://www.thenautilus.net/tags/one/"/><a:title type="text">thenautilus.net</a:title><a:updated>2009-01-08T16:27:01+0000</a:updated><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2007-09-09T11:18:59+0000</a:updated><a:link rel="alternate" type="text/html" href="/bar/baz/"/><a:title type="xhtml"><div xml:base="/bar/baz/">bar-baz italiano </div></a:title><a:content type="xhtml"><div xml:base="/bar/baz/"><p>sticaz -</p></div></a:content><a:category term="one" label="Categoria 'uno'"/><a:category term="three/bis" label="Categoria 'three/bis'"/></a:entry><a:entry><a:id/><a:updated>2008-01-02T13:55:03+0000</a:updated><a:link rel="alternate" type="text/html">/foo/</a:link><a:title type="xhtml"><div xml:base="/foo/">Pagina <em>foo</em></div></a:title><a:content type="xhtml"><div xml:base="/foo/"><p>foo +</p></div></a:content><a:category term="one" label="Categoria 'uno'"/><a:category term="three/bis" label="Categoria 'three/bis'"/></a:entry><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2008-01-02T13:55:03+0000</a:updated><a:link rel="alternate" type="text/html" href="/foo/"/><a:title type="xhtml"><div xml:base="/foo/">Pagina <em>foo</em></div></a:title><a:content type="xhtml"><div xml:base="/foo/"><p>foo </p></div></a:content><a:category term="one" label="Categoria 'uno'"/><a:category term="two" label="Categoria 'two'"/></a:entry></a:feed> diff --git a/t/test-site-output/tags/three/bis/document.en.html b/t/test-site-output/tags/three/bis/document.en.html index 5e904c3..214641f 100644 --- a/t/test-site-output/tags/three/bis/document.en.html +++ b/t/test-site-output/tags/three/bis/document.en.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Category 'three/bis' </title></head><body><div><h1>Category 'three/bis' </h1><ul><li><a href="/bar/baz/">bar-baz english @@ -15,7 +15,10 @@ </a> (<a href="/bar/baz/it">it</a> | en) </li></ul></dd><dt>Category 'two' -</dt><dd><ul><li><a href="/foo/">foo page +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (en) + </li><li><a href="/foo/">foo page </a> (<a href="/foo/it">it</a> | en) </li><li><a href="/bar/">bar (from template) @@ -23,4 +26,4 @@ (<a href="/bar/it">it</a> | en) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:30:06</div></body></html> diff --git a/t/test-site-output/tags/three/bis/document.it.html b/t/test-site-output/tags/three/bis/document.it.html index 42d23fb..89f256c 100644 --- a/t/test-site-output/tags/three/bis/document.it.html +++ b/t/test-site-output/tags/three/bis/document.it.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Categoria 'three/bis' </title></head><body><div><h1>Categoria 'three/bis' </h1><ul><li><a href="/bar/baz/">bar-baz italiano @@ -14,11 +14,14 @@ </a> (it | <a href="/bar/baz/en">en</a>) </li></ul></dd><dt>Categoria 'two' -</dt><dd><ul><li><a href="/foo/">Pagina <em>foo</em></a> +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (<a href="/en-only/en">en</a>) + </li><li><a href="/foo/">Pagina <em>foo</em></a> (it | <a href="/foo/en">en</a>) </li><li><a href="/bar/">bar (generato) </a> (it | <a href="/bar/en">en</a>) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:30:06</div></body></html> diff --git a/t/test-site-output/tags/three/document.en.html b/t/test-site-output/tags/three/document.en.html index d769920..3286505 100644 --- a/t/test-site-output/tags/three/document.en.html +++ b/t/test-site-output/tags/three/document.en.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Category 'three' </title></head><body><div><h1>Category 'three' </h1></div><div><dl><dt>Category 'one' @@ -14,7 +14,10 @@ </a> (<a href="/bar/baz/it">it</a> | en) </li></ul></dd><dt>Category 'two' -</dt><dd><ul><li><a href="/foo/">foo page +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (en) + </li><li><a href="/foo/">foo page </a> (<a href="/foo/it">it</a> | en) </li><li><a href="/bar/">bar (from template) @@ -22,4 +25,4 @@ (<a href="/bar/it">it</a> | en) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:30:06</div></body></html> diff --git a/t/test-site-output/tags/three/document.it.html b/t/test-site-output/tags/three/document.it.html index 83f699e..f3fbbbc 100644 --- a/t/test-site-output/tags/three/document.it.html +++ b/t/test-site-output/tags/three/document.it.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Categoria 'three' </title></head><body><div><h1>Categoria 'three' </h1></div><div><dl><dt>Categoria 'uno' @@ -13,11 +13,14 @@ </a> (it | <a href="/bar/baz/en">en</a>) </li></ul></dd><dt>Categoria 'two' -</dt><dd><ul><li><a href="/foo/">Pagina <em>foo</em></a> +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (<a href="/en-only/en">en</a>) + </li><li><a href="/foo/">Pagina <em>foo</em></a> (it | <a href="/foo/en">en</a>) </li><li><a href="/bar/">bar (generato) </a> (it | <a href="/bar/en">en</a>) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:30:06</div></body></html> diff --git a/t/test-site-output/tags/two/document.en.html b/t/test-site-output/tags/two/document.en.html index 7667ba7..4fb702b 100644 --- a/t/test-site-output/tags/two/document.en.html +++ b/t/test-site-output/tags/two/document.en.html @@ -1,9 +1,10 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Category 'two' </title></head><body><div><h1>Category 'two' </h1><ul><li><a href="/bar/">bar (from template) </a></li><li><a href="/foo/">foo page +</a></li><li><a href="/en-only/">document in English </a></li></ul></div><div><dl><dt>Category 'one' </dt><dd><ul><li><a href="/bar/baz/">bar-baz english </a> @@ -16,7 +17,10 @@ </a> (<a href="/bar/baz/it">it</a> | en) </li></ul></dd><dt>Category 'two' -</dt><dd><ul><li><a href="/foo/">foo page +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (en) + </li><li><a href="/foo/">foo page </a> (<a href="/foo/it">it</a> | en) </li><li><a href="/bar/">bar (from template) @@ -24,4 +28,4 @@ (<a href="/bar/it">it</a> | en) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:30:06</div></body></html> diff --git a/t/test-site-output/tags/two/document.it.html b/t/test-site-output/tags/two/document.it.html index 12499d1..cbdc35b 100644 --- a/t/test-site-output/tags/two/document.it.html +++ b/t/test-site-output/tags/two/document.it.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wc="http://webcoso.thenautilus.net/" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Categoria 'two' </title></head><body><div><h1>Categoria 'two' </h1><ul><li><a href="/bar/">bar (generato) @@ -14,11 +14,14 @@ </a> (it | <a href="/bar/baz/en">en</a>) </li></ul></dd><dt>Categoria 'two' -</dt><dd><ul><li><a href="/foo/">Pagina <em>foo</em></a> +</dt><dd><ul><li><a href="/en-only/">document in English +</a> + (<a href="/en-only/en">en</a>) + </li><li><a href="/foo/">Pagina <em>foo</em></a> (it | <a href="/foo/en">en</a>) </li><li><a href="/bar/">bar (generato) </a> (it | <a href="/bar/en">en</a>) </li></ul></dd></dl></div><div> Creato: 1970-01-01 00:00:00 - Ultima modifica: 2008-10-01 13:11:30</div></body></html> + Ultima modifica: 2009-01-08 16:30:06</div></body></html> diff --git a/t/test-site-output/tags/two/feed.en.xml b/t/test-site-output/tags/two/feed.en.xml new file mode 100644 index 0000000..129e4c3 --- /dev/null +++ b/t/test-site-output/tags/two/feed.en.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE a:feed PUBLIC "" ""> +<a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xml:base="http://www.thenautilus.net/"><a:author><a:name>Gianni Ceccarelli</a:name><a:email>dakkar@thenautilus.net</a:email></a:author><a:id>http://www.thenautilus.net/</a:id><a:link rel="alternate" type="text/html" href="http://www.thenautilus.net/tags/two/"/><a:title type="text">thenautilus.net</a:title><a:updated>2009-01-08T16:27:01+0000</a:updated><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2007-09-09T11:18:59+0000</a:updated><a:link rel="alternate" type="text/html" href="/foo/"/><a:title type="xhtml"><div xml:base="/foo/">foo page +</div></a:title><a:content type="xhtml"><div xml:base="/foo/"><p>foo +</p></div></a:content><a:category term="one" label="Category 'one'"/><a:category term="two" label="Category 'two'"/></a:entry><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2007-09-09T12:01:07+0000</a:updated><a:link rel="alternate" type="text/html" href="/bar/"/><a:title type="xhtml"><div xml:base="/bar/">bar (from template) +</div></a:title><a:content type="xhtml"><div xml:base="/bar/"><ul><li>line 1 +</li><li>line 2 +</li><li>line 3 +</li></ul><p>link: <a href="baz/">bar-baz english +</a></p></div></a:content><a:category term="two" label="Category 'two'"/></a:entry><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2009-01-08T16:27:01+0000</a:updated><a:link rel="alternate" type="text/html" href="/en-only/"/><a:title type="xhtml"><div xml:base="/en-only/">document in English +</div></a:title><a:content type="xhtml"><div xml:base="/en-only/"><p>only in English! +</p></div></a:content><a:category term="two" label="Category 'two'"/></a:entry></a:feed> diff --git a/t/test-site-output/tags/two/feed.it.xml b/t/test-site-output/tags/two/feed.it.xml new file mode 100644 index 0000000..cdf3789 --- /dev/null +++ b/t/test-site-output/tags/two/feed.it.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE a:feed PUBLIC "" ""> +<a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" xml:base="http://www.thenautilus.net/"><a:author><a:name>Gianni Ceccarelli</a:name><a:email>dakkar@thenautilus.net</a:email></a:author><a:id>http://www.thenautilus.net/</a:id><a:link rel="alternate" type="text/html" href="http://www.thenautilus.net/tags/two/"/><a:title type="text">thenautilus.net</a:title><a:updated>2009-01-08T16:27:01+0000</a:updated><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2007-09-09T12:01:07+0000</a:updated><a:link rel="alternate" type="text/html" href="/bar/"/><a:title type="xhtml"><div xml:base="/bar/">bar (generato) +</div></a:title><a:content type="xhtml"><div xml:base="/bar/"><ul><li>line 1 +</li><li>line 2 +</li><li>line 3 +</li></ul><p>link: <a href="baz/">bar-baz italiano +</a></p></div></a:content><a:category term="two" label="Categoria 'two'"/></a:entry><a:entry><a:id>tag:thenautilus.net,</a:id><a:updated>2008-01-02T13:55:03+0000</a:updated><a:link rel="alternate" type="text/html" href="/foo/"/><a:title type="xhtml"><div xml:base="/foo/">Pagina <em>foo</em></div></a:title><a:content type="xhtml"><div xml:base="/foo/"><p>foo +</p></div></a:content><a:category term="one" label="Categoria 'uno'"/><a:category term="two" label="Categoria 'two'"/></a:entry></a:feed> diff --git a/t/test-site/src/common/base-feed.tt b/t/test-site/src/common/base-feed.tt index 2559f29..d91ec0e 100644 --- a/t/test-site/src/common/base-feed.tt +++ b/t/test-site/src/common/base-feed.tt @@ -19,7 +19,7 @@ <a:entry> [% IF changed.$doc.creation %]<a:published>[% df.format(changed.$doc.creation) %]</a:published>[% END %] [% IF changed.$doc.last_change %]<a:updated>[% df.format(changed.$doc.last_change) %]</a:updated>[% END %] - <a:id>[% atomIdFor(language,filename,dstUriFor(doc,filename)) %]</a:id> + <a:id>tag:thenautilus.net,[% atomIdFor(language,filename,dstUriFor(doc,filename)) %]</a:id> <a:PH>[% dstUriFor(doc,filename) %]</a:PH> </a:entry> [% END -%] diff --git a/t/test-site/src/common/du2html.xsl b/t/test-site/src/common/du2html.xsl index 8b73a82..cc4372b 100644 --- a/t/test-site/src/common/du2html.xsl +++ b/t/test-site/src/common/du2html.xsl @@ -1,7 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <x:stylesheet xmlns:x="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" + xmlns:e="http://exslt.org/common" xmlns:wc="http://webcoso.thenautilus.net/" + exclude-result-prefixes="wc e" version="1.0" > @@ -11,6 +13,23 @@ <x:param name="path"/> <x:param name="filename"/> + <x:variable name="langs-rtf"> + <x:choose> + <x:when test="$language = 'it'"> + <lang>it</lang> + <lang>en</lang> + </x:when> + <x:when test="$language = 'en'"> + <lang>en</lang> + <lang>it</lang> + </x:when> + <x:otherwise> <!-- uh? --> + <lang><x:value-of select="$language"/></lang> + </x:otherwise> + </x:choose> + </x:variable> + <x:variable name="langs" select="e:node-set($langs-rtf)/node()"/> + <x:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" indent="yes"/> @@ -39,7 +58,7 @@ <x:choose> <x:when test="@refuri and string(.)=string(@refuri)"> - <x:apply-templates select="wc:title-for($language,ancestor::document/@source,@refuri)"/> + <x:apply-templates select="wc:title-for($langs,ancestor::document/@source,@refuri)"/> </x:when> <x:otherwise> <x:apply-templates /> @@ -83,7 +102,7 @@ </x:template> <x:template match="wc:tag"> - <dt><x:apply-templates select="wc:title-for($language,$filename,concat('/tags/',@name,'/'))"/></dt> + <dt><x:apply-templates select="wc:title-for($langs,$filename,concat('/tags/',@name,'/'))"/></dt> <dd> <ul> <x:apply-templates/> @@ -93,7 +112,7 @@ <x:template match="wc:doc"> <li> - <a href="{@uri}"><x:apply-templates select="wc:title-for($language,$filename,@uri)"/></a> + <a href="{@uri}"><x:apply-templates select="wc:title-for($langs,$filename,@uri)"/></a> (<x:apply-templates/>) </li> </x:template> diff --git a/t/test-site/src/common/fillFeed.xsl b/t/test-site/src/common/fillFeed.xsl index 30d167b..593ff51 100644 --- a/t/test-site/src/common/fillFeed.xsl +++ b/t/test-site/src/common/fillFeed.xsl @@ -38,7 +38,7 @@ </x:template> <x:template match="a:PH"> - <a:link rel="alternate" type="text/html"><x:value-of select="."/></a:link> + <a:link rel="alternate" type="text/html" href="{.}"/> <a:title type="xhtml"> <div xml:base="{.}"> <x:apply-templates select="wc:title-for($language,$filename,.)/node()"/> diff --git a/t/test-site/src/en-only/document.en.rest.txt b/t/test-site/src/en-only/document.en.rest.txt new file mode 100644 index 0000000..d5028bd --- /dev/null +++ b/t/test-site/src/en-only/document.en.rest.txt @@ -0,0 +1,7 @@ +===================== + document in English +===================== +:tags: * two + +only in English! + diff --git a/t/test-site/src/en-only/du2html.xsl b/t/test-site/src/en-only/du2html.xsl new file mode 120000 index 0000000..bea6032 --- /dev/null +++ b/t/test-site/src/en-only/du2html.xsl @@ -0,0 +1 @@ +../common/du2html.xsl
\ No newline at end of file diff --git a/t/test-site/src/tags/two/feed.en.tt b/t/test-site/src/tags/two/feed.en.tt new file mode 120000 index 0000000..7af7c9e --- /dev/null +++ b/t/test-site/src/tags/two/feed.en.tt @@ -0,0 +1 @@ +../../common/base-feed.tt
\ No newline at end of file diff --git a/t/test-site/src/tags/two/feed.it.tt b/t/test-site/src/tags/two/feed.it.tt new file mode 120000 index 0000000..7af7c9e --- /dev/null +++ b/t/test-site/src/tags/two/feed.it.tt @@ -0,0 +1 @@ +../../common/base-feed.tt
\ No newline at end of file diff --git a/t/test-site/src/tags/two/fillFeed.xsl b/t/test-site/src/tags/two/fillFeed.xsl new file mode 120000 index 0000000..0ec1e81 --- /dev/null +++ b/t/test-site/src/tags/two/fillFeed.xsl @@ -0,0 +1 @@ +../../common/fillFeed.xsl
\ No newline at end of file |