Bug 401382 - String "Plus tôt en" rendered as "Plu55 CESTôCEST"
Summary: String "Plus tôt en" rendered as "Plu55 CESTôCEST"
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: details mode (show other bugs)
Version: 18.12.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-25 00:35 UTC by Robert Vanden Eynde
Modified: 2021-05-30 11:00 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
String "Plus tôt" creates a display problem (180.04 KB, image/png)
2018-11-25 00:35 UTC, Robert Vanden Eynde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Vanden Eynde 2018-11-25 00:35:06 UTC
Created attachment 116492 [details]
String "Plus tôt" creates a display problem

SUMMARY
Encoding problem on string "Plus tôt en"

STEPS TO REPRODUCE
1. French locale
2. Affichage > Afficher par groupes
3. Terminal `touch -d 10 months ago` to create old file

OBSERVED RESULT
"Plu55 CESTôCEST"

EXPECTED RESULT
"Plus tôt"

ADDITIONAL INFORMATION
I think it is related to some parsing on a datetime containing time zone, because I'm in CEST time zone
Comment 1 Christoph Feck 2018-12-19 23:59:16 UTC
This is caused by the french translations for the single quotations marks. Dolphin code uses QDateTime::toString() to convert text such as

    'Two weeks ago' (MMMM, yyyy)

to actual dates, such as

    'Two weeks ago' (December, 2018)

The documentation for this function at http://doc.qt.io/qt-5/qdatetime.html#toString states that "Any sequence of characters that are enclosed in single quotes will be treated as text and not be used as an expression."

The french translation of those strings seems to replace the single quotation marks '...' with typographical quotation marks «...». While the intention is good, it breaks the formatting of the QDateTime strings.

tl'dr: Please keep single quotes in the Dolphin date format strings when translating.
Comment 2 Christoph Feck 2018-12-20 00:02:24 UTC
Addendum: the list of strings can be seen at https://cgit.kde.org/dolphin.git/tree/src/kitemviews/kfileitemmodel.cpp#n2044 in the big 'if' block (lines 2048-2091).
Comment 3 Christoph Feck 2018-12-20 00:16:50 UTC
CC'ing translations maintainers to check if maybe other language translations are also substituting the single quotation marks for those strings.

The issue can only be seen by using Dolphin's "Show in Groups" and "Sort by > Modification Time" view modes, so that might have been unnoticed.
Comment 4 Burkhard Lück 2018-12-20 05:27:27 UTC
Nearly all language translations are affected by this issue.
All these strings need the information provided in #1 in the msgcxt, 
otherwise it is impossible to translate the strings properly.
Comment 5 Albert Astals Cid 2018-12-22 11:27:42 UTC
This is mostly a dolphin bug.

It has to:
 a) As Burkhard says, be clear what are the restrictions in translating those strings
 b) ideally check the translation is within the bounds of what is valid and if not, i guess not use the translation and give a fat qWarning in the command line.

I'll send a warning to the translators and some of them will fix it, but you can't expect everyone to read all emails, give them the tools (i.e. the context) to make their job right
Comment 6 Christoph Feck 2019-01-17 04:03:26 UTC
Reassigning back to Dolphin, see comment #5.
Comment 7 Elvis Angelaccio 2019-03-09 11:35:49 UTC
Git commit 1a325946174258186b6b8dfeae6dd096d90483f2 by Elvis Angelaccio.
Committed on 09/03/2019 at 11:34.
Pushed by elvisangelaccio into branch 'master'.

Fix context for QDateTime::toString() translations

Summary:
The documentation of QDateTime::toString() says that:

    Any sequence of characters that are enclosed in single
    quotes will be treated as text and not be used as an expression.

This means that translators cannot replace single quotes with other
characters such as «...». This is now described in the context of the
affected strings.

We also check that the translated string contains exactly 2 single
quotes, and we use the untraslated string otherwise.

Reviewers: lueck, aacid, cfeck

Subscribers: ltoscano, kfm-devel

Tags: #dolphin

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

M  +70   -30   src/kitemviews/kfileitemmodel.cpp

https://commits.kde.org/dolphin/1a325946174258186b6b8dfeae6dd096d90483f2