Bug 506225

Summary: Multi-line string not extracted for translation
Product: [Applications] Welcome Center Reporter: rafaelff <rafaelff>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: aspotashev, nate, olib141
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.4.4
Sentry Crash Report:
Attachments: Screenshot of Welcome Center translated to Brazilian Portuguese, with a red-highlighting box around the problematic message

Description rafaelff 2025-06-26 16:47:11 UTC
Created attachment 182696 [details]
Screenshot of Welcome Center translated to Brazilian Portuguese, with a red-highlighting box around the problematic message

SUMMARY

The multi-line string from [1] is not being extract as whole to translation files. So, instead of extracting something like:

---
Plasma is an extremely feature-rich environment, designed to super-charge your productivity!
Click the cards below to see just a smattering of what it can do for you:
---

only the following is extracted:

---
Plasma is an extremely feature-rich environment, designed to super-charge your productivity!
---

Notice how it is trimmed in after newline. Even if the translator translate it, the built software won't show any translation at all for this message (because the whole message is not found in the translation file when building the Welcome Center).

For instance, the Brazilian Portuguese (pt_BR) translation file [2] has the first line translated for a year now and that's it -- the second line is missing.

As an attachment is a screenshot of Welcome Center 6.4.1 translated to Brazilian Portuguese, but this problematic message is not showing translated -- and is not available at all.

[1] https://invent.kde.org/plasma/plasma-welcome/-/blob/e5820bb3/src/qml/pages/PowerfulWhenNeeded.qml#L17-18
[2] https://invent.kde.org/plasma/plasma-welcome/-/blob/98a458b9/po/pt_BR/plasma-welcome.po#L637

STEPS TO REPRODUCE
1. Open the Welcome Center in pt_BR (LC_ALL=pt_BR.utf-8 ...)
2. Generate POT file: $ podir=po XGETTEXT='xgettext --kde --from-code UTF-8' bash ./Messages.sh

OBSERVED RESULT
After xgettext run, the generated POT file and the updated PO files still won't have the whole message available for translation.

EXPECTED RESULT
For the whole string be available for translation.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.0
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1
Kernel Version: 6.15.3-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
plasma-welcome-fedora-6.3.4-1.fc42.noarch
plasma-welcome-6.4.0-1.fc42.x86_64

ADDITIONAL INFORMATION
Same issue as the bug report #464630, but different string.
Comment 2 Nate Graham 2025-06-26 19:25:23 UTC
Git commit 5c92a7e67933d684c3a70df50b8d63d4a3ee084e by Nate Graham, on behalf of Rafael Fontenelle.
Committed on 26/06/2025 at 19:25.
Pushed by ngraham into branch 'master'.

PowerfulWhenNeeded: Fix multi-line translated text
FIXED-IN: 6.5.0

M  +4    -2    src/qml/pages/PowerfulWhenNeeded.qml

https://invent.kde.org/plasma/plasma-welcome/-/commit/5c92a7e67933d684c3a70df50b8d63d4a3ee084e
Comment 3 Alexander Potashev 2025-07-18 14:20:33 UTC
Hi Rafael, Nate,
Thanks for the fix!

Would it make sense to backport it to the stable branch Plasma/6.4?
Comment 4 Nate Graham 2025-07-19 16:18:02 UTC
Sure, since it's a translation fix, that probably makes sense. Will do.
Comment 5 Nate Graham 2025-07-19 16:18:14 UTC
Git commit def151a01d070687f321d576c050284f1029bf8d by Nate Graham.
Committed on 19/07/2025 at 16:18.
Pushed by ngraham into branch 'Plasma/6.4'.

PowerfulWhenNeeded: Fix multi-line translated text
FIXED-IN: 6.5.0


(cherry picked from commit 5c92a7e67933d684c3a70df50b8d63d4a3ee084e)

80c5ab0d Fix multi-line translated text

Co-authored-by: Rafael Fontenelle <rafaelff@gnome.org>

M  +4    -2    src/qml/pages/PowerfulWhenNeeded.qml

https://invent.kde.org/plasma/plasma-welcome/-/commit/def151a01d070687f321d576c050284f1029bf8d