]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/l10n.mdwn
clarify
[ikiwiki.git] / doc / todo / l10n.mdwn
1 ikiwiki should be fully internationalized.
2
3 ----
4
5 As to the hardcoded strings in ikiwiki, I've internationalized the program,
6 and there is a po/ikiwiki.pot in the source that can be translated.
7 --[[Joey]]
8
9 ----
10
11 > The now merged po plugin handles l10n of wiki pages. The only missing
12 > piece now is l10n of the templates.
13 > --[[Joey]]
14
15 ----
16
17 ## template i18n
18
19 From [[Recai]]:
20 > Here is my initial work on ikiwiki l10n infrastructure (I'm sending it
21 > before finalizing, there may be errors).
22
23 I've revised the patches (tested OK):
24
25 - $config{lang} patch:
26
27     <http://people.debian.org/~roktas/patches/ikiwiki/ikiwiki-lang.diff>
28
29   + Support for CGI::FormBuilder.
30   + Modify Makefile.PL for l10n.
31
32 - l10n infrastructure from Koha project.  (This patch must be applied with
33   '-p1', also, it needs a 'chmod +x l10n/*.pl' after patching.)
34
35   + Leave templates dir untouched, use a temporary translations directory
36     instead.
37   + Fix Makefile (it failed to update templates).
38
39     <http://people.debian.org/~roktas/patches/ikiwiki/ikiwiki-l10n.diff>
40
41 However...
42
43 > fine.  Also a final note, I haven't examined the quality of generated
44 > templates yet.
45
46 Looks like, tmpl_process3 cannot preserve line breaks in template files.
47 For example, it processed the following template:
48
49     Someone[1], possibly you, requested that you be emailed the password for
50 user
51     <TMPL_VAR USER_NAME> on <TMPL_VAR WIKINAME>[2].
52
53     The password is: <TMPL_VAR USER_PASSWORD>
54
55     --
56     ikiwiki
57
58     [1] The user requesting the password was at IP address <TMPL_VAR
59 REMOTE_ADDR>
60     [2] Located at <TMPL_VAR WIKIURL>
61
62 as (in Turkish):
63
64 Birisi[1], ki muhtemelen bu sizsiniz, <TMPL_VAR WIKINAME>[2] üzerindeki
65 <TMPL_VAR USER_NAME> kullanıcısına ait parolanın epostalanması isteğinde
66 bulundu. Parola: <TMPL_VAR USER_PASSWORD> -- ikiwiki [1] Parolayı isteyen
67 kullanıcının ait IP adresi: <TMPL_VAR REMOTE_ADDR>[2] <TMPL_VAR WIKIURL>
68
69 This could be easily worked around in tmpl_process3, but I wouldn't like to
70 maintain a separate utility.
71
72 ----
73
74 Another way to approach this would be to write a small program that outputs
75 the current set of templates. Now i18n of that program is trivial,
76 and it can be run once per language to generate localized templates.
77
78 Then it's just a matter of installing the templates somewhere, and having
79 them be used when a different language is enabled.
80
81 It would make sense to make the existing `locale` setting control which
82 templates are used. But the [[plugins/po]] plugin would probably want to do
83 something more, and use the actual language the page is written in.
84 --[[Joey]]