2 > Here is my initial work on ikiwiki l10n infrastructure (I'm sending it
3 > before finalizing, there may be errors).
5 I've revised the patches (tested OK):
9 <http://people.debian.org/~roktas/patches/ikiwiki/ikiwiki-lang.diff>
11 + Support for CGI::FormBuilder.
12 + Modify Makefile.PL for l10n.
14 - l10n infrastructure from Koha project. (This patch must be applied with
15 '-p1', also, it needs a 'chmod +x l10n/*.pl' after patching.)
17 + Leave templates dir untouched, use a temporary translations directory
19 + Fix Makefile (it failed to update templates).
21 http://people.debian.org/~roktas/patches/ikiwiki/ikiwiki-l10n.diff
25 > There are two places in IkiWiki, subject to localization: HTML::Template
27 Unfortunately this is not correct. There a few (?) exceptional places, for
28 example button texts in CGI.pm:
30 my @buttons=("Save Page", "Preview", "Cancel");
32 > fine. Also a final note, I haven't examined the quality of generated
35 Looks like, tmpl_process3 cannot preserve line breaks in template files.
36 For example, it processed the following template:
38 Someone[1], possibly you, requested that you be emailed the password for
40 <TMPL_VAR USER_NAME> on <TMPL_VAR WIKINAME>[2].
42 The password is: <TMPL_VAR USER_PASSWORD>
47 [1] The user requesting the password was at IP address <TMPL_VAR
49 [2] Located at <TMPL_VAR WIKIURL>
53 Birisi[1], ki muhtemelen bu sizsiniz, <TMPL_VAR WIKINAME>[2] üzerindeki
54 <TMPL_VAR USER_NAME> kullanıcısına ait parolanın epostalanması isteğinde
55 bulundu. Parola: <TMPL_VAR USER_PASSWORD> -- ikiwiki [1] Parolayı isteyen
56 kullanıcının ait IP adresi: <TMPL_VAR REMOTE_ADDR>[2] <TMPL_VAR WIKIURL>
60 > Unfortunately this is not correct. There a few (?) exceptional places, for
61 > example button texts in CGI.pm:
63 > my @buttons=("Save Page", "Preview", "Cancel");
65 Hmm, I've thought on this issue. Using Locale::gettext seems to be the
66 natural solution. But this would need to create another po file and also,
67 ikiwiki would depend another Perl module. Kinda overkill...
69 I have another idea... What about to create another (flat) template file
70 for this sort of strings? Something like strings.tmpl with the content:
72 Save Page, Preview, Cancel
74 or we could categorize these strings in some variables (',' is the
75 delimiter for this code snippet):
77 <TMPL_IF NAME="BUTTONS">
78 Save Page, Preview, Cancel
81 and then (preferably in a separate wrapper function in CGI.pm):
83 my $template=template("strings.tmpl");
84 $template->param("BUTTONS", 1);
85 my @buttons=split(/\s*,\s*/, $template->output);
87 You get the idea... I've tried this method. All in one po file, kind of
88 ugly, but it _really_ works.
90 > > fine. Also a final note, I haven't examined the quality of generated
93 > Looks like, tmpl_process3 cannot preserve line breaks in template files.
94 > For example, it processed the following template:
96 This could be easily worked around in tmpl_process3, but I wouldn't like to
97 maintain a separate utility.