From 8dfa8ebe8d0a0590cf2c74f7ccdd86dac4d30908 Mon Sep 17 00:00:00 2001 From: Slávek Banko Date: Sun, 28 Jun 2020 10:38:53 +0200 Subject: Remove the original translation directory layout. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- po/README | 133 -------------------------------------------------------------- 1 file changed, 133 deletions(-) delete mode 100644 po/README (limited to 'po/README') diff --git a/po/README b/po/README deleted file mode 100644 index 7a55918..0000000 --- a/po/README +++ /dev/null @@ -1,133 +0,0 @@ -README for KDiff3-Internationalisation (i18n) -============================================= -Author: Joachim Eibl 2004 - -This text is for you, if you might want to help translating KDiff3 or just want -to learn how this i18n-thing works. - -grep "Language-Team" *.po - -az Azerbaijani -ca LANGUAGE -da Danish -de Deutsch -en_GB British English -es espaniol -et Estonian -fr French -hu Hungarian -it Italian -nl Nederlands -pl Polish -pt_BR Brazilian Portuguese -pt Portuguese -ro Romanian -ru Russian -sr Serbian -sv Svenska -ta -tr Türkçe -zh_CN zh_CN - - -Thanks to all translators! - - -The program was written with English as main language. But to allow automatic -translation of messages, every translatable text in the program was written as -i18n("translatable"). - -i18n() is a translator-function. If a translation table exists, at runtime the -function looks for the given string in that table and returns the translation. - -The translation-table is created in 3 steps: -1. First a template-translation table kdiff3.pot should be created: Usually via - xgettext --keyword=i18n --keyword=I18N_NOOP -C -o ../po/kdiff3.pot *.cpp *.h - - It contains all translatable strings of the program, but no translations. - (xgettext is usually part of package gettext-devel) - -2. Translators create a translation for a specific language. Because we don't want - to modify the template now, we'll create a copy for each language. - e.g.: cp kdiff3.pot de.po - Using KBabel we can comfortably edit the translated strings. - e.g.: kbabel de.po - -3. The last step is to create a fast lookup-table (*.gmo) from the po-file via - msgfmt, but this happens automatically during the build process. - (If a new po-file was added: make -f Makefile.cvs; configure; make) - -Before starting to translate make sure nobody else is already doing it. It would -be a pity, if your precious time is wasted. Look at http://i18n.kde.org/, send a -message to the translation team coordinator for your language, and tell them that -you want to translate KDiff3. He'll inform you if you should proceed. Also read -the other docs on that site. - -============ - -The following is for my own memory and for those who really want to learn dirty tricks and details: - -The KDE-i18n team stores their results in SVN. But I would like to have an independent -copy of all translations in the po-directory of the source package. Actually it's just -copying and renaming, but simplified with these commands: - - -First fetch all available translations from the SVN-repository (access via websvn and wget) - wget http://websvn.kde.org/*checkout*/trunk/l10n/subdirs - for i in `cat subdirs`; do wget http://websvn.kde.org/*checkout*/trunk/l10n/$i/messages/extragear-utils/kdiff3.po -O $i.po; done - - -This was the explanation for translations within KDE. -But KDiff3 can also be compiled and run without KDE: - -Since Qt was used for KDiff3, the first part is quite the same: Only the fast lookup-table -(*.qm-files) must be created with $TQTDIR/bin/msg2tqm (instead of msgfmt). ($TQTDIR/tools/msg2tqm) - -Still one detail isn't right: Some strings are not translated, because under KDE their -translation is within KDE-libs or within Qt. But the translations are available: - -For Qt-strings in $TQTDIR/translations (already as .qm-files) - -For KDE-libs in the SVN-repository, where we can reuse the previous trick to get -all tdelibs*.po-files: - - for i in `cat subdirs`; do wget http://websvn.kde.org/*checkout*/trunk/l10n/$i/messages/tdelibs/tdelibs.po -O tdelibs_$i.po; done - -Finally the program must only read the correct translation tables: - - QTranslator kdiff3Translator( 0 ); - kdiff3Translator.load( QString("kdiff3_")+QTextCodec::locale(), translationDir ); - app.installTranslator( &kdiff3Translator ); - - QTranslator qtTranslator( 0 ); - qtTranslator.load( QString("qt_")+QTextCodec::locale(), translationDir ); - app.installTranslator( &qtTranslator ); - - QTranslator tdelibsTranslator( 0 ); - tdelibsTranslator.load( QString("tdelibs_")+QTextCodec::locale(), translationDir ); - app.installTranslator( &tdelibsTranslator ); - -This should do the job, if the translation-tables can be found. -The difficult part is: Where to search for the files, because this depends on -where the program was installed. (I didn't solve this puzzle yet.) - -Because it's too much effort to copy all tdelibs*.po-files along: Here is a little info -about how to extract only the needed strings and to create the qm-files. - -1. Only src/kreplacements/kreplacements.cpp contains strings, that were not covered by - the normal translations. Hence a special pot-file is needed. - xgettext --keyword=i18n --keyword=I18N_NOOP -C ../src/kreplacements/kreplacements.cpp -o kreplacements.pot - (xgettext is usually part of package gettext-devel) - -2. Take only needed strings and translations from tdelibs*.po: - msgmerge --no-fuzzy-matching tdelibs_de.po kreplacements.pot >kreplacements_de.po - -3. Concatenate the normal de.po and kreplacements_de.po: - msgcat --use-first de.po kreplacements_de.po >kdiff3_de.po - -4. Finally create the fast lookup table: - $TQTDIR/bin/msg2tqm kdiff3_de.po kdiff3_de.qm - -5. The intermediate files can then be deleted. - -The script createqm does steps 2-5 for languages where a kdiff3.po-translation exists. -- cgit v1.2.3