]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/some_strings_are_not_internationalized.mdwn
added symlink to pagespec/po in basewiki to fix the build
[ikiwiki.git] / doc / bugs / some_strings_are_not_internationalized.mdwn
1 A lot of strings in ikiwiki are hardcoded and not taken for locales resources through gettext. This is bad because ikiwiki is thus difficult to spread for non-english users.
2
3 I mean that, for instance in CGI.pm, line like:
4
5 `my @buttons=("Save Page", "Preview", "Cancel");`
6
7 should be written as
8
9 `my @buttons=(gettext("Save Page"), gettext("Preview"), gettext("Cancel"));`
10
11 > Yes, these need to be fixed. But note that the localised texts come back
12 > into ikiwiki and are used in various places, including plugins.
13 > Including, possibly, third-party plugins. So localising the buttons would
14 > seem to require converting from the translations back into the C locale
15 > when the form is posted. --[[Joey]]
16
17 >> Wouldn't it be more easy to change all calls to the corrects ones (including in plugins) ?
18 >> For instance in the same file (CGI.pm): `elsif ($form->submitted eq gettext("Save Page")) {`.
19 >> That way no conversion to the C locale is needed.
20 >> gettext use should just be publicized in documentation (at least in [[plugins/write]]). --[[bbb]]
21
22 >>> It would be easy, but it could break third-party plugins that hardcode
23 >>> the english strings. It's also probably less efficient to run gettext
24 >>> over and over. --[[Joey]]
25
26 In standards templates things seems wrongly written too. For instance in page.tmpl line like:
27
28 `<li><a href="<TMPL_VAR EDITURL>" rel="nofollow">Edit</a></li>`
29
30 should be written as
31
32 `<li><a href="<TMPL_VAR EDITURL>" rel="nofollow"><TMPL_VAR EDITURL_TEXT</a></li>`
33
34 with EDITURL_TEXT variable initialized in Render.pm through a gettext call. 
35
36 Am I wrong ?
37
38 > No, that's not a sane way to localise the templates. The templates can be
39 > translated by making a copy and modifying it, or by using a tool to
40 > generate .mo files from the templates, and generate translated templates
41 > from .po files. (See [[todo/l10n]] for one attempt.) But pushing the
42 > localisation of random strings in the templates through the ikiwiki
43 > program defeats the purpose of having templates at all. --[[Joey]]
44
45 If not I can spend some time preparing patches for such corrections if it can help.
46
47 -- [[/users/bbb]]