[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: i18n setup for RKWard
From:       Burkhard =?ISO-8859-1?Q?L=FCck?= <lueck () hube-lueck ! de>
Date:       2014-11-18 14:52:54
Message-ID: 1586471.UmD83c2r4k () parodia
[Download RAW message or body]

Am Dienstag, 18. November 2014, 14:43:11 schrieb Thomas Friedrichsmeier:
> On Tuesday 18 November 2014 12:01:29 Luigi Toscano wrote:
> > On Tuesday 18 of November 2014 09:33:01 Thomas Friedrichsmeier wrote:
> [...]
> 
> > Hi!
> > The proper place for this kind of discussions (it's a question later) for
> > this is the list kde-i18n-doc@kde.org, also because there are other people
> > that can help (Burkhard Lueck for example).
> > Please also check the recent thread "GCompris on its way to a public
> > release" on the list, as it contains few answers.
> > http://kde.markmail.org/thread/ynbkmj54h2rkkhx2
> 
> Hi Luigi,
> 
> thanks! I'll direct my follow-up to the list, then.
> 
> > See also:
> > https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Sys
> > te ms
> 
> Yes, I've even written some of that page. But back than, my perspective was
> that of a "third party application" developer. Now I'm trying to figure out
> the KDE side.
> 
> Either way, reading extract_messages.sh, I think I'm beginning to understand
> how this is done, and why the files generated by our Messages.sh - quite
> fortunately for the moment - are not yet added to /l10n-kde4/templates/ .
> > > 1. What we got so far:
> > > - A "po" subdirectory with Messages.sh and rkward.pot
> > 
> > Please remove it, it's not needed.
> 
> Will do. Although, on second thought: To support building localized version
> from the source repo, directly (not just official releases), it probably
> makes some sense to keep a copy of the xy.po's in our repo, right? Only
> we'll have to make it explicit that these are just a copy.
> 
> > > - A bunch of existing translations for rkward.pot, named de.po
> > 
> > Those are the ones we should import on our SVN repository.
> 
> Ok, AFAICS, de.po would go to (e.g.) trunk/l10n-kde4/de/messages/playground-
> edu/rkward.po . So I'll simply put them, there?
> 
> Follow-up questions:
> 1) Some of our translations are clearly in a bad shape. Currently our way of
> dealing with this is to apply a crude heuristic at installation time: If a
> translation is less than 80% complete, it is skipped. Is it better to apply
> a similar criterion, and only commit the translations that are at least say
> 50% complete, or is something always better than nothing, and I should
> commit all we got?
> 2) Whenever the time comes to move to kdereview, but also, when we start on
> porting to KF5, will everything be moved / copied around, automagically, or
> will I have to keep this in mind.
> 
> > > - Our translations are currently managed via translations.launchpad.net.
> > > At
> > > least one translation (es), there, also has a bunch of "suggestions"
> > > pending, from someone not on the launchpad es translation team.
> > 
> > This should be cleaned; once the translations lands in our system, the
> > translation page on launchpad should be closed to avoid confusion.
> 
> Of course.
> 
> > > 2. What will be added:
> > > Right now, we are in the process of adding i18n to our plugins, which
> > > were
> > > previously not translatable. In this process, several(!) additional .pot
> > > files will start appearing. Messages.sh should already create one of
> > > these
> > > (via scripts/extract_plugin_messages.py; in
> > > po/plugins/rkward__analysis.pot), but at this point this is for testing
> > > purposes, only, and translators are advised to hold work on this for
> > > another short while, until all is reasonably stable.
> > > 
> > > Is there anything I should keep in mind about this _now_?
> > 
> > Once you add the Messages.sh files, scripty (our translation-handling
> > script) will extract them; you can ask translators to ignore them, but
> > it's
> > possible that they will translate them anyway, at least partially,
> > especially if they use translation memories. I wouldn't worry about this,
> > people should read the list :)
> 
> Ok, well, as far as I understand, as long as Messages.sh does not place
> anything in $podir, nobody will ever get to see things they should not.
> Correct?
> 
> > > 3. For the somewhat longer term, could give me a rough picture, of how I
> > > will retrieve translations when creating releases? Or will these be
> > > pushed
> > > to our repo?
> > 
> > Albert can give more hints, see also the discussion I linked above as
> > there
> > are some answers.
> 
> Thanks. Looks comparable to what we have now (fetching translation updates
> from launchpad, before building the release). Will look into the details,
> later.
> 
> > PS. Do you have DocBook documentation that we can translate?
> 
> Yes. One very small, one pretty large docbook, both in "doc". Should I take
> any action about these?
> 
Later.

Lets start simple and add a default Messages.sh and rename the existing 
po/Messages.sh so we get the GUI translated first, see attached diff.

Btw git.reviewboard.kde.org has no group rkward, please add it.

There are still some strings not extracted but apparently used in the GUI:

docbooks in rkward/pages/rkward_*.rkh

translation of plugins docbooks in rkward/plugins/*/*.rkh, maybe more plugins 
files?

Installation fails for me with this error:
<quote>
-- Installing R support packages
Error: ERROR: no permission to install to directory '/usr/local/lib/R/site-
library'
CMake Error at rkward/rbackend/rpackages/rpackage_install.cmake:30 (MESSAGE):
  Failed to install R support libraries.  Please make sure you have the
  required permissions.
</quote>

-- 
Burkhard Lück

["rkward.diff" (rkward.diff)]

diff --git a/po/Messages.sh b/po/Messages.sh
deleted file mode 100755
index 8daa05a..0000000
--- a/po/Messages.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-BASEDIR="../rkward/"	# root of translatable sources
-PROJECT="rkward"	# project name
-BUGADDR="http://p.sf.net/rkward/bugs"	# MSGID-Bugs
-WDIR=`pwd`		# working dir
-
-check_error()
-{
-	if [ "$?" -ne "0" ]; then
-		echo "ERROR: ${1}"
-		exit 1
-	fi
-}
-
-echo "Preparing rc files"
-cd ${BASEDIR}
-# we use simple sorting to make sure the lines don't jump around too much from \
                system to system
-find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list
-xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp
-check_error "Failed to extract messages from rc files. Do you have extractrc \
                installed?"
-# additional string for KAboutData
-echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
-echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
-cd ${WDIR}
-echo "Done preparing rc files"
-
-
-echo "Extracting messages"
-cd ${BASEDIR}
-# see above on sorting
-find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list
-echo "rc.cpp" >> ${WDIR}/infiles.list
-cd ${WDIR}
-xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 \
                -ki18ncp:1c,2,3 -ktr2i18n:1 \
-	-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 \
                -kki18ncp:1c,2,3 \
-	--msgid-bugs-address="${BUGADDR}" \
-	--files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot
-check_error "Failed to extract messages from source files. Do you have xgettext \
                installed?"
-echo "Done extracting messages"
-
-
-# Note: .po-file are now maintained (and merged) on launchpad
-#
-# echo "Merging translations"
-# catalogs=`find . -name '*.po'`
-# for cat in $catalogs; do
-#   echo $cat
-#   msgmerge -o $cat.new $cat ${PROJECT}.pot
-#   check_error "Failed to merge messages. Do you have msgmerge installed?"
-#   mv $cat.new $cat
-# done
-# echo "Done merging translations"
-
-
-echo "Cleaning up"
-cd ${WDIR}
-rm rcfiles.list
-rm infiles.list
-rm rc.cpp
-echo "Done"
-
-echo "Extracting messages from plugins"
-cd ${BASEDIR}
-# For testing purposes, extract analysis.pluginmap, only
-python ../scripts/extract_plugin_messages.py --outdir=../po/plugins/ \
                plugins/analysis.pluginmap
-python ../scripts/extract_plugin_messages.py --outdir=../po/plugins/ \
                --default_po=testing plugins/under_development.pluginmap
-echo "Done"
diff --git a/po/Messages.sh.old b/po/Messages.sh.old
new file mode 100755
index 0000000..8daa05a
--- /dev/null
+++ b/po/Messages.sh.old
@@ -0,0 +1,67 @@
+#!/bin/sh
+BASEDIR="../rkward/"	# root of translatable sources
+PROJECT="rkward"	# project name
+BUGADDR="http://p.sf.net/rkward/bugs"	# MSGID-Bugs
+WDIR=`pwd`		# working dir
+
+check_error()
+{
+	if [ "$?" -ne "0" ]; then
+		echo "ERROR: ${1}"
+		exit 1
+	fi
+}
+
+echo "Preparing rc files"
+cd ${BASEDIR}
+# we use simple sorting to make sure the lines don't jump around too much from \
system to system +find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > \
${WDIR}/rcfiles.list +xargs --arg-file=${WDIR}/rcfiles.list extractrc > \
${WDIR}/rc.cpp +check_error "Failed to extract messages from rc files. Do you have \
extractrc installed?" +# additional string for KAboutData
+echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
+echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
+cd ${WDIR}
+echo "Done preparing rc files"
+
+
+echo "Extracting messages"
+cd ${BASEDIR}
+# see above on sorting
+find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list
+echo "rc.cpp" >> ${WDIR}/infiles.list
+cd ${WDIR}
+xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 \
-ki18ncp:1c,2,3 -ktr2i18n:1 \ +	-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale \
-kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \ \
+	--msgid-bugs-address="${BUGADDR}" \ +	--files-from=infiles.list -D ${BASEDIR} -D \
${WDIR} -o ${PROJECT}.pot +check_error "Failed to extract messages from source files. \
Do you have xgettext installed?" +echo "Done extracting messages"
+
+
+# Note: .po-file are now maintained (and merged) on launchpad
+#
+# echo "Merging translations"
+# catalogs=`find . -name '*.po'`
+# for cat in $catalogs; do
+#   echo $cat
+#   msgmerge -o $cat.new $cat ${PROJECT}.pot
+#   check_error "Failed to merge messages. Do you have msgmerge installed?"
+#   mv $cat.new $cat
+# done
+# echo "Done merging translations"
+
+
+echo "Cleaning up"
+cd ${WDIR}
+rm rcfiles.list
+rm infiles.list
+rm rc.cpp
+echo "Done"
+
+echo "Extracting messages from plugins"
+cd ${BASEDIR}
+# For testing purposes, extract analysis.pluginmap, only
+python ../scripts/extract_plugin_messages.py --outdir=../po/plugins/ \
plugins/analysis.pluginmap +python ../scripts/extract_plugin_messages.py \
--outdir=../po/plugins/ --default_po=testing plugins/under_development.pluginmap \
                +echo "Done"
diff --git a/rkward/Messages.sh b/rkward/Messages.sh
new file mode 100644
index 0000000..a732c7b
--- /dev/null
+++ b/rkward/Messages.sh
@@ -0,0 +1,9 @@
+#!bin/sh
+ 
+# invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources
+# the results are stored in a pseudo .cpp file to be picked up by xgettext.
+$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
+#
+# call xgettext on all source files. If your sources have other filename
+# extensions besides .cc, .cpp, and .h, just add them in the find call.
+$XGETTEXT `find . -name \*.cpp -o -name \*.h -name \*.c` -o $podir/rkward.pot



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic