]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/hardcoded___34__Discussion__34___link.mdwn
fc8406d8704c000cbb569f13bbf5b5fc61656e36
[ikiwiki.git] / doc / bugs / hardcoded___34__Discussion__34___link.mdwn
1 I can't translate "Discussion" link in `templates/inlinepage.tmpl`
2 and `templates/page.tmpl` files, because it's hardcoded in
3 ikiwiki sources:
4
5     ptecza@horus:~/svn/ikiwiki$ rgrep -i DISCUSSIONLINK . |grep -v '.svn'
6     ./templates/inlinepage.tmpl:<TMPL_IF NAME="DISCUSSIONLINK">
7     ./templates/inlinepage.tmpl:<li><TMPL_VAR DISCUSSIONLINK></li>
8     ./templates/page.tmpl:<TMPL_IF NAME="DISCUSSIONLINK">
9     ./templates/page.tmpl:<li><TMPL_VAR DISCUSSIONLINK><br /></li>
10     ./IkiWiki/Plugin/inline.pm:                                     $template->param(discussionlink => htmllink($page, $params{page}, "Discussion", 1, 1));
11     ./IkiWiki/Render.pm:            $template->param(discussionlink => htmllink($page, $page, "Discussion", 1, 1));
12
13 I hope it's a bug, not a feature, because I don't have the same
14 problem with other links, for example "Edit", "RecentChanges"
15 or "History".
16
17 --Pawel
18
19 > There are good reasons for feeding a full html link into the template,
20 > rather than the urls used for the other links. For one, the Discussion
21 > link needs to be different if the Discussion page doesn't yet exist.
22
23 >> You can always use <tmpl_if> and <tmpl_else> construct in that place ;) --Pawel
24
25 >>> Not without duplicating the logic that constructs a link to an
26 >>> existing/nonexisting page in two places, one in code in ikiwiki and one
27 >>> in the template. Not good design. --[[Joey]]
28  
29 > As noted in [[patchqueue/l10n]], there are some other places in ikiwiki
30 > that hard code English strings, and I feel that using standard gettext
31 > and po files is the best approach for these, although Recai suggested an
32 > approach of translating the strings using a template file. --[[Joey]]
33
34 >> You know that I rather prefer static templates, but it's your choice,
35 >> of course.
36 >> 
37 >> BTW, is there a chance for configurable name of Discussion page?
38 >> In my wiki I use only Polish name of pages, so I would like to have
39 >> dyskusja.html page, instead of discussion.html page. --Pawel
40
41 >>> I have an incomplete i10n patch for such hardcoded strings in the code, 
42 >>> which I hope to finish up eventually --[[Joey]]