Bug 277966

Summary: [gettextstorage] some file references are missing
Product: lokalize Reporter: Alexander Potashev <aspotashev>
Component: editorAssignee: Nick Shaforostoff <shafff>
Severity: normal CC: adrian
Priority: NOR Keywords: junior-jobs
Version: 1.2   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Alexander Potashev 2011-07-17 18:45:44 UTC
Version:           1.2 (KDE 4.6) (using KDE 4.6.4) 
OS:                Linux

Some file references are not shown in "metadata" panel.

Reproducible: Always

Steps to Reproduce:
Open a .po file with the following message:

#. i18n: file: ui/forms/wdgshapeoptions.ui:35
#. i18n: ectx: property (text), item, widget (QComboBox, cmbOutline)
#: rc.cpp:3977 plugins/paintops/libpaintop/kis_paintop_option.cpp:26
#: plugins/tools/defaulttools/kis_tool_brush.cc:57
msgid "Brush"
msgstr "Кисть"

Actual Results:  
"Metadata" panel contains only this:

i18n: ectx: property (text), item, widget (QComboBox, cmbOutline)

Expected Results:  
"rc.cpp:3977" and "plugins/paintops/libpaintop/kis_paintop_option.cpp:26" should also be shown.
Comment 1 Adrián Chaves (Gallaecio) 2014-02-16 21:21:46 UTC
Lokalize skips the rc.cpp entry by design if it finds a .ui entry. This is the expected behavior.

What about the other missing path, the .cpp? Well, Lokalize expects only one path on each #: line, and when it ignores the rc.cpp entry, it ignores also the other path in the same line because Lokaliez assumes that there are no more paths in this line. This is a bug, the Gettext documentation shows examples of #: lines with more than one path.

The issue is in this function: https://projects.kde.org/projects/kde/kdesdk/lokalize/repository/revisions/master/entry/src/catalog/gettext/gettextstorage.cpp#L307

I do not have time to fix it, and I won’' work again on Lokalize for some time. I encourage any other KDE developer to fix this, it should be trivial given the information above, but if no one else fixes it before I get back I will fix it myself.
Comment 2 Adrián Chaves (Gallaecio) 2019-09-15 07:55:37 UTC
Git commit a6e6dee0fb8c4395c1840d90cc009380f195b965 by Adrián Chaves.
Committed on 15/09/2019 at 07:55.
Pushed by adrianchavesfernandez into branch 'master'.

Don’t skip file references from the same line as rc.cpp

Summary: BUG: 277966

Test Plan: Tested manually with a PO file as described in the bug report.

Reviewers: #localization, aacid

Reviewed By: #localization, aacid

Differential Revision: https://phabricator.kde.org/D23643

M  +3    -1    src/catalog/gettext/gettextstorage.cpp