cattaDoc is prepared for translation into other languages, and it is relatively easy to do, although it will probably take some time to complete. English is the source language for cattaDoc which means that the translation is done from English. You can also look at other language translations for inspiration, provided you understand the other language :-)
A little bit of background information: Gettext is the technology behind Native Language Support (NLS) in cattaDoc. It takes care of all the static text strings in the PHP forms, ie. the user interface elements like headings, labels and explaining text.
However, there are also dynamic language elements in cattaDoc, like states and events and document types. These are all defined in the database and are as such not covered by gettext. These dynamic language elements are translated through PHP include files, all residing in the /inc sub-folder and having a file name in the form of incSwitchXyz.php.
The translation into a new language is a four-step exercise:
When a new version of cattaDoc is available, you will have to repeat steps no. 1-3, although in a slightly different way. Maintaining a language translation is much faster than a first time translation, since you can reuse your previous translation.
The gettext source language file is an ASCII text file. An updated template containing all strings in cattaDoc is available in all versions in the cattadoc/po sub-folder: po/cattadoc.po.
Find the language code for the language you are going to translate into. A list of language codes can be found at lcweb.loc.gov/standards/iso639-2/langhome.html. If there is a 2 letter code for the language, use this.
Create a directory cattadoc/locale/language_code/LC_MESSAGES/, e.g. cattadoc/locale/de/LC_MESSAGES/ for a German translation. Copy cattadoc/po/cattadoc.po into this directory. This is the file that is going to be translated.
To translate the actual strings, fill in the msgstr after each msgid with the appropiate translation. There are a few tools - at least for Linux - which can make this job a bit easier at i18n.kde.org/translation-howto/gui-specialized-apps.html. However, I always use a good text editor.
When you have completed the language translation in the gettext source file, you shall compile this source file into a gettext binary language file - with an .mo extension. For this you need the gettext program files - or binaries.
In my experience, gettext is available in most of the Linux distributions. You can download a Windows version of gettext from sourceforge.net/projects/gettext.
Convert the translated cattadoc.po into a binary file by running the command "msgfmt -o cattadoc.mo cattadoc.po" in the directory where the translated cattadoc.po is residing.
As an alternative, send the gettext source language file to me, and I will be happy to compile it for you. Well, always send the result to me, so that I can include it in the next release of cattaDoc!
The sub-folder cattadoc/inc contains 9 PHP include files, also needing translation:
In all the files, do the following:
After finishing, send all the translated PHP include files to me, please!
Number formats differ from one country to another. In the English speaking world, the thousand separator is a comma, whereas in Danish it is a dot. The only place cattaDoc displays numbers needing a thousand separator is for the file size in the document version display - defined in the file relDocVers.php.
Please put the appropriate code into this file - or inform me about the preferred thousand separator for your language.
Finally, you need to make cattaDoc aware of the new language so that users can select it as their preferred language. You need to be a system administrator in cattaDoc to do this.
The text strings in cattaDoc will change over time. This means that strings that are already translated are no longer used and new strings are added. Therefore it is necessary to maintain the translations.
In principle, you have to do all the steps 1-3 all over again. Fortunately, there is a shorter way of doing the time-consuming step 1.
There will always be an updated template containing all strings in cattaDoc in cattadoc/po/cattadoc.po. To merge all new strings in this file into an existing translation, do the following:
It might be necessary to restart Apache in order to reread the new language file.
Thanks to SquirrelMail for parts of this language translation guide.