| View previous topic :: View next topic |
| Author |
Message |
MaxiPunkt
Joined: 04 Sep 2006 Posts: 34 Location: Germany
|
Posted: Tue Oct 20, 2009 6:33 pm Post subject: My 1st attempt to get Krusader-SVN incl. translations! |
|
|
Hy there,
I've already found the "official" way of getting Krusader after migrating to KDE-SVN:
| Code: | $ svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdesdk/scripts/createtarball
$ cd createtarball
$ ./create_tarball.rb -n -a krusader -v svn`date +%Y%m%d` |
But I wanted to have a more "Linux-like" solution without Ruby, so I made a BASH-script.
In the moment it does an export (no checkout) with given SVN-Revision and gets latest translations (handbook & application).
In the end a *.tar.bz2 will be created from the source.
And here it is:
| Code: | #!/bin/bash
APP_NAME=krusader
MAINMODULE=extragear
SUBMODULE=utils
SVN_REV=1039086
DEST_NAME=$APP_NAME-svn-r$SVN_REV
SVN_ROOT="svn://anonsvn.kde.org/home/kde/trunk"
# Export main-application:
echo "Exporting main-application..."
svn export -q --revision $SVN_REV $SVN_ROOT/$MAINMODULE/$SUBMODULE/$APP_NAME/ $DEST_NAME/
# Export application-docs:
echo "Exporting application-docs..."
svn export -q $SVN_ROOT/$MAINMODULE/$SUBMODULE/doc/$APP_NAME/ $DEST_NAME/doc/
echo 'add_subdirectory( doc )' >> $DEST_NAME/CMakeLists.txt
echo "Checking presence of translations..."
# Get all available l10n-languages of KDE:
LANGS_AVAIL=`svn cat $SVN_ROOT/l10n-kde4/subdirs | grep -v "x-test"`
# Add l10n to compilation:
echo 'find_package(Msgfmt REQUIRED)' >> $DEST_NAME/CMakeLists.txt
echo 'find_package(Gettext REQUIRED)' >> $DEST_NAME/CMakeLists.txt
# Export "l10n-messages" (translated application-strings):
echo "Searching for 'l10n-messages'..."
SEARCH_PATH="messages/$MAINMODULE-$SUBMODULE"
for LANGS in $LANGS_AVAIL; do
FILES_AVAIL=`svn ls $SVN_ROOT/l10n-kde4/$LANGS/$SEARCH_PATH/ 2> /dev/null | grep "$APP_NAME"`
sleep 0.75 # otherwise connection breaks sometimes!
if [ -n "$FILES_AVAIL" ]; then
echo "Found l10n message-files for: '$LANGS', exporting..."
mkdir -p $DEST_NAME/l10n-messages/$LANGS
for FILE in $FILES_AVAIL; do
svn export -q $SVN_ROOT/l10n-kde4/$LANGS/$SEARCH_PATH/$FILE \
$DEST_NAME/l10n-messages/$LANGS/$FILE
done
echo 'file(GLOB _po_files *.po)' \
> $DEST_NAME/l10n-messages/$LANGS/CMakeLists.txt
echo "GETTEXT_PROCESS_PO_FILES( $LANGS ALL INSTALL_DESTINATION \${LOCALE_INSTALL_DIR} \${_po_files} )" \
>> $DEST_NAME/l10n-messages/$LANGS/CMakeLists.txt
echo "add_subdirectory( $LANGS )" >> $DEST_NAME/l10n-messages/CMakeLists.txt
fi
done
if [ -d "$DEST_NAME/l10n-messages/" ]; then
echo 'add_subdirectory( l10n-messages )' >> $DEST_NAME/CMakeLists.txt
fi
# Export "l10n-docs" (translated docs, docbook-format):
echo "Searching for 'l10n-docs'..."
SEARCH_PATH="docs/$MAINMODULE-$SUBMODULE/$APP_NAME"
for LANGS in $LANGS_AVAIL; do
FILES_AVAIL=`svn ls $SVN_ROOT/l10n-kde4/$LANGS/$SEARCH_PATH/ 2> /dev/null`
sleep 0.75 # otherwise connection breaks sometimes!
if [ -n "$FILES_AVAIL" ] && [[ $FILES_AVAIL == *index.docbook* ]]; then
echo "Found l10n doc-files for: '$LANGS', exporting..."
mkdir -p $DEST_NAME/l10n-docs/$LANGS/$APP_NAME/
for FILE in $FILES_AVAIL; do
svn export -q $SVN_ROOT/l10n-kde4/$LANGS/$SEARCH_PATH/$FILE \
$DEST_NAME/l10n-docs/$LANGS/$APP_NAME/$FILE
done
echo "kde4_create_handbook( index.docbook INSTALL_DESTINATION \${HTML_INSTALL_DIR}/$LANGS/)" \
> $DEST_NAME/l10n-docs/$LANGS/$APP_NAME/CMakeLists.txt
echo "add_subdirectory( $LANGS/$APP_NAME )" >> $DEST_NAME/l10n-docs/CMakeLists.txt
fi
done
if [ -d "$DEST_NAME/l10n-docs/" ]; then
echo 'add_subdirectory( l10n-docs )' >> $DEST_NAME/CMakeLists.txt
fi
# Compress SVN-export:
echo "Compressing data..."
tar cfj $DEST_NAME.tar.bz2 $DEST_NAME/ |
Hopefully you'll find this useful.
One important point to mention:
In the moment I unfortunately have problems to get Krusader completely in German language: Some messages are German, some are not.
If I compare some untranslated strings with the corresponding *.po-file, I can't spot any problem?!?!
You could blame it on this script, but I have same problems with the Krusader-source I'll get with the ruby-script!
But as I've used the Ruby-script as template, maybe there is the same mistake in both?
Or is there something wrong with the source/translations in general?
Any ideas?
Last edited by MaxiPunkt on Sun Oct 25, 2009 3:44 pm; edited 1 time in total |
|
| Back to top |
|
 |
Frank Documentation & Marketing Coordinator

Joined: 19 Jun 2003 Posts: 1269 Location: Belgium
|
Posted: Sat Oct 24, 2009 7:12 am Post subject: Re: My 1st attempt to get Krusader-SVN incl. translations! |
|
|
| MaxiPunkt wrote: | One important point to mention:
In the moment I unfortunately have problems to get Krusader completely in German language: Some messages are German, some are not.
If I compare some untranslated strings with the corresponding *.po-file, I can't spot any problem?!?!
You could blame it on this script, but I have same problems with the Krusader-source I'll get with the ruby-script!
But as I've used the Ruby-script as template, maybe there is the same mistake in both?
Or is there something wrong with the source/translations in general?
Any ideas? |
For the moment there is no string freeze, so it's possible that not all translations do work.
I'm not sure if krusader.pot is updated all the time, and the according German po file (and other po files for other languages).
Also the statistics show that not all strings are translated for German
http://l10n.kde.org/stats/gui/trunk-kde4/po/krusader.po/
1629 strings
1611 translated
13 fuzzy
5 untranslated
It could also be a bug in the Krusader source code.
Install the "nl" Dutch language.
Activate the "nl" Dutch language (100% translated by me ) and see if that works with: Menu "Help->Switch Application Language... "
If "nl" works, than the not updated German po file is the cause.
Could you give some examples of strings that not work? |
|
| Back to top |
|
 |
dirk Webmaster & i18n Coordinator

Joined: 24 Mar 2002 Posts: 1339 Location: Germany
|
Posted: Sat Oct 24, 2009 9:30 am Post subject: |
|
|
The German translation work just fine for me. And being the German translator, i can add that there are just a handful untranslated strings in the German translation (~1%). Most of them are very hard to spot. When i don't find a string in the UI and i'm in doubt about its translation, i don't translate it until i'm absolutely sure. IMHO a badly or wrongly translated string is worse than the original. Especially in a file manager where you manipulate files, a correct translation is crucial.
I haven't tested your script yet, but i can confirm that the ruby script has some flaws:
1. Somestimes the checkout fails before it fetches anything and you have to re-run the script.
2. Sometimes only translations and documentation aren't fetched. This is dependend on the authentification method used. Using a developer account works better than the anonymous checkout. I know that doesn't help you with your script, which is supposed to run anonymously...
p.s.:
I just use the wget snippet i have posted earlier to get a translation, it's still the easiest method for me. |
|
| Back to top |
|
 |
MaxiPunkt
Joined: 04 Sep 2006 Posts: 34 Location: Germany
|
Posted: Sun Oct 25, 2009 3:42 pm Post subject: |
|
|
| Quote: | I haven't tested your script yet, but i can confirm that the ruby script has some flaws:
1. Somestimes the checkout fails before it fetches anything and you have to re-run the script.
2. Sometimes only translations and documentation aren't fetched. |
That's right. Therefore I've updated my script a little bit:
I found out that a small pause between the commands to get the translations helps to not breaking the svn-connection.
You'll find the updated script in my post above...
| Quote: | Install the "nl" Dutch language.
Activate the "nl" Dutch language (100% translated by me ) and see if that works with: Menu "Help->Switch Application Language... "
If "nl" works, than the not updated German po file is the cause. |
I did - with no luck either: I had English, German and Dutch strings in my application, then.
| Quote: | | Could you give some examples of strings that not work? |
There are plenty of them - i.e. my "Preferences"-Menu looks like this:
* de: Einstellungen
* de: Werkzeugleiste anzeigen
* en: Show Actions Toolbar
* de: Statusleiste anzeigen
* en: Show FN Keys Bar
* en: Show Terminal Emulator
* en: Show Command Line
* en: Command Execution Mode Setup
* de: Kurzbefehle festlegen...
* de: Werkzeugleisten einrichten...
* en: Configure Krusader...
Btw. - I've noticed that some po-directories on SVN-server contain 2 files, mostly there is only one file:
* desktop_extragear-utils_krusader.po
* krusader.po
I.e. Dutch translation has these 2 files mentioned, while German translation only has "krusader.po". |
|
| Back to top |
|
 |
dirk Webmaster & i18n Coordinator

Joined: 24 Mar 2002 Posts: 1339 Location: Germany
|
Posted: Sun Oct 25, 2009 9:40 pm Post subject: |
|
|
I've seen these desktop_extragear-utils_krusader.po files, no idea where they come from, i just can tell that they aren't required. Perhaps scripty created them.
The string examples you've posted are definately translated in the German translation. As you get the english fallback strings i'm wondering if Krusader is loading the correct translation file. Perhaps there's a stale krusader.mo somewhere in the paths searched by KDE that happens to be found first by Krusader. Have you checked your machine for multiple translation files? |
|
| Back to top |
|
 |
Frank Documentation & Marketing Coordinator

Joined: 19 Jun 2003 Posts: 1269 Location: Belgium
|
Posted: Sun Oct 25, 2009 10:40 pm Post subject: |
|
|
| dirk wrote: | | I've seen these desktop_extragear-utils_krusader.po files, no idea where they come from, i just can tell that they aren't required. Perhaps scripty created them. |
http://websvn.kde.org/trunk/l10n-kde4/templates/messages/extragear-utils/desktop_extragear-utils_krusader.pot?view=markup
It's only 11 strings, the strings seem to be used for a menu system I think, that is used for Krusader.
- iso/isoservice.desktop
- krArc/krarc.protocol
- krusader/krusader.desktop
- krusader/krusader_root-mode.desktop
- krusader/x-ace.desktop
For the Krusader application, the strings are in krusader.pot |
|
| Back to top |
|
 |
MaxiPunkt
Joined: 04 Sep 2006 Posts: 34 Location: Germany
|
Posted: Mon Oct 26, 2009 7:26 pm Post subject: |
|
|
| Quote: | | The string examples you've posted are definately translated in the German translation. |
That's what I tried to tell you already in my 1st post, saying not being able to spot problems with the corresponding *.po-file.
| Quote: | | Perhaps there's a stale krusader.mo somewhere in the paths searched by KDE that happens to be found first by Krusader. Have you checked your machine for multiple translation files? |
I always build an RPM for my system before installing an application.
The RPM-system of Mandriva has a feature for only installing l10n-files (beside English as a standard-option) depending on the locale being set for the system. I'll get:
| Code: | $ find /usr/share/locale/ -name *krusader.mo
/usr/share/locale/de/LC_MESSAGES/krusader.mo
/usr/share/locale/nl/LC_MESSAGES/krusader.mo
/usr/share/locale/nl/LC_MESSAGES/desktop_extragear-utils_krusader.mo
/usr/share/locale/en_GB/LC_MESSAGES/krusader.mo
/usr/share/locale/en_GB/LC_MESSAGES/desktop_extragear-utils_krusader.mo |
For nl-locale I did a manual install.
Now I've deleted all locale *.mo-files beside German and still have the same problem.
Could you please try-out my script (or the original ruby-script from KDE) compile the source, install it and check if you're experiencing the same problems as I do? |
|
| Back to top |
|
 |
dirk Webmaster & i18n Coordinator

Joined: 24 Mar 2002 Posts: 1339 Location: Germany
|
Posted: Tue Oct 27, 2009 12:14 am Post subject: |
|
|
| MaxiPunkt wrote: | | Code: | $ find /usr/share/locale/ -name *krusader.mo
/usr/share/locale/de/LC_MESSAGES/krusader.mo
/usr/share/locale/nl/LC_MESSAGES/krusader.mo
/usr/share/locale/nl/LC_MESSAGES/desktop_extragear-utils_krusader.mo
/usr/share/locale/en_GB/LC_MESSAGES/krusader.mo
/usr/share/locale/en_GB/LC_MESSAGES/desktop_extragear-utils_krusader.mo |
For nl-locale I did a manual install. |
And you installed Krusader into prefix /usr? In this case i really don't know what's going wrong.
After looking through your examples again, it seems that the Krusader translation isn't honoured at all, the german strings you've posted all come from KDE not Krusader.
I've just installed krusader using the ruby script and got a fully translated Krusader. |
|
| Back to top |
|
 |
MaxiPunkt
Joined: 04 Sep 2006 Posts: 34 Location: Germany
|
Posted: Tue Oct 27, 2009 6:58 pm Post subject: |
|
|
| Quote: | | And you installed Krusader into prefix /usr? |
Yes, I think so.
I've built Krusader with Mandriva's RPM-macro "%cmake_kde4". It does the following:
| Code: | $ rpm --eval='%cmake_kde4'
QTDIR="/usr/lib/qt4" ; export QTDIR ;
PATH="/usr/lib/qt4/bin:$PATH" ; export PATH ;
CFLAGS="${CFLAGS:--O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables}" ; export CFLAGS ;
CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables}" ; export CXXFLAGS ;
FFLAGS="${FFLAGS:--O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables}" ; export FFLAGS ;
LDFLAGS="$LDFLAGS -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro"; export LDFLAGS ;
mkdir -p build
cd build
/usr/bin/cmake .. \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib \
-DINCLUDE_INSTALL_DIR:PATH=/usr/include \
-DLIB_INSTALL_DIR:PATH=/usr/lib \
-DSYSCONF_INSTALL_DIR:PATH=/etc \
-DSHARE_INSTALL_PREFIX:PATH=/usr/share \
-DCMAKE_BUILD_TYPE=release \
%if "lib" == "lib64"
-DLIB_SUFFIX=64 \
%endif
-DCMAKE_SKIP_RPATH:BOOL=ON \
\
-DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_STATIC_LIBS:BOOL=OFF \
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,relro" \
%if 1
-DKDE4_ENABLE_FPIE=ON \
%endif
%if 0
-DKDE4_ENABLE_FINAL=ON \
%endif
-DCMAKE_INSTALL_PREFIX=/usr \
-DKDE_DEFAULT_HOME=".kde4" \
-DKDE_DISTRIBUTION_TEXT="Mandriva Linux release 2010.0 (Cooker) for i586" \
-DKDE4_USE_ALWAYS_FULL_RPATH=OFF \
-DKDE4_DATA_DIR=/usr/share/apps \
-DENABLE_FAM=ON \
-DPHONON_INCLUDE_DIR=/usr/include \
-DDBUS_SERVICES_INSTALL_DIR=/usr/share/dbus-1/services \
-DDBUS_INTERFACES_INSTALL_DIR=/usr/share/dbus-1/interfaces |
The executable binary for Krusader is in /usr/bin/ afterwards.
Any ideas what's going wrong? |
|
| Back to top |
|
 |
MaxiPunkt
Joined: 04 Sep 2006 Posts: 34 Location: Germany
|
Posted: Tue Oct 27, 2009 9:22 pm Post subject: |
|
|
EDIT:
I've now booted from my Mandriva-LiveCD, installed my selfcompiled RPM in live-mode and had perfect locales inside Krusader.
This means:
* You did a very good job in translating Krusader
* My Bash-script for fetching SVN-code incl. locales perfectly works!
Seems that something went wrong during my attemt to install Mandriva-Linux on my harddisk regarding locales - other KDE4-programs are affected as well.
Sorry for wasting your time.  |
|
| Back to top |
|
 |
dirk Webmaster & i18n Coordinator

Joined: 24 Mar 2002 Posts: 1339 Location: Germany
|
Posted: Tue Oct 27, 2009 11:07 pm Post subject: |
|
|
Glad to hear.  |
|
| Back to top |
|
 |
|