[GNC] Decimal separator on Gnucash 3.2 Mac

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[GNC] Decimal separator on Gnucash 3.2 Mac

GnuCash - User mailing list
   I’m new to GnuCash and just installed GnuCash 3.2 on Mac. OS X 10.13
   Gnucash uses the period as decimal separator instead of my locale’s
   separator.  Here in Canada it should be comma.
   Should Gnucash use the decimal separator of my locale, or is it always
   period ?  Is there a way to configure it within GnuCash ?
   Thanks,
   Yves Forget
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Decimal separator on Gnucash 3.2 Mac

Nith Valley Organics
Maybe in Quebec it is a comma.  In the rest of the country it is a period.  

There should be a different locale for fr-canada than for en-canada.  I don’t know what else would differ across locales though.

> On Jul 2, 2018, at 3:42 PM, Yves Forget via gnucash-user <[hidden email]> wrote:
>
>   I’m new to GnuCash and just installed GnuCash 3.2 on Mac. OS X 10.13
>   Gnucash uses the period as decimal separator instead of my locale’s
>   separator.  Here in Canada it should be comma.
>   Should Gnucash use the decimal separator of my locale, or is it always
>   period ?  Is there a way to configure it within GnuCash ?
>   Thanks,
>   Yves Forget
> _______________________________________________
> gnucash-user mailing list
> [hidden email]
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Decimal separator on Gnucash 3.2 Mac

GnuCash - User mailing list
System Preferences/Language and Region says Region = Canada and language = french.  Advanced shows decimal separator is comma and thousands separator is space.  (These are default values for French Canada).
Environment variable LANG=fr_CA.UTF_8
OpenOffice correctly uses comma as decimal separator.
Is Gnucash supposed to use the parameters from the locale ?  Is there a way to force it ?
 Thanks,
Yves Forget

    Le lundi 2 juillet 2018 15h48, R. Victor Klassen <[hidden email]> a écrit :
 

 Maybe in Quebec it is a comma.  In the rest of the country it is a period. 

There should be a different locale for fr-canada than for en-canada.  I don’t know what else would differ across locales though.

> On Jul 2, 2018, at 3:42 PM, Yves Forget via gnucash-user <[hidden email]> wrote:
>
>  I’m new to GnuCash and just installed GnuCash 3.2 on Mac. OS X 10.13
>  Gnucash uses the period as decimal separator instead of my locale’s
>  separator.  Here in Canada it should be comma.
>  Should Gnucash use the decimal separator of my locale, or is it always
>  period ?  Is there a way to configure it within GnuCash ?
>  Thanks,
>  Yves Forget
> _______________________________________________
> gnucash-user mailing list
> [hidden email]
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.


   
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Decimal separator on Gnucash 3.2 Mac

John Ralls-2
If you run GnuCash from a Terminal prompt do you get the right separator?

Regards,
John Ralls

> On Jul 2, 2018, at 1:42 PM, Yves Forget via gnucash-user <[hidden email]> wrote:
>
> System Preferences/Language and Region says Region = Canada and language = french.  Advanced shows decimal separator is comma and thousands separator is space.  (These are default values for French Canada).
> Environment variable LANG=fr_CA.UTF_8
> OpenOffice correctly uses comma as decimal separator.
> Is Gnucash supposed to use the parameters from the locale ?  Is there a way to force it ?
> Thanks,
> Yves Forget
>
>    Le lundi 2 juillet 2018 15h48, R. Victor Klassen <[hidden email]> a écrit :
>
>
> Maybe in Quebec it is a comma.  In the rest of the country it is a period.  
>
> There should be a different locale for fr-canada than for en-canada.  I don’t know what else would differ across locales though.
>
>> On Jul 2, 2018, at 3:42 PM, Yves Forget via gnucash-user <[hidden email]> wrote:
>>
>>   I’m new to GnuCash and just installed GnuCash 3.2 on Mac. OS X 10.13
>>   Gnucash uses the period as decimal separator instead of my locale’s
>>   separator.  Here in Canada it should be comma.
>>   Should Gnucash use the decimal separator of my locale, or is it always
>>   period ?  Is there a way to configure it within GnuCash ?
>>   Thanks,
>>   Yves Forget
>> _______________________________________________
>> gnucash-user mailing list
>> [hidden email]
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
>
>
>
> _______________________________________________
> gnucash-user mailing list
> [hidden email]
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Decimal separator on Gnucash 3.2 Mac

John Ralls-2
I tested this a bit in the debugger and I with French as the primary language and Canada as the country [currentlocale objectForKey:  NSLocaleLanguageCode] insists that the code in en, not French. If I tell System Prefs I'm in France it gets the right answer, so it might be an Apple bug.

Unfortunately setting LANG in the environment, though it will set the interface language, doesn't seem to change the number display, so there doesn't seem to be a way to force it at present.

Regards,
John Ralls


> On Jul 2, 2018, at 2:59 PM, John Ralls <[hidden email]> wrote:
>
> If you run GnuCash from a Terminal prompt do you get the right separator?
>
> Regards,
> John Ralls
>
>> On Jul 2, 2018, at 1:42 PM, Yves Forget via gnucash-user <[hidden email]> wrote:
>>
>> System Preferences/Language and Region says Region = Canada and language = french.  Advanced shows decimal separator is comma and thousands separator is space.  (These are default values for French Canada).
>> Environment variable LANG=fr_CA.UTF_8
>> OpenOffice correctly uses comma as decimal separator.
>> Is Gnucash supposed to use the parameters from the locale ?  Is there a way to force it ?
>> Thanks,
>> Yves Forget
>>
>>   Le lundi 2 juillet 2018 15h48, R. Victor Klassen <[hidden email]> a écrit :
>>
>>
>> Maybe in Quebec it is a comma.  In the rest of the country it is a period.  
>>
>> There should be a different locale for fr-canada than for en-canada.  I don’t know what else would differ across locales though.
>>
>>> On Jul 2, 2018, at 3:42 PM, Yves Forget via gnucash-user <[hidden email]> wrote:
>>>
>>>  I’m new to GnuCash and just installed GnuCash 3.2 on Mac. OS X 10.13
>>>  Gnucash uses the period as decimal separator instead of my locale’s
>>>  separator.  Here in Canada it should be comma.
>>>  Should Gnucash use the decimal separator of my locale, or is it always
>>>  period ?  Is there a way to configure it within GnuCash ?
>>>  Thanks,
>>>  Yves Forget
>>> _______________________________________________
>>> gnucash-user mailing list
>>> [hidden email]
>>> To update your subscription preferences or to unsubscribe:
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>> -----
>>> Please remember to CC this list on all your replies.
>>> You can do this by using Reply-To-List or Reply-All.
>>
>>
>>
>> _______________________________________________
>> gnucash-user mailing list
>> [hidden email]
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
>
> _______________________________________________
> gnucash-user mailing list
> [hidden email]
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Decimal separator on Gnucash 3.2 Mac

GnuCash - User mailing list
   Hi John,
   Running from the terminal I still get period.  In the terminal I got
   the following trace.
   (process:1976): gnc.gui-WARNING **: 18:35:55.003: [mac_set_languages()]
   Language list: en:fr_CA:en_CA:C
   I just downloaded the sources from GitHub, and looked
   at [mac_set_languages()].  Foundation offers global variables
   NsLocaleDecimalSeparator, NSLocaleGroupingSeparator and
   NSLocaleCurrencySymbol, among others.  These variables would bring
   directly the values mac_set_languages() is trying to get.  Furthermore,
   if a user changes the decimal separator in the Advanced panel of the
   Language and Region system preferences, gnu cash would get the expected
   separator instead of the locale’s default separator.  Is it something
   that could be changed without breaking a lot of things in the app ?
   Please don’t hesitate to tell me if I’m completely wrong…
   Thanks,
   Yves

   Le 2 juill. 2018 à 18:43, John Ralls <[1][hidden email]> a écrit :

   I tested this a bit in the debugger and I with French as the primary
   language and Canada as the country [currentlocale objectForKey:
   NSLocaleLanguageCode] insists that the code in en, not French. If I
   tell System Prefs I'm in France it gets the right answer, so it might
   be an Apple bug.
   Unfortunately setting LANG in the environment, though it will set the
   interface language, doesn't seem to change the number display, so there
   doesn't seem to be a way to force it at present.
   Regards,
   John Ralls

     On Jul 2, 2018, at 2:59 PM, John Ralls <[2][hidden email]>
     wrote:
     If you run GnuCash from a Terminal prompt do you get the right
     separator?
     Regards,
     John Ralls

     On Jul 2, 2018, at 1:42 PM, Yves Forget via gnucash-user
     <[3][hidden email]> wrote:
     System Preferences/Language and Region says Region = Canada and
     language = french.  Advanced shows decimal separator is comma and
     thousands separator is space.  (These are default values for French
     Canada).
     Environment variable LANG=fr_CA.UTF_8
     OpenOffice correctly uses comma as decimal separator.
     Is Gnucash supposed to use the parameters from the locale ?  Is
     there a way to force it ?
     Thanks,
     Yves Forget
      Le lundi 2 juillet 2018 15h48, R. Victor Klassen
     <[4][hidden email]> a écrit :
     Maybe in Quebec it is a comma.  In the rest of the country it is a
     period.
     There should be a different locale for fr-canada than for en-canada.
      I don’t know what else would differ across locales though.

     On Jul 2, 2018, at 3:42 PM, Yves Forget via gnucash-user
     <[5][hidden email]> wrote:
     I’m new to GnuCash and just installed GnuCash 3.2 on Mac. OS X 10.13
     Gnucash uses the period as decimal separator instead of my locale’s
     separator.  Here in Canada it should be comma.
     Should Gnucash use the decimal separator of my locale, or is it
     always
     period ?  Is there a way to configure it within GnuCash ?
     Thanks,
     Yves Forget
     _______________________________________________
     gnucash-user mailing list
     [6][hidden email]
     To update your subscription preferences or to unsubscribe:
     https://lists.gnucash.org/mailman/listinfo/gnucash-user
     If you are using Nabble or Gmane, please see
     https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
     -----
     Please remember to CC this list on all your replies.
     You can do this by using Reply-To-List or Reply-All.

     _______________________________________________
     gnucash-user mailing list
     [7][hidden email]
     To update your subscription preferences or to unsubscribe:
     https://lists.gnucash.org/mailman/listinfo/gnucash-user
     If you are using Nabble or Gmane, please see
     https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
     -----
     Please remember to CC this list on all your replies.
     You can do this by using Reply-To-List or Reply-All.

     _______________________________________________
     gnucash-user mailing list
     [8][hidden email]
     To update your subscription preferences or to unsubscribe:
     https://lists.gnucash.org/mailman/listinfo/gnucash-user
     If you are using Nabble or Gmane, please see
     https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
     -----
     Please remember to CC this list on all your replies.
     You can do this by using Reply-To-List or Reply-All.

References

   1. mailto:[hidden email]
   2. mailto:[hidden email]
   3. mailto:[hidden email]
   4. mailto:[hidden email]
   5. mailto:[hidden email]
   6. mailto:[hidden email]
   7. mailto:[hidden email]
   8. mailto:[hidden email]
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Decimal separator on Gnucash 3.2 Mac

GnuCash - User mailing list
In reply to this post by John Ralls-2
Hi John,

Running from the terminal I still get period.  In the terminal I got the following trace.

(process:1976): gnc.gui-WARNING **: 18:35:55.003: [mac_set_languages()] Language list: en:fr_CA:en_CA:C

I just downloaded the sources from GitHub, and looked at [mac_set_languages()].  Foundation offers global variables NsLocaleDecimalSeparator, NSLocaleGroupingSeparator and NSLocaleCurrencySymbol, among others.  These variables would bring directly the values mac_set_languages() is trying to get.  Furthermore, if a user changes the decimal separator in the Advanced panel of the Language and Region system preferences, gnu cash would get the expected separator instead of the locale’s default separator.  Is it something that could be changed without breaking a lot of things in the app ?

Please don’t hesitate to tell me if I’m completely wrong…

Thanks,

Yves

> Le 2 juill. 2018 à 18:43, John Ralls <[hidden email] <mailto:[hidden email]>> a écrit :
>
> I tested this a bit in the debugger and I with French as the primary language and Canada as the country [currentlocale objectForKey:  NSLocaleLanguageCode] insists that the code in en, not French. If I tell System Prefs I'm in France it gets the right answer, so it might be an Apple bug.
>
> Unfortunately setting LANG in the environment, though it will set the interface language, doesn't seem to change the number display, so there doesn't seem to be a way to force it at present.
>
> Regards,
> John Ralls
>
>
>> On Jul 2, 2018, at 2:59 PM, John Ralls <[hidden email] <mailto:[hidden email]>> wrote:
>>
>> If you run GnuCash from a Terminal prompt do you get the right separator?
>>
>> Regards,
>> John Ralls
>>
>>> On Jul 2, 2018, at 1:42 PM, Yves Forget via gnucash-user <[hidden email] <mailto:[hidden email]>> wrote:
>>>
>>> System Preferences/Language and Region says Region = Canada and language = french.  Advanced shows decimal separator is comma and thousands separator is space.  (These are default values for French Canada).
>>> Environment variable LANG=fr_CA.UTF_8
>>> OpenOffice correctly uses comma as decimal separator.
>>> Is Gnucash supposed to use the parameters from the locale ?  Is there a way to force it ?
>>> Thanks,
>>> Yves Forget
>>>
>>>  Le lundi 2 juillet 2018 15h48, R. Victor Klassen <[hidden email] <mailto:[hidden email]>> a écrit :
>>>
>>>
>>> Maybe in Quebec it is a comma.  In the rest of the country it is a period.  
>>>
>>> There should be a different locale for fr-canada than for en-canada.  I don’t know what else would differ across locales though.
>>>
>>>> On Jul 2, 2018, at 3:42 PM, Yves Forget via gnucash-user <[hidden email] <mailto:[hidden email]>> wrote:
>>>>
>>>> I’m new to GnuCash and just installed GnuCash 3.2 on Mac. OS X 10.13
>>>> Gnucash uses the period as decimal separator instead of my locale’s
>>>> separator.  Here in Canada it should be comma.
>>>> Should Gnucash use the decimal separator of my locale, or is it always
>>>> period ?  Is there a way to configure it within GnuCash ?
>>>> Thanks,
>>>> Yves Forget
>>>> _______________________________________________
>>>> gnucash-user mailing list
>>>> [hidden email] <mailto:[hidden email]>
>>>> To update your subscription preferences or to unsubscribe:
>>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>>> -----
>>>> Please remember to CC this list on all your replies.
>>>> You can do this by using Reply-To-List or Reply-All.
>>>
>>>
>>>
>>> _______________________________________________
>>> gnucash-user mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> To update your subscription preferences or to unsubscribe:
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>> -----
>>> Please remember to CC this list on all your replies.
>>> You can do this by using Reply-To-List or Reply-All.
>>
>> _______________________________________________
>> gnucash-user mailing list
>> [hidden email] <mailto:[hidden email]>
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
>

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Decimal separator on Gnucash 3.2 Mac

John Ralls-2
In reply to this post by GnuCash - User mailing list
Yves,

No, unfortunately querying NSLocaleDecimalSeparator and friends  won’t help. GnuCash depends at least partly on libc functions like printf (and their C++ equivalents) for formatting, and those functions in turn depend on a locale being set in the environment. They use that locale to retrieve information like decimal separator from the files in /usr/share/locale. In the case at hand, LC_MONETARY. The fact that NSLocaleLanguageCode returns en_CA instead of fr_CA causes the wrong LC_MONETARY to be consulted.

Given that GnuCash needs to work on Windows and other Unixes besides MacOS, the only alternative that I know of is ICU. WebKit uses it so it’s already a dependency but it would be a lot of work to convert; the API would need to be made available to Scheme as well for the reports because Guile also uses libc localization. It’s likely a multi-year project for a single programmer. (Well, multi-month at 40 hours/week.) Wanna volunteer?

Regards,
John Ralls



> On Jul 2, 2018, at 7:36 PM, Yves Forget <[hidden email]> wrote:
>
> Hi John,
>
> Running from the terminal I still get period.  In the terminal I got the following trace.
>
> (process:1976): gnc.gui-WARNING **: 18:35:55.003: [mac_set_languages()] Language list: en:fr_CA:en_CA:C
>
> I just downloaded the sources from GitHub, and looked at [mac_set_languages()].  Foundation offers global variables NsLocaleDecimalSeparator, NSLocaleGroupingSeparator and NSLocaleCurrencySymbol, among others.  These variables would bring directly the values mac_set_languages() is trying to get.  Furthermore, if a user changes the decimal separator in the Advanced panel of the Language and Region system preferences, gnu cash would get the expected separator instead of the locale’s default separator.  Is it something that could be changed without breaking a lot of things in the app ?
>
> Please don’t hesitate to tell me if I’m completely wrong…
>
> Thanks,
>
> Yves
>
>> Le 2 juill. 2018 à 18:43, John Ralls <[hidden email] <mailto:[hidden email]>> a écrit :
>>
>> I tested this a bit in the debugger and I with French as the primary language and Canada as the country [currentlocale objectForKey:  NSLocaleLanguageCode] insists that the code in en, not French. If I tell System Prefs I'm in France it gets the right answer, so it might be an Apple bug.
>>
>> Unfortunately setting LANG in the environment, though it will set the interface language, doesn't seem to change the number display, so there doesn't seem to be a way to force it at present.
>>
>> Regards,
>> John Ralls
>>
>>
>>> On Jul 2, 2018, at 2:59 PM, John Ralls <[hidden email] <mailto:[hidden email]>> wrote:
>>>
>>> If you run GnuCash from a Terminal prompt do you get the right separator?
>>>
>>> Regards,
>>> John Ralls
>>>
>>>> On Jul 2, 2018, at 1:42 PM, Yves Forget via gnucash-user <[hidden email] <mailto:[hidden email]>> wrote:
>>>>
>>>> System Preferences/Language and Region says Region = Canada and language = french.  Advanced shows decimal separator is comma and thousands separator is space.  (These are default values for French Canada).
>>>> Environment variable LANG=fr_CA.UTF_8
>>>> OpenOffice correctly uses comma as decimal separator.
>>>> Is Gnucash supposed to use the parameters from the locale ?  Is there a way to force it ?
>>>> Thanks,
>>>> Yves Forget
>>>>
>>>>  Le lundi 2 juillet 2018 15h48, R. Victor Klassen <[hidden email] <mailto:[hidden email]>> a écrit :
>>>>
>>>>
>>>> Maybe in Quebec it is a comma.  In the rest of the country it is a period.  
>>>>
>>>> There should be a different locale for fr-canada than for en-canada.  I don’t know what else would differ across locales though.
>>>>
>>>>> On Jul 2, 2018, at 3:42 PM, Yves Forget via gnucash-user <[hidden email] <mailto:[hidden email]>> wrote:
>>>>>
>>>>> I’m new to GnuCash and just installed GnuCash 3.2 on Mac. OS X 10.13
>>>>> Gnucash uses the period as decimal separator instead of my locale’s
>>>>> separator.  Here in Canada it should be comma.
>>>>> Should Gnucash use the decimal separator of my locale, or is it always
>>>>> period ?  Is there a way to configure it within GnuCash ?
>>>>> Thanks,
>>>>> Yves Forget
>>>>> _______________________________________________
>>>>> gnucash-user mailing list
>>>>> [hidden email] <mailto:[hidden email]>
>>>>> To update your subscription preferences or to unsubscribe:
>>>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>>>> -----
>>>>> Please remember to CC this list on all your replies.
>>>>> You can do this by using Reply-To-List or Reply-All.
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> gnucash-user mailing list
>>>> [hidden email] <mailto:[hidden email]>
>>>> To update your subscription preferences or to unsubscribe:
>>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>>> -----
>>>> Please remember to CC this list on all your replies.
>>>> You can do this by using Reply-To-List or Reply-All.
>>>
>>> _______________________________________________
>>> gnucash-user mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> To update your subscription preferences or to unsubscribe:
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>> -----
>>> Please remember to CC this list on all your replies.
>>> You can do this by using Reply-To-List or Reply-All.
>>
>

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Decimal separator on Gnucash 3.2 Mac

Bert Riding
In reply to this post by John Ralls-2
I don't know about Macs, but the POSIX locale categories for this are
LC_MONETARY for how monetary quantities are shown, and LC_NUMERIC for
other numbers, defining decimal and thousands seperators among other
things.  See locale(5).

On Mon, 2 Jul 2018 15:43:46 -0700
John Ralls <[hidden email]> wrote:

> I tested this a bit in the debugger and I with French as the primary
> language and Canada as the country [currentlocale objectForKey:
> NSLocaleLanguageCode] insists that the code in en, not French. If I
> tell System Prefs I'm in France it gets the right answer, so it might
> be an Apple bug.
>
> Unfortunately setting LANG in the environment, though it will set the
> interface language, doesn't seem to change the number display, so
> there doesn't seem to be a way to force it at present.
>
> Regards,
> John Ralls
>
>
> > On Jul 2, 2018, at 2:59 PM, John Ralls <[hidden email]> wrote:
> >
> > If you run GnuCash from a Terminal prompt do you get the right
> > separator?
> >
> > Regards,
> > John Ralls
> >  
> >> On Jul 2, 2018, at 1:42 PM, Yves Forget via gnucash-user
> >> <[hidden email]> wrote:
> >>
> >> System Preferences/Language and Region says Region = Canada and
> >> language = french.  Advanced shows decimal separator is comma and
> >> thousands separator is space.  (These are default values for
> >> French Canada). Environment variable LANG=fr_CA.UTF_8 OpenOffice
> >> correctly uses comma as decimal separator. Is Gnucash supposed to
> >> use the parameters from the locale ?  Is there a way to force it ?
> >> Thanks, Yves Forget
> >>
> >>   Le lundi 2 juillet 2018 15h48, R. Victor Klassen
> >> <[hidden email]> a écrit :
> >>
> >>
> >> Maybe in Quebec it is a comma.  In the rest of the country it is a
> >> period.  
> >>
> >> There should be a different locale for fr-canada than for
> >> en-canada.  I don’t know what else would differ across locales
> >> though.
> >>> On Jul 2, 2018, at 3:42 PM, Yves Forget via gnucash-user
> >>> <[hidden email]> wrote:
> >>>
> >>>  I’m new to GnuCash and just installed GnuCash 3.2 on Mac. OS X
> >>> 10.13 Gnucash uses the period as decimal separator instead of my
> >>> locale’s separator.  Here in Canada it should be comma.
> >>>  Should Gnucash use the decimal separator of my locale, or is it
> >>> always period ?  Is there a way to configure it within GnuCash ?
> >>>  Thanks,
> >>>  Yves Forget
> >>> _______________________________________________
> >>> gnucash-user mailing list
> >>> [hidden email]
> >>> To update your subscription preferences or to unsubscribe:
> >>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> >>> If you are using Nabble or Gmane, please see
> >>> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> >>> ----- Please remember to CC this list on all your replies.
> >>> You can do this by using Reply-To-List or Reply-All.  
> >>
> >>
> >>
> >> _______________________________________________
> >> gnucash-user mailing list
> >> [hidden email]
> >> To update your subscription preferences or to unsubscribe:
> >> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> >> If you are using Nabble or Gmane, please see
> >> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> >> ----- Please remember to CC this list on all your replies.
> >> You can do this by using Reply-To-List or Reply-All.  
> >
> > _______________________________________________
> > gnucash-user mailing list
> > [hidden email]
> > To update your subscription preferences or to unsubscribe:
> > https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > If you are using Nabble or Gmane, please see
> > https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> > ----- Please remember to CC this list on all your replies.
> > You can do this by using Reply-To-List or Reply-All.  
>
> _______________________________________________
> gnucash-user mailing list
> [hidden email]
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> ----- Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

--
Bert Riding      
[hidden email]  
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Decimal separator on Gnucash 3.2 Mac

John Ralls-2
In reply to this post by John Ralls-2
Yves,

And just for completeness I added a line to read NSLocaleDecimalSeparator and then examined it in the debugger. It's '.', consistent with the locale being en_CA instead of fr_CA.

Regards,
John Ralls


> On Jul 2, 2018, at 7:57 PM, John Ralls <[hidden email]> wrote:
>
> Yves,
>
> No, unfortunately querying NSLocaleDecimalSeparator and friends  won’t help. GnuCash depends at least partly on libc functions like printf (and their C++ equivalents) for formatting, and those functions in turn depend on a locale being set in the environment. They use that locale to retrieve information like decimal separator from the files in /usr/share/locale. In the case at hand, LC_MONETARY. The fact that NSLocaleLanguageCode returns en_CA instead of fr_CA causes the wrong LC_MONETARY to be consulted.
>
> Given that GnuCash needs to work on Windows and other Unixes besides MacOS, the only alternative that I know of is ICU. WebKit uses it so it’s already a dependency but it would be a lot of work to convert; the API would need to be made available to Scheme as well for the reports because Guile also uses libc localization. It’s likely a multi-year project for a single programmer. (Well, multi-month at 40 hours/week.) Wanna volunteer?
>
> Regards,
> John Ralls
>
>
>
>> On Jul 2, 2018, at 7:36 PM, Yves Forget <[hidden email]> wrote:
>>
>> Hi John,
>>
>> Running from the terminal I still get period.  In the terminal I got the following trace.
>>
>> (process:1976): gnc.gui-WARNING **: 18:35:55.003: [mac_set_languages()] Language list: en:fr_CA:en_CA:C
>>
>> I just downloaded the sources from GitHub, and looked at [mac_set_languages()].  Foundation offers global variables NsLocaleDecimalSeparator, NSLocaleGroupingSeparator and NSLocaleCurrencySymbol, among others.  These variables would bring directly the values mac_set_languages() is trying to get.  Furthermore, if a user changes the decimal separator in the Advanced panel of the Language and Region system preferences, gnu cash would get the expected separator instead of the locale’s default separator.  Is it something that could be changed without breaking a lot of things in the app ?
>>
>> Please don’t hesitate to tell me if I’m completely wrong…
>>
>> Thanks,
>>
>> Yves
>>
>>> Le 2 juill. 2018 à 18:43, John Ralls <[hidden email] <mailto:[hidden email]>> a écrit :
>>>
>>> I tested this a bit in the debugger and I with French as the primary language and Canada as the country [currentlocale objectForKey:  NSLocaleLanguageCode] insists that the code in en, not French. If I tell System Prefs I'm in France it gets the right answer, so it might be an Apple bug.
>>>
>>> Unfortunately setting LANG in the environment, though it will set the interface language, doesn't seem to change the number display, so there doesn't seem to be a way to force it at present.
>>>
>>> Regards,
>>> John Ralls
>>>
>>>
>>>> On Jul 2, 2018, at 2:59 PM, John Ralls <[hidden email] <mailto:[hidden email]>> wrote:
>>>>
>>>> If you run GnuCash from a Terminal prompt do you get the right separator?
>>>>
>>>> Regards,
>>>> John Ralls
>>>>
>>>>> On Jul 2, 2018, at 1:42 PM, Yves Forget via gnucash-user <[hidden email] <mailto:[hidden email]>> wrote:
>>>>>
>>>>> System Preferences/Language and Region says Region = Canada and language = french.  Advanced shows decimal separator is comma and thousands separator is space.  (These are default values for French Canada).
>>>>> Environment variable LANG=fr_CA.UTF_8
>>>>> OpenOffice correctly uses comma as decimal separator.
>>>>> Is Gnucash supposed to use the parameters from the locale ?  Is there a way to force it ?
>>>>> Thanks,
>>>>> Yves Forget
>>>>>
>>>>> Le lundi 2 juillet 2018 15h48, R. Victor Klassen <[hidden email] <mailto:[hidden email]>> a écrit :
>>>>>
>>>>>
>>>>> Maybe in Quebec it is a comma.  In the rest of the country it is a period.  
>>>>>
>>>>> There should be a different locale for fr-canada than for en-canada.  I don’t know what else would differ across locales though.
>>>>>
>>>>>> On Jul 2, 2018, at 3:42 PM, Yves Forget via gnucash-user <[hidden email] <mailto:[hidden email]>> wrote:
>>>>>>
>>>>>> I’m new to GnuCash and just installed GnuCash 3.2 on Mac. OS X 10.13
>>>>>> Gnucash uses the period as decimal separator instead of my locale’s
>>>>>> separator.  Here in Canada it should be comma.
>>>>>> Should Gnucash use the decimal separator of my locale, or is it always
>>>>>> period ?  Is there a way to configure it within GnuCash ?
>>>>>> Thanks,
>>>>>> Yves Forget
>>>>>> _______________________________________________
>>>>>> gnucash-user mailing list
>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>> To update your subscription preferences or to unsubscribe:
>>>>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>>>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>>>>> -----
>>>>>> Please remember to CC this list on all your replies.
>>>>>> You can do this by using Reply-To-List or Reply-All.
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> gnucash-user mailing list
>>>>> [hidden email] <mailto:[hidden email]>
>>>>> To update your subscription preferences or to unsubscribe:
>>>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>>>> -----
>>>>> Please remember to CC this list on all your replies.
>>>>> You can do this by using Reply-To-List or Reply-All.
>>>>
>>>> _______________________________________________
>>>> gnucash-user mailing list
>>>> [hidden email] <mailto:[hidden email]>
>>>> To update your subscription preferences or to unsubscribe:
>>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>>> -----
>>>> Please remember to CC this list on all your replies.
>>>> You can do this by using Reply-To-List or Reply-All.
>>>
>>
>
> _______________________________________________
> gnucash-user mailing list
> [hidden email]
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.