CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Monetary Display Format don´t change. It uses the User Language config.
Pages: [1]

Author Topic: Monetary Display Format don´t change. It uses the User Language config.  (Read 1670 times)

jjdoms

  • Guest
Monetary Display Format don´t change. It uses the User Language config.
March 31, 2008, 03:51:16 am
Hello,

I have changed the User Language to es_ES (Spanish) and I want the Monetary Locale to be en_US format. But when I add one Membership to a contact and I see the civiContribute, the format has not been changed. If I change to the default user language, en_US, and the same Monetary Locale, then the format is correct. This happens with other user languages (i.e. German). Like to say, always use the User Language configuration, changes on the Monetary Locale don´t work.

Does anyone know what happens?

Thanks
« Last Edit: April 01, 2008, 07:07:38 am by jjdoms »

jjdoms

  • Guest
Re: Monetary Display Format don´t change. It uses the User Language config.
April 02, 2008, 05:47:57 am
hello,

I have been  researching the database and I have found the table civicrm_domain that in the field config_backend contains the basic information for my problem but it look correct.

Does anyone help me? what´s happen?

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Monetary Display Format don´t change. It uses the User Language config.
April 03, 2008, 12:33:10 am
It looks like the separation between the language locale and the monetary locale got lost when we were redesigning the configuration classes. This is issue CRM-2782, and I’ll work on it next week at the latest.

Once I fix this for CiviCRM 2.1, I’ll provide a patch for 2.0 in this thread.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

jjdoms

  • Guest
Re: Monetary Display Format don´t change. It uses the User Language config.
April 03, 2008, 07:48:58 am
Hello,

thank you very much Piotr for your reply. I´d like you post here when you have one solution for this issue. Where do you upload the solution?

thanks

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Monetary Display Format don´t change. It uses the User Language config.
April 08, 2008, 03:09:42 am
I fixed this on trunk, which means this will be fixed in CiviCRM 2.1.

If you want to have this fixed in a CiviCRM 2.0 install, apply the following diff to your CRM/Core/BAO/Setting.php file:

Code: [Select]
Index: CRM/Core/BAO/Setting.php
===================================================================
--- CRM/Core/BAO/Setting.php (revision 13885)
+++ CRM/Core/BAO/Setting.php (working copy)
@@ -162,6 +162,9 @@
             //calculate hour var for Date Time
             $defaults['datetimeformatHourVar'] =  strstr($defaults['dateformatQfDatetime'], '%I') ?'h' : (strstr($defaults['dateformatQfDatetime'], '%l') ? 'g' : null);
 
+            // set proper monetary formatting, falling back to en_US and C (CRM-2782)
+            setlocale(LC_MONETARY, $defaults['lcMonetary'].'.utf8', $defaults['lcMonetary'], 'en_US.utf8', 'en_US', 'C');
+
             $skipVars = array( 'dsn', 'templateCompileDir',
                                'userFrameworkDSN',
                                'userFrameworkBaseURL', 'userFrameworkClass', 'userHookClass',

– in other words, add the line
setlocale(LC_MONETARY, $defaults['lcMonetary'].'.utf8', $defaults['lcMonetary'], 'en_US.utf8', 'en_US', 'C');
before the $skipVars = … line.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

jjdoms

  • Guest
Re: Monetary Display Format don´t change. It uses the User Language config.
April 08, 2008, 04:18:28 am
Thankyou very much Piotr!!! I have tried it now and it works correctly! I have changed en_US to my language.

Thankyou for your help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Monetary Display Format don´t change. It uses the User Language config.

This forum was archived on 2017-11-26.