Warning:
This topic was a
try to figure out the best way for
I18N within TWiki, and no more reflects
the state-of-the-art thoughts about the subject.
It's being kept here for reference: some ideas are useful for improving Internationalisation
in
DakarRelease (specially the forms thing)
See
TranslationSupport instead.
--
AntonioTerceiro - 15 Jan 2006
International Independent Information Exchange (
Ciranda
) is an effort to make
a colective jornalistic coverture of the
World Social Forum
,
by independent media colectives. This year, IIIE's organization is decided to
move the software infra-structure that supports that to TWiki.
I am personally involved with this work. Since
i18n
and
l10n are crucial to IIIE goals, I'm considering this as a proof of
concept implementation of
TranslationSupport, and I'll describe here issues
that I found with this work. These issues will be a
great help on
TranslationSupport final specification
and implementation. Some patches
will be produced in the process, they will be added here as soon as they are
ready.
Unfornatelly, this implementation is being done in a machine with too
few output bandwith, and I can't advertise its addresss (which will
make our work impossible).
Anyway, I'll summarize here the changes needed to implement Ciranda, as a
starting point for core's changes for
TranslationSupport:
Translation of interface elements with variables
Is working fine. Standards we have adopted:
- Variables that are placeholders for localized content have a
I18N_ prefix.
- Variables that define localization for placeholder variables have
L10N_ prefix.
- Example:
The word "title" is translated as follows:
I18N_TITLE contains %VAR{"L10N_TITLE" web="%LANGWEB%"}%
each translation web define L10N_TITLE as the textual translation of the english word "title"
Localized field values.
We started trying to put variables (
I18N_*) as field values. They worked OK
for
checkboxes and
radio buttons, but variables didn't get expanded in
select's. I've changed the code in the
renderForEdit function
(
lib/TWiki/Form.pm) (since in view mode variables in form values get expanded
normally).
Localized field names.
We've tested using variables as field names. It
works correctly in view mode
(they get expanded as expected). But in edit mode they appear to the user
unexpanded, and we expected them to be expanded (in the "text label", not
the internals). To make it work, I've changed the
_link function
(in
lib/TWiki/Form.pm).
Note: changes only affect visual presentation of forms
(internals were kept), and are in
this patch (against 01Sep2004).
User language detection
As Ciranda needs to be avaliable in 6 differente languages, we had to think
on a manner of allow changing language, without requiring the regular users
("readers") to register themselves. The solution we developed was to change
SessionPlugin to allow a sticky
LANGWEB setting, and to make this
setting override globally-defined preferences (e.g. portuguese as being the
global value for
LANGWEB).
Here is a summary of the changes needed for this:
- changed SessionPlugin to include a sticky language setting, using
LANGWEB as a session variable. The changes made do SessionPlugin are in this patch.
LANGWEB is set by passing its value, say, Portugues, as ?sticklangauge=Portugues.
- to allow the SessionPlugin setting to override a preferences-defined
LANGWEB value, we had to change the function handlePreferencesTags in lib/TWiki/Prefs.pm: this patch shows the changes made to that function.
Image galleries and file attachments
In the first day of the, it would be very nice to have the possibility of attaching
multiple files a time. This would be a great help to photographers, who have to upload
dozens of images at a time.
Also, a couple of days before it we have to change
SlideShowPlugin to limit
the numbers of images shwon, to implement showing the first image on a topic as a
front page of the topic. This was posted in
ImageGalleryPluginDev .
--
AntonioTerceiro - 26 Jan 2004