Bug 487317 - Inaccurate TL sign (₺) display
Summary: Inaccurate TL sign (₺) display
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: git (master)
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-21 11:30 UTC by Emir SARI
Modified: 2024-05-28 18:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.2


Attachments
screenshot (246.29 KB, image/png)
2024-05-26 21:47 UTC, Emir SARI
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emir SARI 2024-05-21 11:30:11 UTC
Latest KDE neon Unstable, kmymoney git version from the repo.

Turkish Lira sign is normally prepended to the values, like ₺10,00. However, in KMyMoney, it is displayed as 10,00 ₺.

Double-checked if the system locale setting was inaccurate, but it was alright.
Comment 1 Jack 2024-05-22 02:20:58 UTC
What version, exactly?  Either do "kmymoney --version" at command line, or Help/About KMyMoney menu item.
Did it work previously?  Can you say with which version?
What locale do you have set?
Does it work correctly in other applications?  For example Libreoffice and Calligra.  That might show if it is a general problem on your installation, KDE specific, or just KMyMoney.
Comment 2 Emir SARI 2024-05-22 11:03:48 UTC
Sorry for the missing information. It's 5.1.80, and all the locale settings are tr_TR.UTF-8. The system settings locale section displays the currency sign correctly. LibreOffice also displays the sign correctly, unable to install Calligra due to package errors at the moment.

I can't say for previous versions, I am the Turkish translator, and was just checking out the strings. I only have KDE neon Unstable as my KDE system.

I tried to compile the latest master, but I was not successful due to libalkimia version errors.
Comment 3 Jack 2024-05-22 14:22:13 UTC
I wish I could think of another KDE program which displays currency.  That would help decide if the problem is specifically with KMyMoney or with one of the underlying KDE (or even Qt) libraries.  At the moment, I don't think the exact version matters, but normally, a version compiled from master branch shows something like kmymoney 5.1.80-8cdd4536e where the last part is the most recent commit.
While I continue my research, can you ask on a Neon forum or list whether anyone else has the same problem?  I don't know if there are any Turkish specific lists where you might also ask, in case a similar problem has been seen before (not necessarily in KMyMoney) and if so, what the cause was.
Comment 4 Emir SARI 2024-05-26 21:47:52 UTC
Created attachment 169863 [details]
screenshot

I can confirm that Calligra Sheets works as expected. Does this make the problem stem from Alkimia by any chance?
Comment 5 Jack 2024-05-26 23:18:37 UTC
That is quite possible.  I don't know enough about how exactly KMyMoney uses Alkimia, so I'm personally just not sure.  Hopefully someone who does know will post a more definitive response.
Comment 6 Thomas Baumgart 2024-05-27 09:24:34 UTC
I can confirm that this problem is introduced by KMyMoney (not Alkimia). Over the last couple of days, I analyzed it a bit and found out, that std::localeconv() apparently provides false information about the location of the currency symbol in the member p_cs_precedes when the selected locale is tr_TR.UTF-8 (it works correctly for others where the currency sign precedes the amount).  KMyMoney uses that information provided by std::localeenv() to format the monetary values and that is why the display differs and is incorrect.

The display in the KCM module is based on QLocale::toCurrencyString() which works on Qt's own locale information.

More to come.
Comment 7 Thomas Baumgart 2024-05-28 15:48:52 UTC
Git commit 0487f47b6da4b2cee47a13983f375eda7f205501 by Thomas Baumgart.
Committed on 28/05/2024 at 15:48.
Pushed by tbaumgart into branch 'master'.

Extract monetary formatting rules from QLocale

Extract the information howto format a monetary value from QLocale
instead of using std::localeconv which provides false information in
some cases.
FIXED-IN: 5.2

M  +1    -39   kmymoney/main.cpp
M  +0    -21   kmymoney/misc/platformtools.h
M  +0    -38   kmymoney/misc/platformtools_gnu.cpp
M  +1    -49   kmymoney/misc/platformtools_nognu.cpp
M  +53   -0    kmymoney/mymoney/mymoneymoney.cpp
M  +2    -0    kmymoney/mymoney/mymoneymoney.h
M  +4    -3    kmymoney/widgets/amountvalidator.cpp
M  +1    -1    kmymoney/widgets/tests/CMakeLists.txt

https://invent.kde.org/office/kmymoney/-/commit/0487f47b6da4b2cee47a13983f375eda7f205501
Comment 8 Emir SARI 2024-05-28 18:49:14 UTC
Thank you!