diff options
author | intrigeri <intrigeri@boum.org> | 2008-11-11 15:01:16 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2008-11-11 15:06:26 +0100 |
commit | cfe101fff9f4469c4765e81ec5bb0a0b2ca2bec0 (patch) | |
tree | 15c297e6f10fc7fcd1e3feb045615cb2a915fbcb /t | |
parent | 6b82ef44b07d19cd17dad3c26fe0a05715ffcb03 (diff) | |
download | ikiwiki-cfe101fff9f4469c4765e81ec5bb0a0b2ca2bec0.tar ikiwiki-cfe101fff9f4469c4765e81ec5bb0a0b2ca2bec0.tar.gz |
po: fixed link to homepage from non-translation page
Added testcases for this bug.
It remains broken when generated from <TMPL_VAR BASEURL>, though.
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 't')
-rwxr-xr-x | t/po.t | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -17,7 +17,7 @@ BEGIN { } } -use Test::More tests => 52; +use Test::More tests => 58; BEGIN { use_ok("IkiWiki"); } @@ -144,6 +144,17 @@ is(targetpage('test1.fr', 'html'), 'test1/index.fr.html', "$msgprefix test1.fr") is(targetpage('test3', 'html'), 'test3/index.html', "$msgprefix test3 (non-translatable page)"); is(targetpage('test3.es', 'html'), 'test3.es/index.html', "$msgprefix test3.es (non-translatable page)"); +### urlto -> index +$config{po_link_to}='current'; +$msgprefix="urlto (po_link_to=current)"; +is(urlto('', 'index'), './index.en.html', "$msgprefix index -> ''"); +is(urlto('', 'nontranslatable'), './../index.en.html', "$msgprefix nontranslatable -> ''"); +is(urlto('', 'translatable.fr'), './../index.fr.html', "$msgprefix translatable.fr -> ''"); +$msgprefix="urlto (po_link_to=negotiated)"; +is(urlto('', 'index'), './index.en.html', "$msgprefix index -> ''"); +is(urlto('', 'nontranslatable'), './../index.en.html', "$msgprefix nontranslatable -> ''"); +is(urlto('', 'translatable.fr'), './../index.fr.html', "$msgprefix translatable.fr -> ''"); + ### bestlink $config{po_link_to}='current'; $msgprefix="bestlink (po_link_to=current)"; |