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) »
  • How to choose form language in frontend
Pages: [1]

Author Topic: How to choose form language in frontend  (Read 1142 times)

Thoudahl

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 1.7.1
  • MySQL version: 5.5.15
  • PHP version: 5.3.8
How to choose form language in frontend
March 21, 2012, 06:44:41 am
Hi Al!

I have two different sites in my joomla installation so I can't use the default joomla language switcher, though I have different language attached to my menu ithems.

How can I make sure that a sign up form is displayed in the correct language on my front end? (I have en-UK and da-DK languages installed on both joomla and CiviCRM)

Trying to load via an menu ithem gives me "The requested Profile (gid=) is disabled, OR there is no Profile with that ID, OR a valid 'gid=' integer value is missing from the URL. Contact the site administrator if you need assistance." error.

Thoudahl

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 1.7.1
  • MySQL version: 5.5.15
  • PHP version: 5.3.8
Re: How to choose form language in frontend
April 10, 2012, 03:06:14 pm
Ok, I'll try to start develope some shit.
Could anyone point me to a direction towards where it is detected what language the CMS is using?

Thoudahl

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 1.7.1
  • MySQL version: 5.5.15
  • PHP version: 5.3.8
Re: How to choose form language in frontend
April 10, 2012, 03:52:09 pm
Found it and made a small fix just for me:

In: administrator/components/com_civicrm/civicrm/CRM/Utils/System/Joomla.php

I changed from line 503
           $conf   = JFactory::getConfig();
           $locale   = $conf->getValue('config.language');
           return str_replace('-', '_', $locale);
to
       if ($_GET['lang']!=null && $_GET['lang']!="" ) {
      return str_replace('-', '_', $_GET['lang']);
       }else{
           $conf   = JFactory::getConfig();
           $locale   = $conf->getValue('config.language');
           return str_replace('-', '_', $locale);
       }

If the language is not installed then civi just use the default language.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • How to choose form language in frontend

This forum was archived on 2017-11-26.