tw3 Translation Instructions
tw3 Translation Instructions
tw3 Translation Instructions
5, 18-Jan-2010
1. Preface
This document explains how you can translate ‘The Word’ (called TW in this doc)
into your own language. TW can be translated even in Unicode-only languages. If you
intend to translate TW into your own language you must read and understand this
document. If you want the translation you make to be made publicly available to other
users and officially accepted and published from TW main site, you will have to
submit the translated files and resources to me with a note saying that all copyright of
your work is released to me and I will have the right to further use, change and
distribute the translated file.
Visit and the forums here: http://forum.theword.gr/viewforum.php?f=12
2. What is translated?
The translation of the program refers to the messages, menus, buttons, etc that are
found from within TW. The add-on modules (or resources) that accompany the
program (e.g. Bibles, Commentaries, etc) are outside the scope of the translation of
the program itself. Almost every single message of TW (>99% of messages) can be
translated. There are only very few error messages (that normally do not appear to a
user) and some command-line advanced options that are not translated (99,9% of the
users will never see these).
1
The Word 3 translations notes, ver 0.5, 18-Jan-2010
name enclosed in square brackets [<section name>]. The first section you can see is
called [_main_]. Each section starts from the [<section name>] line and ends where
the next section starts. Each section defines messages for a specific
window/dialog/part of the program. Before each section there is usually a short
comment that explains how to display the dialog that contains the messages of the
section.
There are 5 special sections:
1. [_main_]: this is the first section at the top of the file. This section is very
short and only contains a few entries. The [_main_] section including all it’s
messages should NOT extend below the 20th line of the file.
2. [Messages]: this section contains general messages that appear usually at user-
dialogs or are used to created longer messages.
3. [Books]: This section contains translation of the books of the Bible used
throughout TW.
4. [Search.Patterns]: This is at the end of the file. This section is used for the
Clipboard monitor function of the program and needs special care. See
relative section below.
5. [Notice]: This section is used for the Donate dialog. It requires some special
handling since the text is encoded in RTF.
The name key is used for the File->Languages menu. Once you restart the program
you should see your new translation at this menu. The langid key is the language
identifier. Please, consult the forums or mail me to obtain the correct one for your
language. Now you are ready to translate your greek.lng file. Please, keep reading!
2
The Word 3 translations notes, ver 0.5, 18-Jan-2010
help you understand (when viewed side-by-side with the dialog that the
message appears) where exactly the message appears.
2. =: (the equal sign =). This comes after the key and before the translated
message. Don’t use spaces there please.
3. '<translated message>': This is the translated message. This is what you need
to translate. Notice that the message is enclosed in single quotes. Failing to
format the message properly will result in errors.
Notice that don't is written with 2 single quotes as don''t. This message will
appear in the program with one single quote. This is the most common error you
can do. If you make a mistake and use a single quote within a message, then this
message will NOT appear in the program at all.
2. You will notice that the & character is used in menus and dialog items. When &
comes before a letter, then this letter will appear underlined in the program. The
user will be able to access the menu or function this item describes using the ALT
key and the underlined letter. To understand this: search in the english.lng file for
the actFile.Caption entry (use the Search function of your editor). Notice that it
looks like this:
actFile.Caption='&File'
Notice now in TW at the main menu the File menu. Notice that F is underlined.
This is because of the & before the F in the ‘&File’ item. Click on TW and press
ALT+F. Notice that the file menu appears.
The character after the & is called ‘shortcut character’. It is important that you
don’t have duplicate shortcuts in a dialog. If you do so, the program will not be
able to know which function should execute when the ALT+<shortcut>
combination is pressed. Notice that this is a ‘per-dialog’ setting.
If you want to use the actual & character in a message, write it twice, for example:
lblTip.Caption='Tips && hints’
This will appear as Tips & hints in the program (notice that if you had only used
a single &, it would appear in the program as Tips _hints).
3. You will notice that in some messages, the #13 or #9 appear. The #13 means “new
line”. From TW3 onwards, long messages in hints wrap automatically (when
updating old translations, you should remove those #13 that were put just to wrap
lines). Please, be careful since some #13s are there because they start a new
paragraph. For example, notice the hints in the Bible search view -> Detailed tab
-> Operator buttons (the ones below the input box). Notice that they have very
long hints (e.g. the NearV button, check for cmdOpNear.Hint in the lng file).
Notice here that there are several #13 in order to format the message properly. The
first sentence (although is quite long) has no #13 within it, it automatically wraps.
3
The Word 3 translations notes, ver 0.5, 18-Jan-2010
The #9 is used for tab characters. There are very few, just keep them as they are
within your translated messages. Notice also that the #13 and #9 are outside the
single quotes. So, if you want to write a message with a new line, you should do it
like this:
lblTip.Hint='This is one line'#13'This is a second line'
Notice that the single quotes close before the #13 and reopen after it. No spaces
there!
4. Keep the %s and %d you find in the messages. Usually, in messages that are
assembled from other elements, there are placeholders. These are special strings
(e.g. the %s and %d) that represent a string or a number that will be replaced
there before the message is being shown. It is important that the order of the
placeholders (and of course the exact number) does not change (or a program
error will occur). For example,.
rc_booksearch_found='Found %d matches in [%s]'
This message appears in the book search view (F2) just below the input box when
a search is done (it says how many hits where found). Notice that the %d
represents the number of matches and the %s represents that name of the module
being searched. These are replaced before the message is displayed with the
appropriate number and title. Now, if you want to translate this to another
language, you need to keep the %d and %s in your translated message in that
order. For example you can write it:
rc_booksearch_found='%d hits detected in (%s)'
(obviously this is not a translation because you wouldn’t understand Greek, just
another way to write the same thing -think of it as your translated message).
Notice that the %d and %s are still there in the exact same order.
If you find a message with %% in it, then you have to use them if you want to use
the actual % character. Example:
rc_bookview_idx_progress='Creating index for %s: %d%%'
The last %% will be printed out as a single % (this message prints the percentage
of the index being created, e.g. Creating index for MODULE: 23%). This rule
only applies to a message that has at least one placeholder in it. If no placeholder
is found in a message, then you just use a single % and it displays normally.
4
The Word 3 translations notes, ver 0.5, 18-Jan-2010
4. Please, end all long hints (e.g. messages where the key is item.Hint='…') with a
period (.). ‘long hints’ are considered the ones that contain an explanation of the
function, apart from a short-description of it. There is no definite rule, check
what’s best.
7. IniTranslator program
You can download this software from here:
http://initranslator.sourceforge.net/wiki/index.php/Main_Page
This is a very useful program that will make the whole translation process much
easier. Please, keep in mind that:
1. This is a separate program which I have personally not used (others have with
good results)
2. If you use it, the [Search.Patterns] and the [Notice] sections will be deleted!
You need to add these later manually. Be very careful here. Some manual
editing will be necessary for these sections.
3. Comments are not pasted in the translated file (you can always open the
original english.lng file of course to check)
5
The Word 3 translations notes, ver 0.5, 18-Jan-2010
4. Press CTRL+M to open the ‘comments’ dialog: you will be able to see the
comments in the original file.
5. Experiment with the alternate way to translate by going to menu Plugins-
>Tree View. This view properly shows the single quotes there and it may
seem easier.
IniTranslator can use dictionaries for common words. It is very interesting to
download and use the “Microsoft Terminology Translations”. This is a list of
common words that are translated from Microsoft in several languages for Windows.
This will help you to properly translate some difficult terms (e.g. Hierarchy, View,
Edit) using the words that Microsoft also uses for it’s products (MS Office, Windows,
etc). To use such dictionaries you need to:
1. Go to http://www.microsoft.com/globaldev/tools/MILSGlossary.mspx and
download the file including all dictionaries. Unzip the file in a folder.
2. Use the MS Terminology Translations converter which is installed with the
InitTranslator (go to the start menu, under the IniTranslator section, you
will find a shortcut there).
3. With this tool, create a dictionary for the language you want to translate.
4. Now, from within IniTranslator, go to Dictionary -> Load dictionary menu
and load the dictionary you made. Now, when translating, you can find for
some messages a translation (right click -> Dictionary).
5. Check the help file of IniTranslator, under the MS Terminology Translations
builder section.
8. Special sections
8.1. Section [_main_]
This is the first section of the .lng file. It should not extend below the 20th line of the
file. The name and langid keys are described above. The version key is not used in
the program but you should use it in order to properly identify the version of the
language file. Please, use the format <TW version>-<lng file version>. Each time
you update this file, you should increase the <lng file version> by one. The <TW
version> should always be the version of TW you used to create this lng file. Please,
be consistent with this.
The font key is optional. If it is defined, then this font will be used for all menus in
the program. This is only applied at program startup (not when changing language). If
unsure, don’t include this key (leave it commented out with the # in the beginning).
6
The Word 3 translations notes, ver 0.5, 18-Jan-2010
Examples:
-The 'Mark' book will be matched by: M, Mk, Mark, Mrk, Mr in English. All
these strings follow the above rules.
- For 1Cor book, one pattern used is
1.Corinthians1|46
Notice that there is a dot after 1. This means that both 1Cor and 1.Cor will match
- Scoring example: notice that in the enlish.lng file there is the entry P0hilemon|57.
Notice there is a 0 after the P (this is not a mistake). This 0 will not break this pattern,
on the contrary it helps to always score this entry less than Philippians|50. Suppose, a
7
The Word 3 translations notes, ver 0.5, 18-Jan-2010
word is found in a text to be parsed as "Phl 1:1". Now, both P0hilemon and
Philippians match Phl. But notice, that Philippians contains all 3 letters of Phl (P, h,
l) closer to the first letter of the pattern (P). This will give to Philippians a higher
score and will be selected as the best match for Phl.
- For Greek there is the following entry for Mark:
ΜΑΡΚΟΥΝΣ|41
Actually, the Greek book name is: ΜΑΡΚΟΣ. Some older bibles use the word
ΜΑΡΚΟΝ (notice the N instead of Σ at the end). The same book can also be found
(when referred in second person) as ΜΑΡΚΟΥ and other times as ΜΑΡΚΟ (without
the final Σ or N).
Now, the entry in the greek.lng file says ΜΑΡΚΟΥΝΣ which is completely wrong
as a stand-alone word. BUT it matched all the above 4 different cases that one could
write for the book of Mark. From this example it should be obvious that following the
above rules, the entries here do not need to be 'correct', they just serve as matching
patterns. That is why there are generally more letters than normal.
SO, the logical rule for this section is:
"Since words mostly change at their ending, add the book names with ALL the
possible different endings appended in such a way that one does not contradict with
another."
If for a book, two completely different forms are possible, just add two or more
entries with the same <book number>. So, for "Habakuk" you can also add an entry
with "Habakkuk" in case someone uses two k.
For Obadja you could write Obadjia if some people could write it as Obadia and
others as Obadja.
Generally, using more letters will not break a pattern. For example
1.Thessallonnians|52 is a good pattern since people may not remember if it is
written with ss or ll or nn. This pattern will match all the cases.
For books with more than one index (e.g. 1Samuel and 2Samuel) you can add:
1Samuel, ISamuel, Samuel1 and any other combination as different entries
(remember, you can have multiple entries for a single book.
Due to the nature of the CM, it is possible that many common words will be
incorrectly located as valid book name. For example, the common English phrase
"Am I“ will be parsed as Amos 1 (Am will match Amos, and I is the roman number
1).
To avoid such common word errors, it is possible to add patterns in this section that
start with a minus/hypen character, e.g.
-ami|0
In these cases, the pattern (which is ami here, as the minus is ignored), will work as
an exception, e.g. they will disallow a match. It is really difficult to predict or try to
think of exceptions. The best way to add some common exceptions for your language
is to use the CM in some web texts of your language (e.g. browse the Internet, find
8
The Word 3 translations notes, ver 0.5, 18-Jan-2010
pages with a lot of text and select/copy them so that CM gets a chance to identify
verse references. Noticing the probably false negatives, you may be able to create a
short list of exceptions. If this seems complicated, just ignore it and add no
exceptions.
A critical notice: the program will NOT display the translated notice if:
The rtf content is corrupted (e.g. if you forgot to copy/paste the last }
character).
If the content is not quite ‘similar’ to the English text (similarity is counted in
a way that assures that the content and formatting is retained during the
translation).