Localizations (MM4): Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to search
Line 53: Line 53:
===Editing an Existing Translation===
===Editing an Existing Translation===
If .po files have already been created for a particular language, the process is slightly different, since if
If .po files have already been created for a particular language, the process is slightly different, since if
the English language source .po file is newer than the foreign language .po file, you'll need update the
the English language source .po file is newer than the foreign language .po file, you'll need first update the
foreign language .po file with any changes that have been made to the newer English version. This will have
foreign language .po file with any changes that have been made to the newer English version. This will have
the effect of updating the English sources in the foreign .po file so that any new/changed strings will be
the effect of updating the English sources in the foreign .po file so that any new/changed strings will be
highlighted for translation.  
highlighted for translation.


'''4)''' Update the foreign .po files if necessary by following procedure a) OR b):
'''4)''' Update the foreign .po files if necessary by following procedure a) OR b) for each of the .po files (except for language.po):
:a) In poedit, open the foreign language .po file you want to edit and click Catalog|Update from POT file.
:a) In poedit, open the foreign language .po file you want to edit and click Catalog|Update from POT file.
::Select the .POT file associated with the .PO file you are editing (e.g. if editing /Languages/CS/default.po, select /default.pot)  
::Select the .POT file associated with the .PO file you are editing (e.g. if editing /Languages/CS/default.po, select /default.pot)  
:b) Go to the command line and switch to the root directory (which contains the English .po file) and then type: msgmerge -U %LANGUAGE%\default.po default.po and then doing the same for each of install.po and tips.po .
:b) Go to the command line and switch to the root directory (which contains the English .po file) and then type: msgmerge -U %LANGUAGE%\default.po default.po and then do the same for the other catalogs.


'''5)''' Use poedit to edit 3 of the 4 .po files. You can do so by simply double-clicking on each .po file in the
'''5)''' Use poedit to edit each of the .po files (except for language.po). You can do so by simply double-clicking on each .po file in the
/Languages/%Language% directory where %Language% is the language you wish to edit.  If you've
/%Language% directory where %Language% is the language you wish to edit.  If you've
updated the .po files (step 3 above) you'll also probably notice that there are several new untranslated
updated the .po files (step 3 above) you'll also probably notice that there are several new untranslated
strings, as well as some strings that are tagged as 'fuzzy' due to changes to the original English string.
strings, as well as some strings that are tagged as 'fuzzy' due to changes to the original English string. These are the strings that you'll ''need'' to translate, though you might want to review others for consistency.
Translate default.po (application text), install.po (installer text), and tips.po (tooltips text)


'''6)''' Save the .po files, overwriting the original ones with the updates. See poedit Tips (below) if you get
'''6)''' Save the .po files, overwriting the original ones with the updates. See poedit Tips (below) if you get

Revision as of 14:42, 24 September 2007

Introduction

Localizing MediaMonkey involves localizing strings that appear within the application (the UI and context-sensitive help) and the installer (may be necessary for some languages). Additional localization of the Online help, and readme, Product description and basic Web template is also possible, but may be more than most would be willing to take on.

Localizing MediaMonkey-specific Strings

We use localization software to help translate the strings that appear inside MediaMonkey, including menus, buttons, and dialog boxes. All of the user visible strings are extracted from MediaMonkey source code and placed into several "message catalog" .po files. The localization software allows you to translate the strings in this file, and create new foreign language message catalogs (.po files). To get started:

1) Download the catalog files from: http://www.mediamonkey.com/contrib/localization/localization_catalog.zip . It contains the following:

 \Version.txt			-versioning information
 \Language.po			-language info (english)
 \Default.po			-application strings (english)
 \Default.pot			-same as above but used for updates
 \Default.isl			-innosetup installer strings
 \Install.po			-MediaMonkey installer strings (english)
 \Install.pot			-same as above but used for updates
 \Tips.po			-tooltips strings (english)
 \Tips.pot			-same as above but used for updates
 \DB.po                        -strings within DB
 \DB.pot			-same as above but used for updates
 \context.po                   -context-sensitive help strings
 \context.pot			-same as above but used for updates

2) If you're going to update an existing translation, also download the existing translation from: http://www.mediamonkey.com/contrib/localization/localization_languages.zip . It contains one directory for each language e.g.:

 \CS\language.po	-the next four are the Czech message catalog
 \CS\default.po
 \CS\install.po
 \CS\tips.po
 \CS\version.txt       -indicates the version of the translation based on the catalog source used as the source
 \%languages%\....	-message catalogs for other foreign languages

3) Install poedit. See: http://poedit.sourceforge.net/index.php


Translating to a New Language

The localization process for translating to a new language is fairly simple:

4) Use poedit to edit each of the source files, by double-clicking on each .po file.

  • Translate default.po (application text), install.po (installer text), tips.po (tooltips text), context.po (context help), and DB.po (database text)
  • For the language.po file, simply 'translate' language to the name of the languge to which the files are being translated (e.g. if you're translating to french, translate 'language' to 'Francais')

IMPORTANT: Strings involved in Mask Settings should not have a '-' as this will affect the manner in which the mask is parsed.

5) Click 'Save as...' to save each file after editing it. Save it to a new directory \%Language% where %Language% is the 2-letter code for the language as defined at http://www.unicode.org/unicode/onlinedat/languages.html . When saving each .po file, an .mo file will be generated (these are the files that MediaMonkey uses to localize the interface). See poedit Tips (below) if you get an error.


Editing an Existing Translation

If .po files have already been created for a particular language, the process is slightly different, since if the English language source .po file is newer than the foreign language .po file, you'll need first update the foreign language .po file with any changes that have been made to the newer English version. This will have the effect of updating the English sources in the foreign .po file so that any new/changed strings will be highlighted for translation.

4) Update the foreign .po files if necessary by following procedure a) OR b) for each of the .po files (except for language.po):

a) In poedit, open the foreign language .po file you want to edit and click Catalog|Update from POT file.
Select the .POT file associated with the .PO file you are editing (e.g. if editing /Languages/CS/default.po, select /default.pot)
b) Go to the command line and switch to the root directory (which contains the English .po file) and then type: msgmerge -U %LANGUAGE%\default.po default.po and then do the same for the other catalogs.

5) Use poedit to edit each of the .po files (except for language.po). You can do so by simply double-clicking on each .po file in the /%Language% directory where %Language% is the language you wish to edit. If you've updated the .po files (step 3 above) you'll also probably notice that there are several new untranslated strings, as well as some strings that are tagged as 'fuzzy' due to changes to the original English string. These are the strings that you'll need to translate, though you might want to review others for consistency.

6) Save the .po files, overwriting the original ones with the updates. See poedit Tips (below) if you get an error.

Testing Your Translation

7) After all the .po files have been edited and saved, you'll want to test them out. Copy the \%Language% directory and its contents to \Program Files\MediaMonkey\Locale\ and then run MediaMonkey. Go to Tools|Options|General and change the Language option to the newly created Language. Close MediaMonkey and restart for the configuration change to take effect and then verify that everthing works as expected.

Note that you won't be able to test the install.po file--this has to be packaged directly into the installer by the developers.


Tips about POEDIT

  • You shouldn't have to change any of the poedit default settings
  • Some people have received error messages when trying to SAVE a .po file. The error is similar to:
    msgfmt: C:\Download\MediaMonkey\mm-local\LangTemplates\languages\NL\default.po:
    field `Project-Id-Version' still has initial default value
    msgfmt: found 1 fatal error
    To get around this, replace the entry:
    msgstr "Project-Id-Version: PACKAGE VERSION\n"
    with
    Project-Id-Version: MediaMonkey 2.2\n
    This can be configured via Catalog > Settings > Project Info
  • '&' is used to modify menu shorcuts that are accessed via alt-key combinations. e.g. changing &file to f&ichier causes the expected text change, but also changes the command from alt-f to alt-i. This allows the translator to modify menu shortcuts along with text. Note that only existing menu shortcuts are localizable in this manner. Other shortcuts cannot be redefined. If you want the ampersand ('&') character to appear as within a string, use &&
  • \"text\" is used to place quotes around the text in question.
  • Some strings will have extra (and apparently needless) spaces within them. These spaces may be used for formatting/alignment purposes. Generally, they should be preserved in the translation.
  • Some strings will have variables within them. For example:
    a) Preparing track %d of %d (%s) -- When translating such string make certain to leave the variables and the order of the variables intact.
    b) Copying file $src$ to $dest$ -- When translating such strings, make certain to leave the variables intact. In these cases, though, the order of the variables may be changed.
  • translated fields appear in white--you can also tag a field as translated 'fuzzily' (i.e. it needs more work) by clicking the 'ghost' button

For more information, see the poedit online help.

Localizing Inno Setup

MediaMonkey currently uses a third-party installer called Inno Setup. Inno Setup is available in numerous versions and in numerous languages. To ensure that the entire MediaMonkey product is translated consistently, it please: a) Recommend which translation file to use (since multiple files exist for many languages). See: http://www.jrsoftware.org/files/istrans/ b) If no installer translation has been made for version 4.1.8 of Inno Setup, please update the existing Inno Setup translation so that it reflects the strings that are used in Inno Setup version 4.1.8. This can be done using the tool located at: http://www2.arnes.si/~sopjsimo/translator.html in conjunction with the English source files Default.isl (included in mm-local.zip) and the translation file chosen in step 8a). In most cases, only 2-5 strings need to be updated.


When You're Done

Once you've verified your translation (note that you can't verify installer.po, or innosetup.isl, zip up the directory containing the .po/.mo/.isl/.txt files that you've generated and send them to: localize@mediamonkey.com .

Note: If you would also like to localize the help file and/or readme, that would be great as well. The readme can be done with a basic text editor, and the help file with any help editor. Note that the sources for the help file will change significantly, late in the beta cycle.