
                      CAT Internationalization (I18n)
                      ===============================

    Copyright (C) 2009 by Christian Kuelker - 2009-12-31 version 0.1

Abstract: This document describes the process of a) translation b) adding a
new language c) updating new translations for CAT.


Contents
========

  1   Preface
  2   Adding a new language to CAT
  3   The process of translating
  4   Updating the translation


1   Prefeace
============

CipUX uses the Perl localization (l10n) framework Locale::Maketext which is
standard since Perl 5.8.  See man Locale::Maketext for more details.
Locale::Maketext comes with its own dictionary format. Even if this is advanced
compared to gettext, CipUX uses gettext dictionaries in conjunction with
Locale::maketext because there are a lot of - even graphical tools - to produce,
update and maintain such  dictionaries. Providing, updating and maintaining a
gettext dictionary is also easier for contributers (translators) since gettext
dictionaries are widely used.


2   Adding a new language to CAT
================================

To add a new language a new name is needed. Consider for example this situation:
de.po exists which stands for the German language. To add the Austrian language
choosing de-at.po as the new language file is a good decision. It should be
mentioned that here language "tags" from Locale::Maketext should be used.  The
difference between locale names and languages tags is that the underscore is
replaced with a dash. As a second example, the language fr-ch would XXX

Example for German with custom CAT module CipUX-CAT-Web-Userlist-3.4.0.2

    cd cat-web-userlist/lib/CipUX/CAT/Web/I18N/userlist
    msginit --input=messages.pot --output=de.po --locale=de


Example for Swiss-German with CipUX-CAT-Web-3.4.0.0

    cd cat-web/lib/CipUX/CAT/Web/I18
    msginit --input=messages.pot --output=de-ch.po --locale=de_CH


Remark on adding only custom module languages: Adding a language means adding
that language in CAT core first. Adding a language only to a custom module
cause that it will be overwritten by en.po from the core, because the new
language do not exist in core and there has to be a fall back. So in the case a
language x.po should be added only to a custom CAT module you also have to
provide x.po in CipUX/CAT/Web/I18. Please send x.po on cipux-devel for
inclusion in the main release of CAT or if you just want to do a fast hack,
provide an new x.po in that directory locally in your system, by creating that
from the message.pot via msginit.




3   The process of translating
==============================

In principle thi

"Content-Type: text/plain; charset=UTF-8\n"

msgid "Language"
msgstr "Sprache"



4   Updating the translation
============================

Change into the I18N directory and use msgmerge.


Example for CAT core and German language:

    cd cat-web/lib/CipUX/CAT/Web/I18N
    msgmerge --update de.po messages.pot

Example for CAT custom module userlist and French language:

    cd cat-web-userlist/lib/CipUX/CAT/Web/I18N/userlist
    msgmerge --update fr.po messages.pot



