L10n:MozillaTranslator

From MozillaWiki
Revision as of 10:50, 15 October 2005 by Tsahi (talk | contribs) (→‎Translating the Strings: - edit image file)
Jump to navigation Jump to search

MozillaTranslator is a tool to translate programs in the Mozilla family.

If you are looking for the newest version the MozillaTranslator tool, the latest 5.04 version is available from the following file: mt504.zip. Despite it having written "version 5.03" in several places, this is version 5.04.

MozillaTranslator is written in Java. this means (a) that it will work on any platform that supports Java (Windows/Linux/Mac/Solaris etc.), and (b) that you need to make sure you have Java 1.4 and above Installed on your system.

How to Use

Creating a new Product

The first thing you need to do is to create a new product. First, obtain the .jar files that include the en-US language pack. there are several ways to do that:

  1. If you have an installed copy of the program you want to translate, open the installation directory of the program. under a folder named 'chrome' there, you will find a file named en-US.jar (or something similar), and possibly also en-win.jar, en-mac.jar, en-unix.jar and US.jar.
  2. extract the language pack (normally called langenus.xpi) from the installer, as described here. then use a Zip utility to open it and extract the files mentioned in (1) from it. similarly, extract the region pack (exists in Mozilla Suite) named regus.xpi and extract US.jar from it.

From the File menu select Manage Products, and in the window that opens, press the Add button.

  • Name: Give a meaningfull name to this product.
  • Jar file: Enter the path to the en-US.jar file you extracted earlier.
  • Platforms: Click the Add button to add files for each platform, if applicable.
    • Name: Platform name. Enter a descriptive name.
    • Jar file: Path to the .jar file for this platform.
    • Type: Select the platform for which this .jar file is intended for.
      Repeat theses steps for each supported platform.
  • Jar file (regional): Enter the path to US.jar.
  • Custom Files: You may add additional files to the language pack, such as local search engines or a localized bookmarks file. This part doesn't always work.

Click OK to close the window. You should see the new product in the previous window. Click Exit to close it.

Now, from the File menu select Update Product. From the new window, select the product you have just created, and click OK. You will see the Show which columns window. it is best to select Key, Text: Original, Text: Translated, and Keep original. Enter your locale code at the bottom, and click OK. you will see the complete list of strings that need to be translated.

Importing Existing Translation

If you have access to a translation of an earlier version of the program than the one you are working on, you can import it and use the parts of it that are still relevant. Follow these steps:

  1. From the Import menu, select Import Translation.
    • selected: Select the product and the component that you are importing.
    • File: The path to the .jar file that includes the translation of the selected component.
    • Locale: Enter your locale, in a ab-CD format.
  2. Click OK.

Repeat these steps for every component of the product.

Translating the Strings

The translation work is done at the Chrome view. From the Edit menu, select Chrome view. In the Show which columns window, select the columns as above, and click OK.

The Chrome view is split in two: the left pane shows the products tree. Under Root, you will see a branch for each product you added. Under each product, there is a brance for each component: Platform Neutral, Regional files, the platform-specific branches, and the Custom files. Under each component, there is a branch for every folder (and sub-branches for sub-folders) in the corresponding .jar file. Under each folder branch, there is one branch called MT_default, which contains the files in that folder. Any additional sub-folders will be listed along side MT_default. To start working on a file, select it with the mouse. The strings in that file will appear in the right pane.

The right pane contains the content of the files. for DTD and Properties files, this content will be the strings of that file. If you selected the Text: Translated column in the Show which column dialog, you can select the cell in the table and start writing the translation.

Tip: If you leave a string untranslated, the original string will be used in the exported language pack.

Tip:Keys that end with "accesskey" represent shortcut keys, that allow accessing menus and buttons with the Alt+[key] combination. Keys that end with "controlkey" represent shortcut keys that allow quick access to features with the Ctrl+[key] combination.

Tip: Checking the Keep column for a string, if selected, will keep the original string in the exported language pack, overriding the translated string.

You can sort the strings table by one of the columns, by clicking on the column header to sort in decending order, or shift+click for acending order.

The Edit Phrase Dialog

If a string is too long, it might be difficult to edit it in the chrome view table. In this case, you can click the Edit selected phrase button at the top-left corner of the Chrome view window (or select Edit selected phrase from the Edit menu, or just press Alt+E) to open the Edit Phrase dialog. This dialog has two tabs:

  • The Basic tab is divided to two: the top half contains the original string, and the bottom half contains the translated string, if there is a translation. If there is no translation yet, it will be empty. between the two halves, there are three buttons and a checkbox.
    • Copy copies the original string to the translated string, and replaces it.
    • Reset undoes any changes made to the translated string since this window was opened.
    • Clear clears the translated string box.
    • Keep Original should check the box in the Keep column in the table, but it doesn't, because of a bug. Just ignore it.
  • The Advanced tab contains extended information about the current string.
    • Information contains information about the string location: product, component, folder, file, etc.
    • Original contains information about the Control and Alt access keys of the current string, if such exist. Since the format for the these keys is not standard throughout the language files, sometimes MT failes to detect these values.
    • Translation contains the same information about the corresponding translated text. It also allows adding a comment to this string, and set it's status. This is useful for colaboration between several translation team members, or to make a note for yourself for later reference.

At the bottom of this window there are three buttons.

  • Close: Save any changes and close the window.
  • Previous/Next: Save any changes and move to the previous or next string, if one exists.

The (yet to be titled) Edit Image Dialog

Images (.gif or .png extension), such as those under the help/images/ branch of Mozilla Suite, can also be "translated". Sometimes images are screenshots that contain text, and you would like it to be the text of your translation instead of the English text. Or, if you are translating to a Right-To-Left language, such as Hebrew, Arabic or Persian, the program layout is reversed and looks different from the original layout. In those cases, you can import your own images to replace the original images included in the language pack. Follow these steps:

  1. Select an image file from the left pane.
  2. In the right pane you will see the text "Binary files cannot be translated" in the Text: Orininal column. Select this line.
  3. Click the Edit Image file button from the top-left corner of the Chrome view window.

The (yet to be titled) window is divided to two:

  • The upper half contains the original image. The Save button allows you to export the image to a file you can edit with an external image manipulation program.
  • The lower half may contain a "tralsated" image, if such exist, or the text "No picture Loaded" if non exists. If no image is loaded as a translation, the original image will be used in the language pack. This half contains these buttons:
    • Load: allows loading an image from disk. This image will be used in the exported language pack, instead of the original image. Pay attention to have the replacement image at the same size and format of the original one. A different size may cause layout problems when the image is displayed. A different format will require you to change the reference to the image in the document that displays it. Mozilla supports PNG, GIF, JPG, ICO, BMP formats.
    • Save: allows exporting the translated image to a file on disk.
    • Clear: clears the translated image(?).
    • Reset: restores the image that was loaded when the window was opened(?).

When you are done, click OK to accept the changes, or Cancel to cancel them.

Migrating to a Newer Program Version

Colaborating with Other Team Members

Migrating from One Product to Another

Menu Items

File

Import

Export

Edit

Advanced

Help