diff options
author | intrigeri <intrigeri@boum.org> | 2009-06-06 14:03:40 +0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2009-06-06 14:03:40 +0200 |
commit | 86edd73d169600875a10a635ef8df4a644545b0d (patch) | |
tree | 1216eb826f2da7a1c11d84395f25468d1acfa69c /doc/bugs/unwanted_discussion_links_on_discussion_pages.mdwn | |
parent | 17b3d73f6e65d6a754633902b0dd4716d53b03a9 (diff) | |
parent | e40d2a6b2b1bdf677f11cc4a71595acf609d1e75 (diff) |
Merge commit 'upstream/master' into pub/po
Conflicts:
debian/changelog
debian/control
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'doc/bugs/unwanted_discussion_links_on_discussion_pages.mdwn')
-rw-r--r-- | doc/bugs/unwanted_discussion_links_on_discussion_pages.mdwn | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/bugs/unwanted_discussion_links_on_discussion_pages.mdwn b/doc/bugs/unwanted_discussion_links_on_discussion_pages.mdwn new file mode 100644 index 000000000..c74a094ce --- /dev/null +++ b/doc/bugs/unwanted_discussion_links_on_discussion_pages.mdwn @@ -0,0 +1,36 @@ +Background: some po translations (amongst which `fr.po`) translate "discussion" to an upper-cased word (in French: "Discussion"). +By the way, this is wished e.g. in German, where such a noun has to be written with an upper-cased "D", but I can not see +the logic behind the added "D" in French. + +Anyway, this gettext-translated word is used to name the discussion pages, as `$discussionlink` in `Render.pm` is +built from `gettext("discussion")`. In the same piece of code, a case-sensitive regexp that tests wether the page +being rendered is a discussion page is case-sensitive. + +On the other hand, new discussion pages are created with a name built from `gettext("Discussion")` (please note the upper-cased +"D"). Such a new page name seems to be automagically downcased. + +This leads to newly created discussion pages not being recognized as discussion pages by the +`$page !~ /.*\/\Q$discussionlink\E$/` regexp, so that then end with an unwanted discussion link. + +A simple fix that seems to work is to make this regexp case-insensitive: + + git diff IkiWiki/Render.pm + diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm + index adae9f0..093c25b 100644 + --- a/IkiWiki/Render.pm + +++ b/IkiWiki/Render.pm + @@ -77,7 +77,7 @@ sub genpage ($$) { + } + if ($config{discussion}) { + my $discussionlink=gettext("discussion"); + - if ($page !~ /.*\/\Q$discussionlink\E$/ && + + if ($page !~ /.*\/\Q$discussionlink\E$/i && + (length $config{cgiurl} || + exists $links{$page."/".$discussionlink})) { + $template->param(discussionlink => htmllink($page, $page, gettext("Discussion"), noimageinline => 1, forcesubpage => 1)); + +But the best way would be to avoid assuming implicitely that translators will translate "discussion" and "Discussion" the same way. + +> [[done]] --[[Joey]] + +[[!tag patch]] |