Forum has been closed due to ongoing spam issues.
It is kept search and read-able as a reference. Registrations and logins are disabled. Please use the mailing lists instead.

   SearchSearch
Krusader Translation HOWTO

 
Krusader Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
Frank
Documentation & Marketing Coordinator


Joined: 19 Jun 2003
Posts: 1264
Location: Belgium

PostPosted: Mon Aug 25, 2003 8:36 am    Post subject: Krusader Translation HOWTO

Krusader Translation HowTo

Last update: 28.08.2009
NOTE:
Krusader is now developend in KDE Extragear SVN.
Please join your KDE i10n team if you like to continue translate the Krusader GUI or the Krusader handbook.
http://l10n.kde.org/teams-list.php

All following information in this howto is outdated (but maybe some people will find some interesting technical translation information here).


If you like to translate Krusader please read at least Chapter 3. When is a Translation Update Needed?.

Any translation (even partial translations) are accepted by the Krusader-Krew at any time (feature freeze or not)

From now on, we will commit the translations in CVS with a "good descriptive comment", so you can see in the
"Last log entry" column the actual status of the translations (don't look at the Age column any more).
Use i18n_status and ViewCVS to see the live translation status of Krusader
NOTE: From now on we will update the foo.po files for you; so you only need to edit foo.po with Kbabel (some translators updated foo.po the wrong way, so they translated obsolete messages --this we want to prevent, of course).

Thanks for your cooperation!

New languages are always welcome!

Frank Schoolmeesters




LEGAL NOTICE & DISCLAIMER, look at the end of this document.


Table of Contents
1. Introduction
2. New Translations - translators
3. When is a Translation Update Needed?
4. Preparation
5. Translating foo.po with KBabel
6. Compiling foo.po
7. Check Krusader in your Native Language
7.1 Why do this?
7.2 When you updated an Existing Translation
7.3 When you have made a New Translation
7.4 When you don't Recompile Krusader
7.5 When you don't do 6.3 or 6.4
8. Howto change language ?
9. Translation Update
9.1 Updating krusader.pot
9.2 Updating foo.po
10. If you need More Information...:
10.1 "msg..." Commands
10.2 KDE Translation HowTo
11. Congratulations & Credits
12. Licence


1. Introduction

English is not my native language; therefore, you may notice strange sentence constructions.
Do not hesitate to let me know if something is not clear to you, or if you have a remark about this HowTo.
The intention is to help you to translate Krusader (or other Linux applications) into your native language. It does not pretend to be an advanced document.
I am NOT an expert, nor a Linux guru!
I decided to write down my experiences in this HowTo, after I had translated Krusader to my native language, to help other, new Krusader translators.

The first time or the beginning is sometimes difficult, but afterwards, you will see that it is easy to translate Krusader to your native Language.

"i18n" = short for "internationalization", basically means "translation related"
"l10n" = short for "localization", basically means "pertaining to country specific settings" (currency, units, flags, etc.)
For a brief explanation of the original meanings and the developmental side of both terms take a look at here.


The Krusader translations are stored in the "~/source/krusader-x.xx/po" directory.
  • 'krusader.pot' is the original English text (template for the translation foo.po)
  • 'foo.po' are the translations
  • 'foo.gmo' are the compiled foo.po translations (binaries)

Krusader supports the following languages:
  1. English (krusader.pot), thanks to the Krusader Krew
  2. Bosnian (bs.po), thanks to Asim Husanovic
  3. Brazilian Portuguese (pt_BR.po), thanks to Doutor Zero
  4. Bulgarian (bg.po), thanks to Milen Ivanov
  5. Catalan (ca.po), thanks to Rafael Munoz Rodriguez, Quim Perez
  6. Czech (cs.po), thanks to Mitek and Martin Sixta
  7. Chinese Simplified (zh_CN.po), thanks to Jinghua Luo
  8. German (de.po), thanks to Christoph Thielecke and Dirk Eschler
  9. Greek (el.po), thanks to Spiros Georgaras
  10. Danish (da.po), thanks to Anders Bruun Olsen, Christian Sonne
  11. French (fr.po), thanks to René-Pierre Lehmann
  12. Hungarian (hu.po), thanks to Kukk Zoltan and Arpad Biro
  13. Italian (it.po), thanks to Giuseppe Bordoni
  14. Japanese (ja.po), thanks to UTUMI Hirosi
  15. Lithuanian (lt.po), thanks to Dovydas Sankauskas
  16. Polish (pl.po), thanks to Marcin Szafran, Lukasz Janyst, Marcin Garski
  17. Portugese (pt.po), thanks to Bruno Queirós
  18. Russian (ru.po), thanks to Dmitry V. Chernyak
  19. Serbian (sr.po, sr*Latn.po), thanks to Sasa Tomic
  20. Slovak (sk.po), thanks to Zdenko Podobný
  21. Slovenian (sl.po), thanks to Matej Urbancic
  22. Swedish (sv.po), thanks to Eric Johanssen and Anders Lindén
  23. Turkish (tr.po), thanks to Bekir Sonat
  24. Dutch (nl.po) -> made by me , Frank Schoolmeesters
  25. Spanish (es.po), thanks to Rafael Munoz Rodriguez
  26. Ukrainian (uk.po), thanks to Ivan Petrouchtchak

Because Krusader is under continuous development, it's possible that this list is not up-to-date.

Use i18n_status and ViewCVS to see live data on the current Krusader translations (foo.po files).
A language abbreviation list can be found here.

If Krusader is already translated into your native language, it is possible that it needs a translation update.

If your native language is up-to-date you might like to translate Krename, a powerful batch renamer for KDE 3.x which is supported by Krusader.


2. New translations - translators
If your native language is not listed above, you will have to translate Krusader to your native language.
It's not difficult to translate! Many bi-linguals can do it, it just takes some time to do it.
A Newbie can do it and you don't have to be a programmer.
Dirk Eschler is the Krusader i18n coordinator. Contact him if you wish to translate Krusader into your native language.
This HowTo is very detailled and pretty self-explanatory, but if you still need some help, you can always contact Dirk Eschler or me, Frank.

Even when there is already a translator for your native language, it is always verry interesting to have a second or third translator.
Regularly the translator is not avialable when a translation update is needed (studies, holyday, ...),
so you will get a partial translation and that is a pitty.
Even when the translator is available, you could always proofread the translation.
UPDATING the translations important, otherwise the translations are almost useless.
Please contact the translator of your native language, he will appreciate this verry much that you will offer some help.
If he does not reply please contact Dirk Eschler.


3. When is a Translation Update Needed?
Before we release a stable version of Krusader, we bring out at least one beta version.
From that moment on there is a feature freeze and only bugs will be fixed.
This means that translators can update their translations, for the coming stable.
Normally, all the Krusader translators will receive an e-mail from Dirk Eschler, to invite you to update Krusader translations.
We will update all foo.po files against krusader.pot, just before the beta is to be released, so you will have only to edit the new foo.poo file with Kbabel.
You don't have to worry any more about how foo.poo must be updated. In the past some translators updated foo.po the wrong way, thereby translating obsolete messages. We want to prevent this, of course.
When you are have finished the translation please send it to Dirk Eschler.

4. Preparation

If you decide to update a existing language or to add a new language, please do the following:
  • Download the "feature freeze" beta version, or the latest available CVS version of Krusader. If you are not familiar with CVS, download the latest Krusader CVS sourcecode snapshot (nightly tarball) from here.
  • Install or upgrade the Krusader, if needed please read the installation instructions and the FAQ.
Because Kbabel is an easy to use and powerful translation tool; therefore, I am only talking about Kbabel in this HowTo.
Translations can also be done with, e.g., (X)Emacs or a text-editor, but this is probably only done by advanced translators.
When you have installed the "Software Development Kit for the K Desktop Environment." (kdesdk-'version_number' RPM package) then Kbabel should be on your system, if not please install it.


If you are unfamiliar with Kbabel please read first the online Kbabel handbook, or the offline version (available in the help menu of KBabel).

The next passage will explain, in brief, how to configure the most important settings in Kbabel.
  • Run your Linux distribution in your native language
  • Find out what is your native 'language abbreviation' is with the following command
    Code:
    $ echo $LANG

    (for example: en=English, nl=Dutch, fr=French, it=Italian, etc.)
    Please look also at the KDE Translators Center.It has a language abbreviation list, probably your language (+ abbreviation) will be listed here, use one of these supported (KDE) language abbreviations.
    Note: In all the text which follows foo='your language abbreviation'
  • When you click on your native language in the KDE Translators Center you will find translation information of your native language.
    Often you will find some rules for translating from English to your native language; apply these rules so that every KDE, GNOME, etc., application is translated consistently.
    Probably, you will find there a native KBabel manual or instructions for your native language.
    If you still have questions about your native language, please contact the foo language team leader of the KDE translating team.
  • Download your native KDE translation database (e.g., "kde-i18n/nl/messages" for Dutch) or check it out from cvs.
  • Start KBabel, it will ask you to fill in some information, such as, header information for the po file: your name, your native name (used for special characters if your native language has some), your e-mail address, full name of your native language (in your native language), language code ("nl" for Dutch), language-discussion group (for Dutch "i18n@kde.nl"), time zone (+0100), number of singular/plural forms (this depends on your native language), etc.
  • Configure the other settings the way you like (read the Kbabel handbook and read the available documentation of your native language team)
  • Configure Kbabel that it uses the UTF-8 encoding, otherwise special characters will be truncated
  • Set up the translation database of Kbabel: Settings -> configure dictionary -> Translation Database -> Tab: Database, Scan directories and subdirectories -> select the download file (e.g. "kde-i18n/nl/messages" for Dutch)
  • Now you can drink a cup of coffee (or do something else), generating this database will take about 10 to 30 minutes.
    It will be your friend when you translate Krusader
    This great feature will allow you to do a "Rough Translation", about 100 messages will be 100% translated and about 200-300 messages will be translated partially, without doing anything!
    You can also check if you are translating consistently (click on the Dictionary button) with the rest of the KDE applications, e.g., a message like "Open File" can be probably be translated in about 3 different manners in your native language, it is here that the translation database will help you!. You can check how it should be preferentially translated. It reduces a lot of the translation work..


5. Translating foo.po with KBabel
  • Open 'krusader.pot' (in the "~/source/krusader-x.xx/po" directory) and "save as" 'foo.po'
  • You will now see 4 windows:
    - upper left: the English text (read only, the current msgid field)
    - lower left: the window where you will type your translation (msgstr field related to the msgid field)
    - upper right: the source code file(s) + line number where the English text comes from
    - lower right: your friend the translation dictionary and other useful functions to help you translate
  • Go to menu "Tools" -> "Rough Translation". KBabel will try to translate as much as possible for you!
  • Start translating (click on the dictionary button for every message, or use the "automatic" function, so that you can translate consistently)
  • With "PgDn" you go to the next translation, and so on.
  • There are 983 messages to translate in 'Krusader-1.50', this will take some time (You can divide the translation work over several days, if you like, simply save and reopen 'foo.po' to continue.)
  • Sometimes it can be useful to start Krusader and take a look at where the translated text will appear.
  • When everything is translated, do a spelling check with "CTRL + I", keyboard mistypes (typos) are easily made without notice. Sometimes the spelling checker is a bit too strict (at least in Dutch), but is still a very useful tool to find typos.
  • Go to menu "Tools" -> "Validation" -> "check all validations". This will check for all sorts of errors (it does not fix typos!), it will check the integrity of the po file (command-line function: "$msgfmt foo.po").



6. Compiling foo.po
  • When you finish your translation or make a part of it you need to compile foo.po into binary format. This will also check foo.po for errors, like "check all validations" in KBabel (it doesn't check your translations for spelling errors and typos).
  • Compile foo.po with the following command:
    Code:
    [~/source/krusader-x.xx/po]$ msgfmt foo.po --statistics -c -v --output-file=foo.gmo

    Hint: If "msgfmt" is not on your computer, install "GNU libraries and utilities for producing multi-lingual messages."
    (gettext_'version_number' RPM package)


  • If everything is OK you get an answer like "983 translated messages" and the binary "foo.gmo" is created
  • A translation in progress will give an answer like "627 translated messages, 187 fuzzy translations, 169 untranslated messages." and the binary "foo.gmo" is created.
  • Read the manpages or the infopages if you want more info about "msgfmt"

    Hint: For the command line commands "msgmerge" and "msgfmt" there is a manual named "GNU Gettext utilities" in the KDE help center if you need more information.
In some rare cases a foo.po file is "corrupt" and Kbabel will refuse to open it. But don't panic this can be fixed with a text editor.
Note:Use always the UTF-8 encoding for the foo.po file. So Configure your editor so that it uses the UTF-8 encoding, otherwise, special characters will be truncated if you use another char set!

Compile foo.po as described above, if it returns an error message, fix it with the editor, and debug/recompile until all errors are gone.
For example, a corrupt foo.po will give an answer like this:
Code:
foo.po:22: missing `msgstr'
-> solution: foo.po at line 22: 'msgstr' was missing
foo.po:56: end-of-line sign in string
-> solution: foo.po at line 56: '\n' end-of-line sign was missing
foo.po:85:7: parse error
-> solution: foo.po at line 85 cursor position 7: " sign was missing
msgfmt: found 3 fatal errors

foo.gmo is not created
Correct the errors with an text editor and recompile foo.po
When it is OK you can use Kbabel again.

This is an example how a po file looks:
Code:
# Translation of krusader.pot to Dutch                -> comment header
# This file is distributed under the same license as the Krusader package.
# Copyright (C) 2000-2003, Shie Erlich, Rafi Yanai
# Copyright (C) 2004, Krusader Krew
# Translator name <translator e-mail>, 26/05/2004
#
msgid ""                                                  -> header
msgstr ""
"Project-Id-Version: krusader-40\n"
"POT-Creation-Date: 2004-04-26 13:50+0200\n"
"PO-Revision-Date: 2004-05-03 20:25+0200\n"
"Last-Translator: your name <your e-mail adress>\n"
"Language-Team: DUTCH (nl) <nl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.0.2\n"
#: GUI/kfnkeys.cpp:63 krusader.cpp:268     -> c++ file "kfnkeys.cpp" at line 63 holds the English text "F8 Delete"
msgid "F8 Delete"                          -> English text
msgstr "F8 Wissen"                         -> your native translation
# ...                                      -> ... next translations ...


Hint: Sometimes the "Project-Id-Version" is not right set, please correct it manually with a text editor e.g. "krusader-1.40\n" or "krusader-cvs-2004_10_15\n", in the header of foo.po; otherwise, "msgfmt" will complain:
Code:
msgfmt: foo.po: field `Project-Id-Version' still has initial default value
msgfmt: found 1 fatal error

-> Normally this is already done by us.

7. Check Krusader in your Native Language

For all the next points in this chapter: when you have finished the translation please send it to Dirk Eschler.

7.1 Why do this?
So you can check the end result of your translation work in your native language.
Even when your translated foo.po is 100% correct, you will see that when you are running your translated Krusader that sometimes some words do not belong with each other when they are combined in the GUI or in a sentence.
You will have to look for a synonym or translate them in a different way.
Or when underlined key letters are used in a menu, e.g., "File", to check that 2 menu entries (or buttons in a screen) don't use the same underlined character.
Sometimes, there is lack of space to put your translation on the screen. Make the translation shorter or and if that is not possible then contact the Krusader Krew and
explain how many characters you need for your translation.

Note: Not all the translations come from foo.po of Krusader, some translations come from KDE (libs) or KIO Slaves;
such as the standard words in the menus like "File, Open, ..." so that not every KDE application has to translate them over and over.


If it is necessary to modify the translation, modify foo.po, and then recompile foo.po.
The following points will explain how Krusader speaks your native language.


7.2 When you Updated an Existing Translation
Look at the list in section 1 for the current supported languages.
  • You have edited foo.po in "~/source/krusader-x.xx/po/foo.po"
  • Compile foo.po and install the translation changes
    Code:
    [~/source/krusader-x.xx/po/foo.po]$ make
    [~/source/krusader-x.xx/po/foo.po]$ su -c 'make install'

  • If it is necessary to modify the translation, modify foo.po and then, recompile Krusader
Go to section 8


7.3 When you have made a New Translation
In this case, you have to modify the source code so that your new language is supported by Krusader.
The best way
- copy foo.po to "~/source/krusader-x.xx/po/foo.po"
Run the following command in the "~/source/krusader-x.xx/" directory:
Code:

$ make -f Makefile.cvs
$ ./configure
$ make
$ su -c 'make install' (as root)

The first command "make -f Makefile.cvs" will add foo.po to the Krusader source code ("~/source/krusader-x.xx/po/Makefile.in" will be modified)
If it is necessary to modify the translation, modify foo.po and recompile Krusader.
If everything is ok go to section 8, if not, continue reading.

Hacking the "~/source/krusader-x.xx/po/Makefile.in"
If you have problems with the "make -f Makefile.cvs" command you can do the following:
Modify manually "~/source/krusader-x.xx/po/Makefile.in" before recompiling Krusader.
  • Run Krusader and open "~/source/krusader-x.xx/po/Makefile.in" with F4 (internal editor)
  • The following command will replace the Dutch translation with your native translation
  • Type "CTRL+R" (Find and Replace function)
    text to find: nl
    text to replace: foo
    options: only whole words
  • The following command will create foo.gmo and check for errors (like in section 5)
    Code:
    [~/source/krusader-x.xx/po/]$ make

  • If everything is ok you will get the following message
    Code:
    rm -f foo.gmo; /usr/bin/msgfmt -o foo.gmo ./foo.po
    test ! -f foo.gmo || touch foo.gmo

  • Recompile Krusader and check your translation
  • Install the translations
    Code:
    [~/source/krusader-x.xx/po/foo.po]$ su -c 'make install'

  • If it is necessary to modify the translation, modify foo.po and recompile Krusader
Go to section 8


7.4 When you don't Recompile Krusader
Some more hacking
This hack works on my computer with Mandrake 9.2, but it should work also on other Linux distributions.
When you have a new translation which is not (yet) supported by Krusader and you don't recompile krusader.
  • Copy "foo.gmo" (created in section 4) to "krusader.mo" in your native language directory
  • To find this directory, first find other translations of Krusader with
    Code:
    $ su -c updatedb
    $ locate krusader.mo

    Mandrake 9.2 answers:
    Code:
    /usr/share/locale/nl/LC_MESSAGES/krusader.mo
    /usr/share/locale/de/LC_MESSAGES/krusader.mo
    /usr/share/locale/fr/LC_MESSAGES/krusader.mo
    /usr/share/locale/pl/LC_MESSAGES/krusader.mo
    /usr/share/locale/sv/LC_MESSAGES/krusader.mo
    [...]

    In this case your native language directory is: /usr/share/locale/foo/LC_MESSAGES/

  • Copy "foo.gmo" to "krusader.mo" into your native language directory
    Example:
    Code:
    # cp foo.gmo /usr/share/locale/foo/LC_MESSAGES/krusader.mo


    As alternative "foo.gmo" can also be copied in your KDEhome dir
    Example:
    Code:
    $ cp foo.gmo ~/.kde/usr/share/locale/foo/LC_MESSAGES/krusader.mo


  • Close Krusader if it is executing, then run Krusader and it will speak your native language
  • Check your translations
  • If it's necessary to modify the translation, modify "foo.po" and compile it to "foo.gmo",
    copy "foo.gmo" to "krusader.mo" in your native language directory, and run Krusader
Go to section 8


7.5 When you don't do 6.3 or 6.4
  • Email your 'foo.po' translation to Dirk Eschler and he will put it into CVS
  • Read Krusader from CVS with your translation
  • Compile Krusader and check your translation
  • Email the update "foo.po" translation to Dirk Eschler



8. Howto change language ?

There is an easy method to change the language without compiling krusader, by starting krusader with this command:
Code:
$ KDE_LANG=foo krusader

If your default language is e.g. English, then Krusader will display all strings in "foo language" except the string
who are comming from KDElibs.
If needed you can copy your (upgraded) compiled language file (foo.gmo) in your KDEhome dir. (see 6.4)
Example:
Code:
$ cp foo.gmo ~/.kde/usr/share/locale/foo/LC_MESSAGES/krusader.mo


9. Translation update

This chaper is just for info, this work is done by us.
Note: In the past some translators updated foo.po the wrong way, so they translated obsolete messages, we want to prevent this, of course.
The following text, 6.2 & 6.3, explains the work that Dirk Eschler will do for you:


9.1 Updating krusader.pot

Just before a beta release Dirk Eschler will commit the updated krusader.pot and all foo.po's in cvs.
  • Since Krusader is under continuous development, 'krusader.pot' will change from time to time.
    ( new functions = new text, deleted or modified text )
  • If you use an older foo.po file the new text is not translated and is therefore displayed in English. You will have to make an update for your native language.
  • Every new, stable Krusader release needs a translation update; all changes or additions must be translated into your native language.
  • Read Krusader out from CVS (the best way)
    - if you are not familiar with CVS: download the latest Krusader CVS source code snapshot from KRUSADER CUTTING EDGE
    - run the following command in the "~/source/krusader-x.xx/" directory:
    Code:
    $ make -f Makefile.cvs
    $ ./configure
    $ make
    $ make -f admin/Makefile.common package-messages
    $ su -c 'make install' (as root)

    The third command will extract all the English text from the source code to "~/source/krusader-x.xx/po/krusader.pot",
    it must be run after "make".
    The translation Project-Id-Version" must be manually changed with a text editor e.g. "krusader-1.40"
  • Check if Krusader needs a translation update:
    - The next bash script will tell you if a translation needs an update
    Code:
    #! /bin/sh
    # This script is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 2 of the License, or
    # (at your option) any later version.
    echo "this script will tell you if a translation needs an update"
    echo ""
    for FILENAME in $(ls *.po);do
        #display the 'foo.po' filename
        echo ${FILENAME}:
        # update 'foo.po.tmp'
        msgmerge $FILENAME krusader.pot -q --force-po --output-file=$FILENAME.tmp
        # compile & display update info of 'foo.po.tmp'
        msgfmt $FILENAME.tmp --statistics -c -v --output-file=$FILENAME.tmp
        echo ""
        # delete temporary files 'foo.po.tmp'
        rm -f $FILENAME.tmp
    done
    echo "-------------------------------------------------"
    echo "xxx translated messages. = 'foo.po' is UP-TO-DATE"
    echo "xxx translated messages, xx fuzzy translations, xx untranslated messages. = NEEDS AN UPDATE"

    - Copy-paste this code into a text editor
    - save as "po_check" in directory "krusader-x.xx/po/"
    - make the bash script executable and run

    Note: when you copy-paste this script to an editor, remove all the white-spaces at the end of each line (it is possibly a phpBB thing); otherwise, this script will not work.

    Code:
    $ chmod +x po_check
    $ ./po_check
    foo.po:
    983 translated messages, 17 fuzzy translations, 12 untranslated messages.

    - when you see "fuzzy" and "untranslated" the translation needs an update
9.2 Updating foo.po
  • "msgmerge" you will merge foo.po and the new krusader.pot, so foo.po will be updated
  • Download the cvs version of Krusader, go to the "krusader-x.xx/po/ directory and
    do the following commands:
    Code:
    $ cp foo.po old_foo.po
    $ msgmerge foo.po krusader.pot --output-file=foo.po

    In the updated foo.po file:
    - The old entries will be saved as comments at the end of the foo.po file
    - New entries will be added
    - The comments will be updated if changed
  • Read the manpages or the infopages if you want more info about "msgmerge"
  • Edit and compile the new "foo.po" with Kbabel, see section 4 or 5
  • Check Krusader in your native language, see section 6



10. If you need more information

10.1 "msg..." Commands
For users who like the command-line, a list of "msg..." commands:
  • msgattrib : attribute matching and manipulation of message catalog
  • msgcat : combines several message catalogs
  • msgcmp : compare message catalog and template
  • msgcomm : match two message catalogs
  • msgconv : character set conversion for message catalog
  • msgen : create English message catalog
  • msgexec : process translations of message catalog
  • msgfilter : edit translations of message catalog
  • msgfmt : the `msgfmt' programs generates a binary message catalog from a textual translation description
  • msggrep : extracts all messages of a translation catalog that match a given pattern or belong to some given source files
  • msginit : creates a new PO file, initializing the meta information with values from the user's environment
  • msgmerge : merges two Uniform style .po files together
  • msgunfmt : convert binary message catalog to uniform style .po file
  • msguniq : unify duplicate translations in message catalog such duplicates are invalid input for other programs like msgfmt, msgmerge or msgcat
Like always, read the manpages or the infopages for more info about the above commands.


10.2 The KDE Translation HowTo
The KDE Translation HowTo explains how to translate KDE applications and how to translate documentation (Docbook/XML).
If you have trouble with your Krusader translation maybe this will help you or if you want to read some more information about translating.



11. Congratulations & credits

If you have reached here, congratulations for translating Krusader (or another application).
Enjoy your translated Krusader.
If you have a problem, drop a post at the Krusader forum, the Krusader community will help you.
You can also use this HowTo to aid in translating other applications, but I hope you will translate Krusader first.
If you would like to translate KDE applications or documentation, please take a look at the KDE Internationalization website.
If you would like to join KDE translation team for your language, please contact the contact your team-leader of the KDE translating team.


KDE Translators Center

Thanks to
- The Krusader Krew
- Richard Holt for general help and proofreading this HowTo
- All the Krusader translators
- Everybody who contributed to the Krusader project
- Everybody who has read this HowTo
- The Kbabel team
- The KDE team
- Rinse de Vries, teamleader of the Dutch KDE translating team
- The KDE translating teams
- All believers in free software

Thank you for using Krusader and have fun!

Frank Schoolmeesters.


12. Licence

LEGAL NOTICE
Permission is granted to copy, distribute and/or modify this document under the terms of the
GNU Free Documentation License, Version 1.2 or any later version published by the Free Software
Foundation, with no Invariant sections, with no Front-Cover Texts, with no Back-Cover texts.
A copy of the license is available on the GNU site http://www.gnu.org/licenses/fdl.html or
by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

DISCLAIMER
All copyrights are held by their by their respective owners, unless specifically noted otherwise.
Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark.
Naming of particular products or brands should not be seen as endorsements.
This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
Use the information in this document at your own risk. I put great effort into writing it as
accurately as I could, but you use the information contained in it at your own risk.
In no event shall I be liable for any damages resulting from the use of this document.
If you have important data you are strongly recommended to make backups at regular intervals.

Krusader Translation Howto, February 2006
http://www.krusader.org/
Copyright (c) 2003-2006 Frank Schoolmeesters and the Krusader Krew.


Last edited by Frank on Fri Aug 28, 2009 9:30 pm; edited 5 times in total
Back to top
View user's profile Send private message Visit poster's website
vaclavj
Developer


Joined: 03 Sep 2005
Posts: 71
Location: Prague, The Czech Republic

PostPosted: Sat Sep 03, 2005 1:53 pm    Post subject: plurals

In the august 2005 multiple plural support was added. How does it work:

Most languages has two plural forms, for example in english there is "1 file", and "n files", where n is either 0 or >=2.

But some languages have singular used even for zero, some languages have one form for all,
and some (mostly slavic languages) have 3 or 4 forms. For example, in czech, there is "1 soubor", "2-4 soubory" and
">=5 souborů". So these forms are not translated as separate message, but as described follows:

All plural-supporting messages in template (.pot) are in english in form (in kbabel, only the text is shown)
Code:

msgid ""
"_n: english message for n==1 (i. e. one file) \n"
"english message for n!=1 using %n (i. e. %n files)"


The translation should have so many messages (separated by "\n") as the number of plural forms in the appropriate language is.
The number and rules, which plural forms are used when, is handled by KDE (the header "Plural-Forms:" is not needed).
If the language has only one form, translation contains only this one line:
Code:

msgstr ""
"translated message using %n"


If the language has three forms, translation contains these lines:
Code:

msgstr ""
"translated for the first plural form\n"
"translated for the second plural form using %n\n"
"translated for the third plural form using %n"


Currently you can try, how it works, for example with the message
Code:

msgid ""
"_n: Do you really want to move this item to the trash?\n"
"Do you really want to move these %n items to the trash?"


If your language has more than 2 plural forms, some tools or msgfmt with option "--check-format" or "-c" (which implies the former),
can fail with message like "foo:po:<1584>number of format specifications in 'msgid' and 'msgstr' does not match". This check copmares, how many c-format specifications (%foo) are in msgid and in msgstr and fails if the number is not the same. Though it is generally usefull, it fails
on the %n, which there is usually once (in plural) or twice (in plural and singular) in msgid, and so many times, as many plural are there in msgstr. So don't use this check (don't use "-c" or "--check-format" option to msgfmt).


Last edited by vaclavj on Mon Oct 31, 2005 6:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
Monkey 9



Joined: 12 Oct 2005
Posts: 48

PostPosted: Mon Oct 31, 2005 12:33 am    Post subject:

There must be a more easy way to choose the language someone wants to use f.i. the option to choose one, or more languages, being installed prior to compile the program, and let the installer ask first.

M9.

Or to support different language-packages, like Mozilla or open office. These can easily be installed afterwards.
Back to top
View user's profile Send private message MSN Messenger
Frank
Documentation & Marketing Coordinator


Joined: 19 Jun 2003
Posts: 1264
Location: Belgium

PostPosted: Mon Oct 31, 2005 10:48 am    Post subject:

Changing the language is easy:
if KDE is in English, Krusader will be in English
if KDE is in Dutch, Krusader will be in Dutch
if KDE is in German, Krusader will be in German
if KDE is in ... , Krusader will be in ...
The only limit is the available languages that Krusader provides http://www.krusader.org/i18n.php
If the requested language is not available Krusader will be in English.

Usually you can change your language with the config tools that your distro provides, in the case of SuSE this will be Yast.
KDE provides also a tool todo this
Code:
frank@debian:~$ kpersonalizer

but if your distro provides a language config-tool it's recommend to use that distro tool.
Back to top
View user's profile Send private message Visit poster's website
vaclavj
Developer


Joined: 03 Sep 2005
Posts: 71
Location: Prague, The Czech Republic

PostPosted: Mon Oct 31, 2005 11:25 am    Post subject:

Or you can run for example:
Code:
KDE_LANG=sk:de krusader


And Slovak will be used,
where the translation is not available in slovak, german will be used,
then languages set in KDE, and then english
Back to top
View user's profile Send private message
Frank
Documentation & Marketing Coordinator


Joined: 19 Jun 2003
Posts: 1264
Location: Belgium

PostPosted: Mon Oct 31, 2005 4:46 pm    Post subject:

Thanks for the tip!
I have just tried Krusader with a combination of Dutch, Slovak and English, it looks nice
I was not aware that you can use more than 2 languages at the same time.

Just to be clear, if you want that KDE works in an other language, you need to install the needed translation package of KDE (e.g. a rpm package for Dutch, Slovak, foo, ... ) otherwise it will not work, for an i18n kde.
Back to top
View user's profile Send private message Visit poster's website
Senf
Marketing & Product Research


Joined: 02 Feb 2005
Posts: 135
Location: Slovenia

PostPosted: Wed Nov 02, 2005 8:59 am    Post subject:

Code:
KDE_LANG=sk:de krusader


This is the best trick I ever came across...
Back to top
View user's profile Send private message
Display posts from previous:   
Krusader Forum Index -> General Discussions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group