|
|
(7 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | [[Category:CcHost]] | + | #REDIRECT [[Translate]] |
− | [[Category:Developer]]
| |
− | [[Category:i18n]]
| |
− | | |
− | ''Also see [[ccHost Localization]].''
| |
− | | |
− | This document describes the procedures used to create and maintain translations for ccHost, a web-based media sharing software (that powers ccMixter.org and other sites). If you are used to the standard translation system in Free and Open Source Software, translation work on ccHost is very similar (and uses the same tools). For those of you that are not familiar with translations, this document is really aimed at you.
| |
− | | |
− | == Supported Languages ==
| |
− | | |
− | The latest development versions of [[ccHost]] include support for multiple languagues. Depending on who from the community submits languages, the make-up of the project will be different. We need your help in adding more languages to ccHost!
| |
− | | |
− | Anyone wishing to assist should sign up on the [http://lists.sourceforge.net/mailman/listinfo/cctools-cchost ccHost] mailing list and poke around on these projects.
| |
− | | |
− | == Getting Started ==
| |
− | | |
− | Translations for ccHost 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.sourceforge.net/mailman/listinfo/cctools-cchost cctools] mailing list is used for managing translations for ccHost. If you are translating ccHost into a new language, you are encouraged to join this list. The addition of new messages to be translated will be announced there, and you may ask questions on the list regarding internationalization. The availability of new message catalogs will also be announced on that list.
| |
− | | |
− | == Method 1: Creating A Translation on Commandline ==
| |
− | | |
− | First, install [[ccHost]] onto your web server. When translating ccHost there is one file which must be copied and edited. The translation resources are located in the <code>locale/default</code> subdirectory inside of a ccHost installation. Use the following instructions to create a new translation for ccHost; these instructions are for translating ccHost to the fictional "ya" locale and assume a Linux development environment.
| |
− | | |
− | * Create a locale subdirectory for your new translation
| |
− | $ cd locale/default
| |
− | $ mkdir ya
| |
− | $ mkdir ya/LC_MESSAGES
| |
− | * Copy the template files into the new directory
| |
− | $ cp cchost.pot ya/LC_MESSAGES/cchost.po
| |
− | * Edit the new files with the translated content. Two areas need editing: 1.) the header information and 2.) 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 ccHost will substitute the actual piece of information at run time.
| |
− | | |
− | === Method 2: Translating using Experimental Build POT file ===
| |
− | | |
− | ''NOTE: This is a fast way to ge up and running with ccHost''
| |
− | | |
− | Download the latest build of the master POT file which contains all strings for ccHost: http://mirrors.creativecommons.org/cchost/cchost.pot
| |
− | | |
− | From here, one can then pick up step 2 of method 1 above.
| |
− | | |
− | === Method 3: Translating using poEdit ===
| |
− | | |
− | [http://www.poedit.org/ 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. An alpha for Mac OS X is available at http://www.poedit.org/files/poedit-1.3.4-alpha.dmg. The poEdit team reports it is an early alpha, but some translators have had success using it for [[ccPublisher]] (another Creative Commons project).
| |
− | | |
− | 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 ===
| |
− | | |
− | ''NOTE: The following graphical windows use the excellent [[ccPublisher]]. The ideas though can be remapped to [[ccHost]] as well.''
| |
− | | |
− | To translate under Windows, download and install a ccHost 2.9 or greater release. In the installation directory you will find a the directory ''locale''' which contains the subdirectory '''default'''. Create a new subdirectory under '''locale/default''' with a name matching your new locale. For example, to translate ccHost 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/default''' 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|Editing the .po file ([[:Image:Edit.png|full size]]).]]
| |
− | | |
− | If you are translating ccHost to your default locale, simply run ccHost to test your translation.
| |
− | | |
− | [[Image:Edit_shortcut_thumb.png|frame|Editting a shortcut to ccp.exe to specify a locale ([[:Image:Edit_shortcut.png|full size]]).]]
| |
− | | |
− | | |
− | [[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]]).]]
| |
− | | |
− | == Submitting a Translation ==
| |
− | | |
− | Once you have completed or updated a translation and tested it, you can submit it to the ccHost developers using the ccTools [http://sourceforge.net/tracker/?group_id=80503&atid=559968 patch trackers]. 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).
| |
− | | |
− | == 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 cchost.po, select cchost.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 ===
| |
− | | |
− | Constructing an updated POT file is pretty simple on Unix-like systems (mac/linux/etc). Once you are in the main folder of where ccHost is installed. From commandline enter:
| |
− | | |
− | $ make
| |
− | | |
− | This automatically takes care of updating strings on languages, merging changes, etc. It also generates a new clean cchost.pot which can be used as a master file for creating future translations.
| |
− | | |
− | | |
− | == Known Issues ==
| |
− | | |
− | * XML pages need translation.
| |
− | ** Currently only strings php and inc files are correctly identified and set up for translation.
| |
− | * Auto-detection
| |
− | ** There needs to be auto-detection of languages at installation and first session installation.
| |