Internationalisation
Introduction
We welcome translations to new languages, or improvements to the currently available languages. Send translations to the mailing list, or attach them to an issue in Jira. Make sure you use UTF-8 encoding in your files (except for the .properties files -- see below). Also, check on the mailing list if anybody else is working on the same language as you.
Daisy and the Daisy Wiki can be translated to different languages. For this purpose, text to be displayed to users is retrieved from a language-specific file, usually called a resource bundle.
Different types of resource bundles
There are three different types of resource bundles used by Daisy:
- for the Cocoon part, these are XML files.
- for messages produced by Java code (the repository server), these are " .property" files
- for Javascript, the resource takes the form of a snippet of Javascript code (.js files)
When editing resource bundles, take care of the encoding of the files, as explained below.
Encoding of the XML and .js files
We prefer to keep all the XML and .js (javascript) files UTF-8 encoded, for all languages. Therefore, take care to use the correct encoding when opening and saving files in your text editor.
Encoding of the .properties files
The ".properties" files should always be ISO-8859-1 encoded. Characters not supported by ISO-8859-1 can be inserted using Java unicode escapes. A Java unicode escape takes the form "\uHHHH" in which the HHHH are hexadecimal digits specifying the unicode character. Usually you don't want to edit this by hand, the unix recode utility can be handy here:
- (if it is an existing file) do:
recode JAVA..UTF-8 somefile.properties
- then open the file in an editor using UTF-8 as encoding
- then convert back:
recode UTF-8..JAVA somefile.properties
Overview of the resource bundle files
Below is an overview of the translatable resources that currently exists. The given directory paths refer to locations inside the source tree, in the binary distribution these locations are a bit different (and the .property files are bundled inside the jar files). See further on this page for practical instructions.
- the Daisy Wiki
- General
applications/daisywiki/frontend/src/cocoon/webapp/ daisy/resources/i18n/messages_<lang>.xml
- Skin-specific messages
applications/daisywiki/frontend/src/cocoon/webapp/ daisy/resources/skins/default/i18n/messages_<lang>.xml
- Daisy HTMLArea plugins
applications/daisywiki/frontend/src/cocoon/webapp/ daisy/resources/cocoon/forms/htmlarea/plugins/*/lang/<lang>.js
- Daisy Wiki initialisation program
install/src/java/org/outerj/daisy/install/daisywiki_schema.xml (this is the same file for all languages)
- Java messages
applications/daisywiki/frontend/src/java/org/outerj/daisy/ frontend/components/userregistrar/messages_<lang>.properties
- Navigation & book tree editor
applications/daisywiki/frontend/src/cocoon/webapp/daisy/ resources/navtree_editor/lang/navtree_<lang>.js
and
applications/daisywiki/frontend/src/cocoon/webapp/daisy/ resources/tree_editor/lang/tree_<lang>.js
and
applications/daisywiki/frontend/src/cocoon/webapp/daisy/ resources/book_editor/lang/booktree_<lang>.js
- Books functionality
applications/daisywiki/frontend/src/cocooon/webapp/daisy/ books/publicationtypes/common/i18n/messages_<lang>.xml
and
applications/daisywiki/frontend/src/cocooon/webapp/daisy/ books/publicationtypes/html-chunked/i18n/messages_<lang>.xml
- Dojo widgets
applications/daisywiki/frontend/src/cocoon/webapp/daisy/ resources/js/widget/nls/...
- repository server messages:
- exceptions
repository/api/src/java/org/outerj/daisy/repository/messages_<lang>.properties
- identifier titles
repository/server/src/java/org/outerj/daisy/query/model/messages_<lang>.properties
- diff component
services/diff/src/java/org/outerj/daisy/diff/messages_<lang>.properties
- workflow
services/workflow/server-impl/src/java/org/outerj/daisy/ workflow/serverimpl/messages_<lang>.properties
- email notifications
-
services/emailnotifier/server-impl/src/java/org/outerj/daisy/ emailnotifier/serverimpl/formatters/messages_<lang>.properties
- workflow processes
-
services/workflow/server-impl/src/processes/*/i18n/* services/workflow/server-impl/src/processes/common-i18n/*
- resources not part of Daisy
- messages of CForms (mostly validation errors, part of Cocoon)
- HTMLArea and its "TableOperations" plugin. HTMLArea itself is already translated in many languages, but its TableOperations plugin not.
To make the new language appear on the locale selection page, its ISO language code should be added to the following file:
applications/daisywiki/frontend/src/cocoon/webapp/daisy/resources/conf/locales.txt
Windows installer
All installation messages of the windows installer are kept inside on single file, which also acts as template for any new languages to be added:
distro/windows-installer/installer/lang/english.nsh
The NSIS installer does not support Unicode yet, it assumes no encoding and just copies the bytes as is. Therefore the encoding used is mentioned in the comment section in the header of the .nsh language file. In order to display the messages correctly, the default language for non-Unicode applications in the language control panel of your Windows installation has to be set appropriately.
Making or improving a translation
Install the subversion client if you don't have it already.
Check out the Daisy source tree:
svn co http://svn.cocoondev.org/repos/daisy/trunk/daisy
After editing the files, create a patch by executing the following command in the root of the Daisy source tree:
svn diff > mypatch.txt
and send the mypatch.txt file to the mailing list.



There are no comments.