Edgewall Software

Changes between Initial Version and Version 1 of TracL10N/DesignNotes

Nov 28, 2008, 8:04:33 PM (12 years ago)
Christian Boos

section copied from TracL10N@70


  • TracL10N/DesignNotes

    v1 v1  
     1== The following is historical information ==
     3=== Wiki ===
     5 * We need an easy way to translate wiki pages. It should help and '''encourage''' people to translate a particular page into their native language.
     6 * It should be possible to quickly switch between different versions of the same page. May be we should give the possibility to compare different versions on one page.
     7 * We have to give the way to set the prefered language.
     8 * There should be a way to quickly check if the translation is current with respect to the original version. The original version may not always be in english, so there should be a way to know which one is the original.
     10=== Interface ===
     12For the project to be localized, the actual interface would have to be translated as well.  How difficult would it be to translate the interface to say, Japanese?
     14If possible it should be a user preference, which may require some additional changes.  Ideally a single Trac site should be able to serve users in many countries.  The interface should be translated and there should be support for translation of custom fields and plug-in's as well as wiki pages.
     16If possible it may be best if one could come up with an array of the most important terms derived from the wiki pages described below to be used in auto translating the interface.
     18== Other Implementations ==
     20How does other software (especially wiki-software) deal with the problem of L10N?
     21This section is devoted to describing and linking existing solutions.
     23=== Wikipedia ===
     25The famous [http://www.wikipedia.org Wikipedia] has a huge collection of translations.
     26How do they do it?
     28=== Drupal ===
     29The Drupal CMS [http://www.drupal.org] has a nice translation unit for its backend. It uses .po-files that can be edit and translated with the poedit [http://www.poedit.net/] software.
     31=== Zope ===
     32Zope also uses gettext-catalogs for translation. All basic functionality is provided by the packages  [http://svn.zope.org/Zope3/trunk/src/zope/i18n/ zope.i18n] (language-negotiation, formats for time, date, translation of msgids with languagefallback) and [http://svn.zope.org/Zope3/trunk/src/zope/i18nmessageid/ zope.i18nmessageid]. It also has [http://svn.zope.org/Zope3/trunk/src/zope/i18n/locales/ code to use LDML-files] (Locale Data Markup Language).
     34The template-language provides some special attibutes (e.g. i18n:domain, i18n:translate).
     35Translation in python-code works like this (from [http://svn.zope.org/Zope3/trunk/src/zope/i18nmessageid/messages.txt?rev=65911&view=log])
     38In this example, we create a message factory and assign it to _.  By
     39convention, we use _ as the name of our factory to be compatible with
     40translatable string extraction tools such as xgettext.  We then call _
     41with a string that needs to be translatable:
     43  >>> from zope.i18nmessageid import MessageFactory, Message
     44  >>> _ = MessageFactory("futurama")
     45  >>> robot = _(u"robot-message", u"${name} is a robot.")
     48robot looks like a unicode-string and will be translated depending on the negotiated language and the available message-catalogs.