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) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • custom profile not switching language on drupal user account
Pages: [1]

Author Topic: custom profile not switching language on drupal user account  (Read 4219 times)

avanoers

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
custom profile not switching language on drupal user account
April 25, 2010, 04:48:55 pm
Hello,

I've looked in the forum but can't find an answer so hope someone can help.
I am using drupal 6.16 and upgraded to CiviCRM 3.14
Installed French-Canadian.
Checked to have Civicrm switch with CMS in Localization
Created profile, translated the fields, and set drupal user Registration, View/Edit Drupal User Account.
All works fine and the profile is shown on the users page so that they can edit the profile. However, when the user is in their drupal account and switches the language the profile stays in English.
When checking the profile I can be accessed it in french when adding the words &lcMessages=fr_CA at the end of URL so the french is present just not switching on the user profile page.

Any help would be greatly appreciated.

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: custom profile not switching language on drupal user account
April 27, 2010, 04:59:38 pm
Hi,

I tested this in the latest 3.1 and 3.2 (dev) versions, and could not reproduce the bug.

I notice however that in 3.1, if you installed in French, then activate i18n + multi-lingual, all strings will be by default in French, so you have to go in profiles and re-translate the fields in English.

Make sure that you have activated the option "Inherit CMS Language" in CiviCRM > Admin > Global > Localization.

Might be worth checking that you are running MySQL 5.x with InnoDB, etc.

mathieu / bgm
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

avanoers

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
Re: custom profile not switching language on drupal user account
June 17, 2010, 11:13:10 am
Thank you for your response.
I've been away for a while from this project but back on now.
Here is the site I am talking about
http://ioi.spcottawa.on.ca When you click on Directory you see the English directory at this point when you change the language the switch is made in Drupal but not the profile in CivCRM which remains in English.
I've ticked off the "inherit CMS Language" in Localization.
When as an admin I have a language switcher block in CiviCRM which I can switch and that works. However, visitors to the website do not have access to the CivCRM language switcher. The idea is that they should just switch the language using the Drupal language switcher.

VERY INTERESTING I JUST NOTED THAT IF YOU ARE ON ANY OTHER PAGE THEN THE DIRECTORY AND SWITCH THE LANGAUGE TO FRENCH THEN NAVIGATE TO THE DIRECTORY ALL WORKS WELL.
You basically can't switch the drupal language on the directory page you have to do it before coming to the directory page.
I wonder if this is a bug?

And just to check yes we are running MySQL 5 with InnoBD
Thanks for your help

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: custom profile not switching language on drupal user account
June 18, 2010, 08:26:33 am
Quote from: avanoers on June 17, 2010, 11:13:10 am
VERY INTERESTING I JUST NOTED THAT IF YOU ARE ON ANY OTHER PAGE THEN THE DIRECTORY AND SWITCH THE LANGAUGE TO FRENCH THEN NAVIGATE TO THE DIRECTORY ALL WORKS WELL.
You basically can't switch the drupal language on the directory page you have to do it before coming to the directory page.
I wonder if this is a bug?

Can you confirm that this problem indeed applies only to this single page?

What we do is we try to inherit Drupal’s language as soon as possible, so it might be that in this particular case Drupal is not setting its language early enough (check the code in CRM_Utils_System_Drupal::getUFLocale() if you know PHP).
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.

avanoers

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
Re: custom profile not switching language on drupal user account
June 21, 2010, 09:18:48 am
It's just very sticky. I am not great with the code but yes it's on that page and you can have a look:
http://ioi.spcottawa.on.ca/civicrm/profile?force=1&gid=8



Thanks for looking into this.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: custom profile not switching language on drupal user account
June 25, 2010, 06:10:16 am
Quote from: avanoers on June 21, 2010, 09:18:48 am
It's just very sticky. I am not great with the code but yes it's on that page and you can have a look:
http://ioi.spcottawa.on.ca/civicrm/profile?force=1&gid=8

This is because you use path-based language selection in Drupal; in this case, if your path misses the fr part, Drupal will tell CiviCRM to inherit English – to the best of my tests if you link the page as http://ioi.spcottawa.on.ca/fr/civicrm/profile?force=1&gid=8 (note the fr part) it works without the lcMessages parameter.
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.

Simon147

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 3
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7.30
  • MySQL version: 5.0.92
  • PHP version: 5.2.9
Re: custom profile not switching language on drupal user account
November 29, 2010, 05:54:38 am
Same problem here. But the solution proposed doesn't work. In my CiviCRM backend I get the "inherit language from CMS" to work fine depending on my CMS language setting.

However, I couldn't make the public registration form adopt the language from the CMS.

If you want to check: http://asca-vabs.ch/de/user/register or http://asca-vabs.ch/fr/user/register

(By the way, any idea why it takes so much time for that profile in the public registration to load? Sometimes it takes up to 20 secs).

Simon



Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • custom profile not switching language on drupal user account

This forum was archived on 2017-11-26.