Bug 122760 - Decimal comma instead of point in German Kalzium
Summary: Decimal comma instead of point in German Kalzium
Status: RESOLVED FIXED
Alias: None
Product: kalzium
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Kalzium Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-26 21:24 UTC by Daniel Herding
Modified: 2007-03-22 17:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Localize numeric values (18.83 KB, patch)
2007-03-20 20:47 UTC, Stephan Johach
Details
Localize numeric values (18.83 KB, patch)
2007-03-21 18:16 UTC, Stephan Johach
Details
Final patch applied to svn. Reviewed by Pino Toscano. (17.84 KB, patch)
2007-03-22 17:02 UTC, Stephan Johach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Herding 2006-02-26 21:24:27 UTC
Version:           1.4.3 (using KDE KDE 3.5.1)
Installed from:    SuSE RPMs
OS:                Linux

Hi,

I'm using Kalzium on a German SuSE 10.0 / KDE 3.5.1 system. In German, a point is used to separate thousands, while commas are used as a decimal separator. In English, it's the other way round. Although my Kalzium shows German texts, the commas and points are used as in the English version. This is wrong and irritating, so it would be nice if someone could fix this.

Please see http://en.wikipedia.org/wiki/Decimal_separator for examples of how to use decimal separators in different languages. But I guess KDE already has routines which handle this.


Daniel
Comment 1 chhamann 2006-02-27 16:41:04 UTC
Hi,

I'm just working on this problem!
Probably in the next version of kde-i18n all GUI messanges will be available in german. Incl. the last missing messanges ...

See http://i18n.kde.org/stats/gui/trunk/de/kdeedu/index.php for the actual situation of translating Kalzium.
Comment 2 Pino Toscano 2006-02-27 17:06:13 UTC
> In German, a point is used to separate thousands, while commas are used as a
> decimal separator. In English, it's the other way round.


Not only in German, but also in Italian.
So, it's not an issue of the German translation, nor of any other Kalzium 
translation.

> Please see http://en.wikipedia.org/wiki/Decimal_separator for examples of
> how to use decimal separators in different languages. But I guess KDE
> already has routines which handle this.


No need to look at Wikipedia (for this time), as KDE already provides us all 
the things we need. Sadly, they were not applied before.
Comment 3 Stephan Johach 2007-03-16 08:41:21 UTC
I' am working on a localisation patch to fix this and will post it soon for review by the developers. Stay tuned. :)
Comment 4 Stephan Johach 2007-03-20 20:47:07 UTC
Created attachment 20057 [details]
Localize numeric values
Comment 5 Stephan Johach 2007-03-21 18:16:54 UTC
Created attachment 20063 [details]
Localize numeric values

The previous patch had a serious bug. So please do not use it. This is a
corrected version.
Comment 6 Pino Toscano 2007-03-21 19:11:36 UTC
The patch may work, but it needs some massage here and there:

> 			v = QString::number( value );
>+			v = KalziumUtils::localizedValue( v, 6 );
What's this nonsense?

>+		static QString localizedValue( const QString& string, int precision, unsigned long options = 0 );
Why the format from string? We use numbers everywhere, and strings just when displaying, so this function and the other one that takes the QString as parameter are completely useless, IMHO.

+QString KalziumUtils::localizedValue( int val )
+{
+	return KGlobal::locale()->formatLong( val );	
+}
What's this function for? Just merge it into the other one, and for example use a flag to determine whether use KLocale::formatNumer() or KLocale::formatLong().
Comment 7 Stephan Johach 2007-03-22 16:55:54 UTC
SVN commit 645428 by johach:

Show numeric values in local format.
Patch reviewed by Pino Toscano.
BUG: 122760


 M  +7 -4      detailedgraphicaloverview.cpp  
 M  +22 -17    detailinfodlg.cpp  
 M  +20 -18    element.cpp  
 M  +9 -8      isotope.cpp  
 M  +2 -1      kalzium.cpp  
 M  +2 -1      kalziumtip.cpp  
 M  +14 -0     kalziumutils.cpp  
 M  +13 -0     kalziumutils.h  
 M  +2 -1      periodictableview.cpp  
 M  +2 -1      spectrumwidget.cpp  
Comment 8 Stephan Johach 2007-03-22 17:02:22 UTC
Created attachment 20070 [details]
Final patch applied to svn. Reviewed by Pino Toscano.

Just for the records. The committed patch.