|
|
Line 3: |
Line 3: |
| [[Category:i18n]] | | [[Category:i18n]] |
| | | |
− | The focus of the ccPublisher 2.2 development cycle was on providing internationalization (i18n) support. This document describes the procedures used to create and maintain translations for ccPublisher. | + | The focus of the ccPublisher 2.2 development cycle was on providing internationalization (i18n) support. This document provides an overview of the available translations; see [[Translate|this page]] for information on creating new translations. |
| | | |
| = Screenshots = | | = Screenshots = |
Line 26: |
Line 26: |
| * Galician | | * Galician |
| * German | | * German |
− |
| |
− | = Getting Started =
| |
− |
| |
− | 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". The [http://lists.berlios.de/mailman/listinfo/cctools-i18n cctools-i18n] mailing list at Berlios.de is used for managing translations for ccPublisher. If you are translating ccPublisher into a new language, you are encouraged to join this list.
| |
− |
| |
− | ccPublisher uses the Pootle online translation system to manage translations. Pootle allows users to collaborate on translations and work on them incrementally. '''Using Pootle is the preferred method for translating ccPublisher. Instructions for using Pootle can be found [[Translating CC Tools|here]].''' However, you can still create translations manually and have them uploaded into Pootle.
| |
− |
| |
− | = Known Issues =
| |
− |
| |
− | ccPublisher 2.2 is the first release to support internationalization. Known issues with the translation system are tagged with the '''i18n''' keyword in the [http://roundup.creativecommons.org/ccpublisher ccPublisher Tracker]. A list of unresolved issues tagged with the '''i18n''' keyword is available [http://roundup.creativecommons.org/ccpublisher/issue?@columns=title,id,activity,status,assignedto&@sort=-activity&@group=priority&@filter=topic,status&@pagesize=50&@startwith=0&topic=5&status=-1,1,2,3,4,5,6,7&@dispname=i18n%20issues here].
| |
− |
| |
− | At this time right-to-left languages are not correctly supported by ccPublisher. This is due to a [http://www.wxwidgets.org/wiki/index.php/Internationalization lack of support] in the underlying [http://wxwidgets.org wxWidgets] toolkit. A Google Summer of Code project is underway to correct this lack of support.
| |
− |
| |
− | = Manually Translating ccPublisher =
| |
− |
| |
− | These instructions describe how to translate ccPublisher without using the [http://translate.creativecommons.org Pootle server].
| |
− |
| |
− | == Creating A Translation ==
| |
− |
| |
− | When translating ccPublisher there are two files which must be copied and editted for the core application. [[Extending ccPublisher|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 <code>resources/locale</code> subdirectory for a [[Developing ccPublisher 2|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.
| |
− |
| |
− | * 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 <code>utf-8</code>.
| |
− | ** Each message is defined by two lines; the translated content goes between the quotes on the <code>msgstr</code> line. The <code>msgid</code> line '''must not be changed'''.
| |
− | ...
| |
− | msgid "OK"
| |
− | msgstr ""
| |
− | ...
| |
− | * You may encounter strings such as <code>"The file %s can not be found."</code>; the <code>%s</code> should be left intact, as ccPublisher will substitute the actual piece of information at run time.
| |
− | * Run ccPublisher with the <code>--locale</code> 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
| |
− |
| |
− | ccPublisher will recompile the .po files into binary message catalogs (.mo files) when it runs if the .po files are newer or the .mo files do not exist. This feature exists to aid translators.
| |
− |
| |
− | === Translating using poEdit ===
| |
− |
| |
− | [http://www.poedit.net/ poEdit] is an Open Source cross-platform gettext catalogs (.po files) editor. It is built with wxWidgets toolkit and can run on any platform supported by it. It aims to provide more convenient approach to editing catalogs than launching Notepad (or vi) and editing the file by hand. Official releases are available from the poEdit web site for Windows and Linux. A version for Mac OS X is available at http://www.poedit.net/download.php#osx. The poEdit team reports it is a beta release and the 1.3.6 version is known to be broken, but some translators have had success using it for ccPublisher.
| |
− |
| |
− | Just use poEdit's '''File''' -> '''New catalog from POT file...''' function will easily doing so. It even can compile .po into .mo file in the same time you pressing '''Save'''.
| |
− |
| |
− | === Translating under Windows ===
| |
− |
| |
− | To translate under Windows, download and install an [[CcPublisher 2_2|i18n-enabled release]] (2.1 or later). In the installation directory you will find a '''resources''' directory, which contains the '''locale''' subdirectory. Create a new subdirectory under '''locale''' with a name matching your new locale. For example, to translate ccPublisher into French, create a directory named <code>fr_FR</code>.
| |
− |
| |
− | [[Image:Locale_folder_thumb.png|frame|The ccPublisher locale folder ([[:Image:Locale_folder.png|full size]]).]]
| |
− |
| |
− | Copy the template files from '''locale''' into your new directory; rename them from .pot to .po.
| |
− |
| |
− | [[Image:Fr_FR_thumb.png|frame|The .po files for the new locale ([[:Image:Fr_FR.png|full size]]).]]
| |
− |
| |
− | Edit each .po file per the instructions above.
| |
− |
| |
− | [[Image:Edit_thumb.png|frame|Editting the .po file ([[:Image:Edit.png|full size]]).]]
| |
− |
| |
− | If you are translating ccPublisher to your default locale, simply run ccPublisher to test your translation. If you are translating to a different locale, create a shortcut to <code>ccp.exe</code> and modify it to pass the --locale parameter in.
| |
− |
| |
− | [[Image:Edit_shortcut_thumb.png|frame|Editting a shortcut to ccp.exe to specify a locale ([[:Image:Edit_shortcut.png|full size]]).]]
| |
− |
| |
− | When you run ccPublisher with the new locale, the message catalogs will be compiled and the application should reflect your translation.
| |
− |
| |
− | [[Image:CcPublisher_fr_thumb.png|frame|ccPublisher running with the French locale specified; note the File menu reflects the change to Dossier ([[:Image:CcPublisher_fr.png|full size]]).]]
| |
− |
| |
− | === Translating under Mac OS X ===
| |
− |
| |
− | Translations for Mac OS X are currently shipped inside the application bundle. To find the translation files via the Finder, right click on the ccPublisher application and select '''Show Package Contents'''. This will open the application bundle in a Finder window. The locale files are stored in '''Contents''' -> '''Resources''' -> '''resources''' -> '''locale'''. Navigate to the locale directory and follow the instructions for Linux or Windows.
| |
− |
| |
− | == Translating ''"How Does This Work"'' ==
| |
− |
| |
− | The text in the help dialog displayed when the user clicks the ''How Does This Work'' button on the opening page is not contained in the message catalogs. The help text is included in an HTML file which must also be translated to complete the translation process. The file, <code>welcome.html</code>, is located in the '''locale''' directory alongside the .pot message catalog templates; see the appropriate platform section above for information on locating the '''locale''' directory. ccPublisher looks for the translated version of welcome.html in the appropriate locale directory (i.e. in the same directory as the translated .po message catalogs). If a translated version is not found, ccPublisher falls back to English.
| |
− |
| |
− | == Submitting a Translation ==
| |
− |
| |
− | Once you have completed or updated a translation and tested it, you can submit it to the ccPublisher developers using the Roundup bug tracking system. [http://roundup.creativecommons.org/ccpublisher/issue?@template=item&topic=i18n&priority=feature&title=New+Translation Click here] to create a new issue with the correct default values set. Add the locale information for your new translation to the title and attach the .po and .html files you created (either individually or in a zip/tar file).
| |
− |
| |
− | We encourage people submitting bugs and feature requests via Roundup to create accounts so they can easily monitor issues they create.
| |
− |
| |
− | == Updating Translations ==
| |
− |
| |
− | Strings are sometimes added or removed from the application during development cycles. At those times it is necessary to update the translation (.po) files with the new strings and translations.
| |
− |
| |
− | === Using poEdit ===
| |
− |
| |
− | If you are using [http://poedit.org poEdit], you can use the '''Update from POT file...''' option. Go to the '''Catalog''' menu and select '''Update from POT file...'''. Select the .pot file which cooresponds to the translation you have open (i.e. if you are updating ccpublisher.po, select ccpublisher.pot).
| |
− |
| |
− | [[Image:Poedit_select_catalog_template.png]]
| |
− |
| |
− | poEdit will display the new strings it will add, as well as the obsolete strings it will remove.
| |
− |
| |
− | [[Image:Poedit_approve_updates.png]]
| |
− |
| |
− | === Using GNU gettext tools ===
| |
− |
| |
− | The [http://www.gnu.org/software/gettext/ GNU gettext] tools include a command-line tool called <code>msgmerge</code> which may be used to merge two catalogs together. For example, to use msgmerge for ccpublisher.po, you can use the following commands (Linux):
| |
− |
| |
− | $ cd resources/locale/en_US
| |
− | $ msgmerge ccpublisher.po ../ccpublisher.pot > new_ccpublisher.po
| |
− |
| |
− | This will create a new file (<code>new_ccpublisher.po</code>) containing the merged translations. After examining it, rename it to the original file name (ccpublisher.po).
| |