Translating KeePass
Translating KeePass 2.x
In order to create/update a translation for KeePass 2.x,
download the latest TrlUtil tool from the bottom of the
translations page,
run it, possibly open an existing translation file (if one exists),
fill in all missing translations, and save the file.
Translating KeePass 1.x
Creating a New KeePass 1.x Translation
First of all, send an e-mail to the KeePass developer to request a source
language file.
The KeePass developer will send you a file called 'GermanSrc.lng'.
Rename it to '<YourLanguage>.lng'
(for example, for French the file would be called 'French.lng').
Afterwards, open it with your favorite text editor.
You can see strings, delimited by '|' characters.
First there are English strings, surrounded by two '|' characters.
These strings are followed by the translated ones, also surrounded by '|'.
You now just need to replace all German strings by the ones of your language.
Do not modify the English ones!
There are a few special fields, which should not be translated literally,
but set to appropriate values:
~LANGUAGENAME should be set to the name of the language.
~LANGUAGEVERSION should be set to the KeePass version, for
which the translation has been created.
~LANGUAGEAUTHOR should be set to your name.
~LANGUAGEAUTHOREMAIL should be set to something that allows
contacting you. This may be an e-mail address, but other things (e.g. the URL
of a website) are fine, too.
~LANGISO6391CODE should be set to the
ISO 639-1 code of your language.
UTF-8 Encoding
The language file must be UTF-8 encoded. KeePass 1.04 and higher only
supports UTF-8 encoded files.
If your text editor doesn't support UTF-8 encoding or you don't know how
to save it in that format, please follow these steps:
- Get LibreOffice.
- Open your translation file in LibreOffice Writer.
- Select 'File' → 'Save As...'. Choose 'Text Encoded (.txt)' as
file type.
- In the confirmation dialog about losing formatting options,
click 'Use Text Encoded Format'.
- In the file encoding combo box, select 'Unicode (UTF-8)'. Click 'OK'.
That's it. Your language file now is UTF-8 encoded.
Updating Existing Translations
To update translations (when a new KeePass version is released that requires
an updated version of your translation) a utility called ChkTrans is used.
This utility will check your
translation file to see if you have translated all strings, and it makes a
nice report which strings you haven't translated or which strings aren't
needed any more.
Go to the KeePass translations page.
On the bottom of this page you can download the ChkTrans utility.
Additionally download the latest "language reference file".
You can also find it on the bottom of the translations page.
This file is used by the ChkTrans utility to compare the latest strings against your
translation.
When you have downloaded the above two ZIPs, unpack them into the
same directory where your translation file is.
If you are, for example, the French translator you would execute the
utility like this (from the command line):
ChkTrans.exe French.lng
The utility will then analyze your language file and write all errors into
an output file called 'Report.txt' in the same directory. This file
reports
all strings that you forgot to translate, which you forgot to remove,
etc.
If you have made a valid translation file the utility will say something
like "You have made a 100% perfectly valid translation", otherwise it
just reports that there were errors and you must have a look into the
'Report.txt' file for more information.
And now what if a new version of KeePass is released? Simple: you get
the latest language reference file. You run the ChkTrans utility and get a
nice report which strings are missing and outdated. You now edit your
translation until the ChkTrans utility thinks that it's fine.
|