[jsword-devel] Re: [sword-devel] i18n of sword website

Martin Gruner jsword-devel@crosswire.org
Tue, 25 Feb 2003 16:54:23 +0100


I don't really know the matter very well, but I'll say something anyway, 
risking mistakes. Joachim, maybe you can comment on this.

The main objection I'd have is that you need to reinvent the wheel completely. 
The GNU gettext package offers so many cool features that you would not 
implement, even if you create a java-based solution. It operates on 
standardized files (.po and .gmo) and has tools for collecting messages, 
which are kindof intelligent (such as listing identical messages only once, 
and use existing translations when merging new strings in an existing 
catalog). Joachim would have to say more about this.

Additionally, there is no reason to have multiple message catalogues. One for 
the entire website is enough.

Now here my suggestion (not knowing all details):
-mark all strings in the source with i18n()
-use the gettext tools to collect the messages and set up the cataloges
-use JNI calls to c++ (should be no problem on the server -- does not need to 
be portable) to access the gettext functions (see  
http://www.gnu.org/manual/gettext/html_chapter/gettext_toc.html) - both for 
the display of messages, and the translation interface


Am Dienstag, 25. Februar 2003 13:28 schrieb Troy A. Griffitts:
> Joachim,
> 	I had a look at the i18n taglib from jakarta and don't like it.  I
> don't like the idea of replacing all strings in the source files with
> some key name.  It makes the page very unreadable.
> 	Martin showed me some of your stuff earlier today and it was great.
> Here's my plan for a jsp implementation.  Let me know what you think
> (other people please let me know, as well).
> 	I have commited two new classes to jsword-old cvs to handle a new
> taglib package: org.crosswire.web.i18n
> 	So far, the 2 classes will enable 2 new tags in jsp:
> <t:contextStart />
> <t:t>My text to translate</t:t>
> We can call the tags whatever we like, but I wanted to keep the prefix
> short ('t' for translation taglib) and the actual translate tag short
> ('t' for translate), since they're gonna be everywhere.
> Currently the idea for the handler for contextStart will look in the
> users session for a locale name.  If one is set, it will look for a
> serialized HashMap in a file called ./i18n/<pageName>.<localeName>
> If it finds the file, it deserializes it and save the HashMap into the
> session with the key "i18n.transMap"
> It will also clear another session property "i18n.transKeys" that is a
> Vector of Strings.  This will happen at the beginning of each page.
> The t handler currently looks in "i18n.transMap" HashMap for a value to
> the key of it's body, e.g. "My text to translate" would be the key.  If
> it finds a value, it replaces the body of the tag with this text.
> This part is done and in CVS.
> It will also add the initial body value to the Vector of Strings in the
> session at "i18n.transKeys"
> A 3rd call will be created, probably something like <t:contextEnd />
> which will check to see if a 'translator' is logged in.  If so, it will
> add a new link to the bottom of the page: _Translation_Maintenence_
> This link will take them to a translation page that will look for the
> session Vector "i18n.transKeys", and also "i18n.transMap" (set from the
> previous page), and display each key and any entry in the transMap that
> matches those keys.  It will probably also display any keys in the
> transMap that are there that didn't have a transKey entry (this means
> that we probably changed something in the page) so the translator can
> salvage any translation they may have done if the change is very minor.
>   Obviously a new translation would have all the keys, and empty text
> boxes for each one.  Once the user submits this page it will save all
> the values in a new HashMap (so we clear out stale entries) and
> serialize it out to the appropriate i18n/<pageName>.<localeName> file.
> I think this works similar to your method.  Let me know what you think
> and if you think we will run into any problems that you may have
> encountered.
> Anyone wishing to help me with the remaining work on the new taglib
> would be appreciated, as well (jsword guys) :)
> 	-Troy.
> Joachim Ansorg wrote:
> > Daniel, that's a very useful and good idea!
> >
> > For www.bibletime.info we have a online translation tool in place which
> > offers the possibility to translate and edit the messages of the chosen
> > language online.
> > The data is stored in a aSQL database.
> >
> > In my opinion the online translation tool is very useful for people who
> > don't have programming skills.
> >
> > Thank you for spending your time about this topic!
> > Joachim
> >
> > On Montag, 24. Februar 2003 19:50, Daniel Glassey wrote:
> >>well, with the debate raging about plans for the web interface and
> >>the importance of non-English stuff () it seems like a good time to
> >>bring up the idea of translating the sword website into (at minimum)
> >>appropriate languages, imho these would do for starters:
> >>
> >>Important imho:
> >>German
> >>Chinese Traditional and Simplified
> >>Thai
> >>Russian
> >>Arabic
> >>Korean?
> >>
> >>Other potentially useful imho:
> >>Czech
> >>Danish
> >>Spanish
> >>Finnish
> >>French
> >>Italian
> >>Dutch
> >>Vietnamese
> >>others that there are modules for
> >>
> >>after that in importance are other languages people would like to
> >>translate to.
> >>
> >>On an English only website non-English modules won't be as useful as
> >>they could possibly be.
> >>
> >>Just one wee problem. There is no procedure for translating the site
> >>yet, or core/essential bits of it set aside for translating. _If_
> >>there is going to be a change to the website this should definitely
> >>be part of it (see www.bibletime.info for one way to do it ;) )
> >>
> >>Do other people think this would be useful and do you think people
> >>would be willing to do the translation?
> >>
> >>Regards,
> >>Daniel
> >>_______________________________________________
> >>sword-devel mailing list
> >>sword-devel@crosswire.org
> >>http://www.crosswire.org/mailman/listinfo/sword-devel
> _______________________________________________
> sword-devel mailing list
> sword-devel@crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel