Author Topic: How to make a translation for MUTE?  (Read 4361 times)

0 Members and 1 Guest are viewing this topic.

Offline Markus

  • Administrator
  • Elite
  • *****
  • Posts: 5740
  • Karma: +25/-8
    • View Profile
How to make a translation for MUTE?
« on: October 30, 2004, 06:16:15 PM »

Translation Support in MUTE
MUTE's translation system supports adding new languages at runtime without recompilation and without the need for special tools. Language files can be created or modified with any text editor, and the resulting translation changes can be seen simply by restarting MUTE. Furthermore, translated phrases are mapped according to language-independent keys (like "file_menu") instead of being keyed by the English phrases themselves (like "File"). Thus, when the same English phrase is used in two different contexts, different phrases can be used in the translation target language. For example, though in English we use the word "File" to describe a menu and to describe an object that is being downloaded, another language might use different words to describe these two concepts. By assigning different keys to the two concepts (for example, "file_menu" and "download_file"), we can give translators room to express subtle variations and distinctions that may be present in non-English languages but not present in English.

All of these features set MUTE's translation system apart from existing systems, some of which require program recompilation to add additional languages and others which require the use of relatively complicated tools (such as GNU gettext). Translation in MUTE should be easy for non-programmers on any computing platform yet powerful enough to support thorough and accurate translation.
Translation Basics
As mentioned above, all translatable phrases inside the MUTE File Sharing application are represented by language-independent keys, such as "file_menu" and "browse_button". When MUTE runs, it uses language files to map these keys into phrases of human language, such as "File" and "Browse...". These files are kept in the MUTE/languages folder, and they must have the extension ".txt" (this extension ensures that language files can be downloaded properly by web browsers on various platforms).

The format of language files is extraordinarily simple: each line contains a key and a corresponding human-language phrase. For example, consider the default language file, English.txt. For clarity, phrases in this file are grouped according to the tabs in the MUTE user interface, though no specific order is required in a language file. Here is the section of the English file that maps the keys associated with MUTE's Search tab:

search_tab "Search"

search_button "Search"
stop_button "Stop"

result_header_file_name "File Name"
result_header_size "Size"
result_header_hash "Hash"
result_header_virtual_address "Virtual Address"

download_button "Download"

The human-language phrases are in quotes after each key. By modifying these phrases, you can change the text displayed on MUTE's Search screen (you must restart MUTE to see your changes). Of course, there is no reason to modify English.txt, since English is MUTE's native language.

To make a translation, you could copy English.txt to a file called MyLanguage.txt and then modify the quoted strings in your file. If you save MyLanguage.txt, "MyLanguage" will appear as one of the Natural Language options in MUTE's Settings panel then next time you start MUTE. At this point, you have all of the information you need to start translating MUTE File Sharing. Of course, the process outlined so far might be a bit tedious: you could find yourself searching through language files over and over to find the next phrase that needs translation. In the following section, I'll give you some tips to make translation easier.
Speeding Up the Translation Process
MUTE ships with a special language file called TranslationHelper.txt. This file is empty and contains no keys or human-language phrases. When MUTE fails to map a non-existing key from the current language file, it defaults to displaying that key in place of the missing phase. This behavior makes translation errors and omissions glaringly obvious (the other option, displaying default English phrases for missing keys, would make translation errors much harder to notice). Of course, when handed an empty language file like TranslationHelper.txt, MUTE displays the keys everywhere throughout the interface in place of human-language phrases. This behavior can help you in your translation efforts by showing you which key goes where in the user interface. For example, here is a view of the Search tab when TranslationHelper is selected as the current language:

The most sophisticated translation method involves running two copies of MUTE simultaneously so you can compare English phrases to the keys shown by the TranslationHelper right in the user interface. The easiest way to launch two copies of MUTE is to make a copy of your MUTE directory and then edit the settings/port.ini file of the copy so that each copy will run on a unique network port (try giving the second instance of MUTE a port like 4901). In one instance of MUTE, you should leave the default English language setting, while in the second instance, you can select TranslationHelper as the language (and, of course, restart that copy of MUTE to see the result).

With these two MUTE windows side-by-side, you can then make a copy of the English.txt file and start creating your translation by replacing the English phrases with phrases from your own language. You can using the two MUTE windows to help you figure out which phrase goes where in the user interface. Keep in mind that certain phrases are only used during the "First Startup" screens that are shown the first time you run MUTE. Thus, you should still comb through your language file by hand at the end to deal with any lingering English phrases that you might have missed while interacting with the MUTE user interface.

From me:

If you have done a translation for MUTE you can post it either as an article  with subject: MUTE <version>: <language> translation or contact Jason directly (check out the user profile from jcr13 or watch out for his mail address on the official MUTE website)