Translating ccPublisher

From Creative Commons
Revision as of 15:20, 1 June 2006 by Nathan Yergler (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



ccPublisher 2.2 (currently under development) will focus on providing internationalization (i18n) support. This document is a work in progress that describes the translation process which will be used once ccPublisher 2.2 release candidates are available.

Translations for ccPublisher are stored in gettext message catalogs. Message catalogs are text files which associate translated strings with identifiers used by the application. Each string to be translated is referred to as a "message".

Adding A Translation

When translating ccPublisher there are two files which must be copied and editted for the core application. Extensions may have their own message catalogs which need translating (see Translating Extensions for details on internationalizing ccPublisher extensions). The translation resources are located in the resources/locale subdirectory for a development sandbox. Use the following instructions to create a new translation for ccPublisher; these instructions are for translating ccPublisher to the fictional "ya" locale and assume a Linux development environment; Mac OS X should be similar.

  • Create a locale subdirectory for your new translation
 $ cd resources/locale
 $ mkdir ya
 $ mkdir ya/LC_MESSAGES
  • Copy the template files into the new directory
 $ cp ccpublisher.pot ya/ccpublisher.po
 $ cp p6.pot ya/p6.pot
  • Edit the new files with the translated content. Two areas need editted: the header information and the messages.
    • The header information should be updated with the translator's contact information, email address and the character set used. The character set should usually be utf-8.
    • Each message is defined by two lines; the translated content goes between the quotes on the msgstr line. The msgid line must not be changed.
 ...
 msgid "OK"
 msgstr ""
 ...
  • Compile the message catalogs:
 $ cd ya
 $ msgfmt -o LC_MESSAGES/ccpublisher.mo ccpublisher.po
 $ msgfmt -o LC_MESSAGES/p6.mo p6.po
  • Run ccPublisher with the --locale parameter; alternately if working on your default locale, omit the parameter and ccPublisher will use the operating system's default locale information.
 Change to the sandbox root directory
 $ cd ../../.. 
 $ python ccp.py --locale ya

Supported Languages

ccPublisher includes support for the following languages:

  • English