Format function in report works different on mac and windows

Fabian Eschrich info at faesch.de
Fri Nov 16 06:23:05 CST 2012


Hi Ruslan,

good to know. Thanks alot.
Is there any chance to get that fix into v4 too? (maybe by replacing dll?)
If not - is there a chance to change that system setting on a mac to workaround this problem?

Best regards

Fabian

Am 16.11.2012 um 12:50 schrieb Ruslan Zasukhin <ruslan_zasukhin at valentina-db.com>:

> On 15/11/2012 08:47, "Fabian Eschrich" <info at faesch.de> wrote:
> 
>> Hi Ruslan,
>> 
>> we tested again with a local mac installation yesterday. Also on a german
>> system and we also got $ inside the report. So it seems locale is detected
>> wrong on mac.
>> 
>> Best regards
>> 
>> Fabian
> 
> Hi Fabian,
> 
> In short. We think we have FIX this.
> Will be available in next beta build for MAC.
> 
> Source of problem is described below.
> 
> 
> FYI.  In near future we going add into Valentina Reports feature to specify
> few localizations of the same report.
> 
> 
> 
> 
>> Hi Guys,
>> 
>> 1) For years we have used uloc_getDefault() to get default "system" locale
>> from ICU, which we later use as locale for new database on disk.
>> 
>> But yesterday we have note, that even if we change in System Prefs of OS X
>> for example, to:
>>      Language          Deutsch
>>      Region              Deutschland
>> 
>> 
>> uloc_getDefault() always returns "en_us_POSIX"
>> 
>> 
>> 2) I have spent some time in google, and it looks that uloc_getDefault()
>> returns some very basic system root locale ...  But not the current one.
>> 
>> 
>> 3) In Apples docs, I have found code that gives what we need:
>> 
>>    CFLocaleRef loc = CFLocaleGetCurrent();
>> 
>>    CFStringRef countryCode = CFLocaleGetValue (loc, kCFLocaleCountryCode);
>> 
>>    CFArrayRef langs = CFLocaleCopyPreferredLanguages();
>>    CFStringRef langCode = CFArrayGetValueAtIndex (langs, 0);
>> 
>> So we can get "DE" + "de",  or "GB" + "en".
>> 
>> Important is that here place CFLocaleGetCurrent() -- for CURRENT user.
>> 
>> 
>> 
>> 4) Question: can we do the same using native ICU API ?
>> If not then why such obvious feature is not added into ICU for years?
>> 
>> If not, then we are forced to use OS-dependent code for each of 3 OS?
> 
> -- 
> Best regards,
> 
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
> 
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
> 
> [I feel the need: the need for speed]
> 
> 




More information about the Valentina-beta mailing list