Hi folks,
I'm sorry to bother you, but I'd like to get a review of this commit (which is not 
on master, but on a separate branch for now). It turned out that using ts2po & 
po2ts was not really that perfect, even after Chusslove's patch.

The new setup uses lconvert exclusively and produces the .pot files which looks 
like [1]. The .pot file contains proper source file location information etc. 
There are two issues, though:

- the order of strings in the .pot file has changed significantly,
- the contexts are different, rendering the existing translations unusable

I've noticed that some teams like the Dutch one have already translated more than a 
hundred of strings, and I'd hate to make their work harder than it already is. Could you 
please tell me whether this commit is reasonable? Can I somehow reduce the amount of work 
they need to do? Or is the usual way just to declare "well screw them, this is a 
review, not an app in a string freeze"?

With kind regards,
Jan

[1] http://dev.gentoo.org/~jkt/tmp/trojita_common.pot

On Wednesday, 28 November 2012 12:14:04 CEST, Jan Kundrát wrote:
Git commit c28c076ff8bb5ec52a12c693a60db7a226767d54 by Jan Kundrát.
Committed on 28/11/2012 at 12:04.
Pushed by jkt into branch 'l10n-via-lconvert'.

l10n: Use Qt's own lconvert to produce .pot files out of the .ts

The Qt's documentation [1] says that ts2po is known to cause trouble. We've seen
that (see Chusslove's patch from yesterday), and even after his fix, the
produced .pot file still doesn't contain proper file location information. Using
lconvert shall do the trick.

Sorry for those localization teams which have already done the work, this is
pretty much a new area for me.

[1] http://qt-project.org/wiki/Qt-Localization

M  +1    -7    Messages.sh
M  +1    -2    src/po2qm.prf

http://commits.kde.org/trojita/c28c076ff8bb5ec52a12c693a60db7a226767d54

diff --git a/Messages.sh b/Messages.sh
index 98723b4..5557fee 100755
--- a/Messages.sh
+++ b/Messages.sh
@@ -6,11 +6,5 @@
rm -f "${podir}/trojita.ts"
 lupdate -silent -recursive src/ -ts "${podir}/trojita.ts"
-ts2po --progress=none --pot "${podir}/trojita.ts" "${podir}/trojita_common.pot" +lconvert "${podir}/trojita.ts" --sort-contexts --output-format pot -o "${podir}/trojita_common.pot"
 rm "${podir}/trojita.ts"
-
-# ts2po puts class names into source reference comments (#:)
-# instead of into extracted comments (#.),
-# and does not extract source references at all.
-# So convert source reference comments into extracted comments.
-sed -i 's/^#:/#./' "${podir}/trojita_common.pot"
diff --git a/src/po2qm.prf b/src/po2qm.prf
index 6a92e7c..ef44a66 100644
--- a/src/po2qm.prf
+++ b/src/po2qm.prf
@@ -12,7 +12,6 @@ isEmpty(QMAKE_LRELEASE) {
po2qm.input = PO_FILES
 po2qm.output = locale/${QMAKE_FILE_BASE}.qm
-# Undo comment normalization performed in Messages.sh before applying po2ts. -po2qm.commands = sed \'s/^$$LITERAL_HASH\\./$$LITERAL_HASH:/\' ${QMAKE_FILE_IN} >${QMAKE_FILE_BASE}.sed.po && po2ts ${QMAKE_FILE_BASE}.sed.po ${QMAKE_FILE_BASE}.ts && $$QMAKE_LRELEASE -nounfinished ${QMAKE_FILE_BASE}.ts -qm locale/${QMAKE_FILE_BASE}.qm && rm ${QMAKE_FILE_BASE}.sed.po +po2qm.commands = lconvert ${QMAKE_FILE_IN} -o ${QMAKE_FILE_BASE}.ts && $$QMAKE_LRELEASE -nounfinished ${QMAKE_FILE_BASE}.ts -qm locale/${QMAKE_FILE_BASE}.qm && rm ${QMAKE_FILE_BASE}.ts
 po2qm.CONFIG += no_link target_predeps
 QMAKE_EXTRA_COMPILERS += po2qm




Reply via email to