My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
cTranslate  
Translating Tunnelblick
Updated Jul 18, 2011 by jkbull...@gmail.com

Translating Tunnelblick


This document describes how to translate the two types of files that Tunnelblick uses for translation: RTF files and ".strings" files..


RTF Files

Tunnelblick has two RTF files for each language:

  • A "Description.rtf" file, which contains a description of the license under which Tunnelblick may be distributed.
  • A "Credits.rtf" file, which lists people who have contributed code or translations to Tunnelblick.
These files should be translated using TextEdit or another editor (such as Windows Word or WordPad) that can edit RTF files. They may be opened in TextEdit by double-clicking them -- no special procedure is needed.

Note: The primary translator(s) of the language being translated should be listed at the end of the first section of the "Credits.rtf" file.


".strings" Files

Tunnelblick also has two ".strings" files for each language:

  • A "Localizable.strings" file, which contains all of the strings used by Tunnelblick, whether they have been translated or not; and
  • A "NeedsTranslations.strings" file, which contains only the strings that have not yet been translated.

The rest of this document describes how to work with these ".strings" files.


Integrating the ".strings" Files into Tunnelblick

To integrate your translation into Tunnelblick, send your translated or partially translated .strings file to project owner Jon via email at jkbullard at gmail dot com. A program is used to integrate the .strings files into Tunnelblick. The program:

  • Accepts Localizable.strings or NeedsTranslation.strings files.
  • Accepts files with translated and untranslated strings, i.e. partially translated files.
  • Accepts strings in any order.
  • Marks strings as needing translation or removes that marking.
  • Creates the NeedsTranslations.strings file.

Format of the ".strings" Files

Both ".strings" files have the same format. They contain a series of lines that look like this:

/* Button */
"Disconnect" = "Desconectar";

The first line, /* Button */, is a hint about what the string is used for -- this one tells you that the string "Disconnect" is for a button. Other hints may indicate a string is for the title of a window, or the text of a window, or is a status message from OpenVPN.

The second line has two strings, separated by an equal sign and followed by a semicolon. The first string is in the language that the application was developed in (English), and the second string is in the "target" language.

In the example above, from the "ES.lproj" folder (Spanish), "Disconnect" is the English string, and "Desconectar" is the equivalent in Spanish.

You can edit this file in TextEdit (but you need to open it in a special way, see Opening Localizable.strings Files) change the second string on each line, and send it back to the Tunnelblick project for incorporation into Tunnelblick. You can, if you wish, put it into your own copy of Tunnelblick, too (see Adding Your Translations to Your Copy of Tunnelblick).

You Need Not Translate Everything

If you can translate everything, that's great. But there are a lot of strings. They are placed in the .strings files in approximate order of importance, so start at the top and work your way down.

Any string with a comment "VPNService" does not need to be translated for a standard build of Tunnelblick -- these strings are used only by VPN service providers in their registration windows, and are not usually built into Tunnelblick. They appear last in the .strings files for this reason.

Doing the Translations

If you are the first translator for a language, you will be editing a Localizable.strings file. If you are working on a language that has been worked on before, you will be editing a NeedsTranslation.strings file.

Either file will have lines such as the following:

/`*` Connection status `*`/
"AUTH" = "Authorizing";

/`*` Window title `*`/
"Authentication failed" = "Authentication failed";

/`*` Checkbox name `*`/
"Automatically connect on launch" = "Automatically connect on launch";

/`*` Button `*`/
"Cancel" = "Cancel";

Notice that, in this file, both of the strings on each line are in English (sort of). The string "AUTH" is a string describing a connection's status -- what it is doing -- in this case, the status is something called "AUTH". The second string is the string as it should be displayed in English -- this is what you as translator are to replace. Note that for the last three examples, both strings are identical. That is more common. The program requests that the title of a window be "Authentication failed", for example, and, in English, that should be displayed as "Authentication failed".

Translation consists of replacing the second string on each line with the target language's equivalent, using the hint on the line above the strings.

"Localizable.strings" will have a "/* Needs Translation */" comment before every line that appears to not have been translated. (A program we use to create these files decides that a line needs translating if the left-side and right-side strings are identical, which does not always mean they need translation, but is a reasonable guess.) You should remove the "/* Needs Translation */" comments on any strings that you have translated.

If a String is the Same in Both Languages

If a string is the same in both the development language and the target language, then put a hint of

/* TRANSLATION SAME AS DEVELOPMENT */
before the string. For example,

/* TRANSLATION SAME AS DEVELOPMENT */ /* Button */
"OK" = "OK";

This helps the program which process the strings files understand that the string does not need translation.

Editing Localizable.strings and NeedsTranslation.strings Files

You can edit Localizable.strings files in TextEdit, but you need to open them a special way. If you double-click them, or just File | Open them, things might look OK, but they aren't. The .strings files are in a special format called UTF-8, and need to be opened, edited, and saved in that format or bad things happen (such as losing diacritical marks or changing characters into different characters!)

To open one of the .strings files in TextEdit:

  1. Open TextEdit, which is in /Applications
  2. Click "File", then "Open"
  3. Navigate to and select the .strings file you wish to edit
  4. At the bottom of the window to the right of "Plain Text Encoding", select "Unicode (UTF-8)
  5. At the bottom of the window, remove the check in the "Ignore rich text commands" checkbox if there is one
  6. Click the "Open" button

Now you can edit the file. When you are done, be sure to save it. If you do a "Save As", be sure to save it as "Unicode (UTF-8)".

Here is what the bottom of the "Open file" dialog window should look like when you click the "Open" button:

Weird Characters in the Strings

Some of the strings have character sequences of "\n". This causes a line break when the text is displayed. A sequence of "\n\n" would cause a line break followed by an empty line.

Some of the strings have %@, %d, or other special sequences of characters. They indicate a place where some other item (a filename, a number, etc.) will be inserted into the string. Usually that's all there is to it. However, when there are two or more such items in one string, the target language may need to use them in a different order than English uses.

Here's an example: for English speakers, one of the distinctive features of the character Yoda in Star Wars was the way he spoke -- he spoke "backwards". For example, he would say "Hot the food is", when the usual way to express that in English is "The food is hot". If the line in Localizable.strings was

"The %@ is %@" = "The %1$@ is %2$@";

we would translate that into Yoda's English by changing it to

"The %@ is %@" = "%2$@ the %1$@ is"

(We'll ignore the fact that %2$@ needs to be capitalized because it now starts a sentence.)


PLEASE USE THE TUNNELBLICK DISCUSSION GROUP FOR COMMENTS OR QUESTIONS

Powered by Google Project Hosting