Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » thousand separator problem
thousand separator problem [message #5067] Sat, 02 September 2006 00:38 Go to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
Using Hungarian setup and hungarian double formatting (%nl), my app showed squares instead of thousand separators.
I changed the return line of String GetLocaleInfoA(LCID lcid, LCTYPE lctype) in Lang.cpp from
return cbuf;

to
return FromSystemCharset(cbuf);

Now it seems to be working well, but I don't know if this is the optimal solution?
Re: thousand separator problem [message #5069 is a reply to message #5067] Sat, 02 September 2006 07:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, there is still a bit controversy about handling locale informations.

There are now two competing approaches.

- use translation system and U++ stuff to provide all localization informations. Means put localization info into U++.

- use host platform localization. This IMO has disadvantage that localization has to be reimplemented for each host platform (OTOH, so far there are just two Smile, and that not always host platform localization is satisfactory.

Mirek

P.S.: Nothing wrong with FromSystemCharset - applied...
Re: thousand separator problem [message #5074 is a reply to message #5069] Sat, 02 September 2006 10:47 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
Yes, I saw that LanguageInfo classes, but I din't have time to implement a hungarian one and integrate to the system yet.

[Updated on: Sat, 02 September 2006 10:47]

Report message to a moderator

Re: thousand separator problem [message #5075 is a reply to message #5074] Sat, 02 September 2006 10:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, and what is your opinion? Smile

The first approach is now represented by how date/time conversions are performed.

It would be quite easy to do the same for thousands separator and other things (simply add special translation strings).

Another issue, however, is language specific sorting. I am not now 100% sure whether even that could be represented by "translation string", but I could try.... I think it should be possible to encode sorting order into single string.

Mirek
Re: thousand separator problem [message #5076 is a reply to message #5067] Sat, 02 September 2006 12:00 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
Well, I really don't now, which approach is the best.
Both of them has advantages and disadvantages.

Personally I prefer borrowing these things from host system, because this way the user can tweak the language specific things using the host's standard config tools (e.g. Control Panel). And using this approach you, as a programmer, don't have to write a setup tool in the application.

But what if the host system doesn't support e.g. thousand separator? ==> use translation files?

So it would be good to know, if every platform, planned to support, has all the features, used in UPP.

Language specific sorting: using translation files would be a good idea. Using that, it would be very easy to start supporing a new language, I think.
Re: thousand separator problem [message #5077 is a reply to message #5076] Sat, 02 September 2006 12:10 Go to previous message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
Maybe the best implementation would be using an abstract class and inheritance to this problem.
There would be host platform dependant and translation dependant implementations.
Previous Topic: CJK support
Next Topic: what about decimal-point and thousand-separator?
Goto Forum:
  


Current Time: Thu Mar 28 23:35:17 CET 2024

Total time taken to generate the page: 0.01222 seconds