Bug 368575

Summary: Untranslatable strings in BQM-File Renaming (Date & Time dialog)
Product: [Applications] digikam Reporter: André Marcelo Alvarenga <alvarenga>
Component: Usability-i18nAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, lueck
Priority: NOR    
Version: 5.1.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.2.0
Sentry Crash Report:
Attachments: Screenshot

Description André Marcelo Alvarenga 2016-09-11 05:33:21 UTC
See screenshot. The highlighted strings are untranslatable:

example:

Standard
ISO
Text
UnixTimeStamp
Custom

Reproducible: Always
Comment 1 André Marcelo Alvarenga 2016-09-11 05:38:20 UTC
Created attachment 101028 [details]
Screenshot
Comment 2 caulier.gilles 2016-09-11 22:35:25 UTC
The text come from .UI files from Advanced Renamed tool used by BQM.

The file are parsed by Messagess.sh script for string extraction :

[gilles@localhost core]$ pwd
/home/gilles/Devel/5.x/core

[gilles@localhost core]$ cat Messages.sh 
#! /bin/sh
$EXTRACTRC `find . -name \*.rc -o -name \*.ui | grep -v '/tests/'` >> rc.cpp || exit 11
$XGETTEXT `find . -name \*.h -o -name \*.cpp | grep -v '/tests/'` `find app -name \*.h.cmake.in` -o $podir/digikam.pot
rm -f rc.cpp
gilles@localhost core]$ find . -name \*.rc -o -name \*.ui
...
./utilities/advancedrename/parser/modifiers/rangemodifierdialogwidget.ui
./utilities/advancedrename/parser/modifiers/replacemodifierdialogwidget.ui
./utilities/advancedrename/parser/modifiers/fillmodifierdialogwidget.ui
./utilities/advancedrename/parser/options/dateoptiondialogwidget.ui
...

Gilles Caulier
Comment 3 Burkhard Lück 2016-09-12 06:01:36 UTC
Untranslated in recent master build from sources in locale de + x-test

dateoption.cpp:240:    QString result = QString::fromUtf8("example: %1").arg(formattedDateTime(QDateTime::currentDateTime()));
"example: %1" not extracted

dateoption.cpp:252:    addToken(QLatin1String("[date:||key||]"),    i18n("Date and time (||key|| = Standard|ISO|UnixTimeStamp|Text)"));
This does apparently not work with xgettext

dateoption.cpp:61:    m_map.insert(Custom,        DateFormatDescriptor(QLatin1String("Custom"),         QVariant()));
"Custom" not extracted
Comment 4 caulier.gilles 2016-09-12 15:35:00 UTC
Git commit 83becf3c1cc64dd619ef74cb0094bb8ad6752891 by Gilles Caulier.
Committed on 12/09/2016 at 15:34.
Pushed by cgilles into branch 'master'.

fix not i18n strings
FIXED-IN: 5.2.0

M  +2    -1    NEWS
M  +8    -8    utilities/advancedrename/parser/options/dateoption.cpp
M  +10   -7    utilities/advancedrename/parser/options/dateoption.h

http://commits.kde.org/digikam/83becf3c1cc64dd619ef74cb0094bb8ad6752891