Highlighted Articles |
Translating .strings FilesThis document gives an overview of the old way to localize Tunnelblick, editing .strings files. For a description of the new way to localize Tunnelblick, see Localizing Tunnelblick. For notes about specific strings that are being translated, see Translation Notes. On This Page .strings FilesTunnelblick has two .strings files for each language:
There may also be a "Removed.strings" file, which contains strings that were used in an old version of Tunnelblick but are no longer being used. They may contain useful 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 could be editing either aNeedsTranslation.strings file or a Localizable.strings file — it is your choice. But only edit one file, not both. Editing .strings FilesIf you have Xcode, you can just double-click the files to open them in Xcode, which works fine. You can edit .strings files in To open one of the .strings files in
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)". Doing the TranslationsThe .strings files all have the same format. They contain a series of lines that look like this:
The first line, / 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. Here are some lines from a NeedsTranslation.strings file:
Notice that 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 to the user — this is what you as translator are to replace. Note that for the last three examples, both strings are identical in English. 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. Please do not modify anything in the file outside of the second string. "Localizable.strings" will have a "/ If a String is the Same in Both LanguagesIf a string is the same in both English and the target language, then put a hint of
This helps the program which process the strings files understand that the string does not need translation. Weird Characters in the StringsSome 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
we would translate that into Yoda's English by changing it to
(We'll ignore the fact that %2$@ needs to be capitalized because it now starts a sentence.) |