'uiLanguages' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
];
- public function preProcess() {
- if (!CRM_Core_I18n::isMultiLingual()) {
- CRM_Core_Resources::singleton()
- ->addScriptFile('civicrm', 'templates/CRM/Admin/Form/Setting/Localization.js', 1, 'html-header');
- }
- }
-
/**
* Build the form object.
*/
global $dbLocale;
// try to inherit the language from the hosting CMS
- if ($settings->get('inheritLocale')) {
+ // If the language is specified in the session (ie. via lcMessages) we still allow it to be overridden.
+ if ($settings->get('inheritLocale') && empty($sessionLocale)) {
// FIXME: On multilanguage installs, CRM_Utils_System::getUFLocale() in many cases returns nothing if $dbLocale is not set
$lcMessages = $settings->get('lcMessages');
$dbLocale = $multiLang && $lcMessages ? "_{$lcMessages}" : '';
'is_domain' => 1,
'is_contact' => 0,
'help_text' => NULL,
+ 'description' => ts('If Yes, the initial session language will be set by the CMS, which can later be changed if using the CiviCRM language switcher.'),
],
'dateformatDatetime' => [
'group_name' => 'Localization Preferences',
'title' => ts('Default Language for contacts'),
'is_domain' => 1,
'is_contact' => 0,
- 'description' => ts('Default language (if any) for contact records'),
+ 'description' => ts('Default language (if any) for contact records.'),
'help_text' => 'If a contact is created with no language this setting will determine the language data (if any) to save.'
. 'You may or may not wish to make an assumption here about whether it matches the site language',
],
</ul>
{ts 1='href="http://php.net/manual/en/function.money-format.php"'}For a full list of options see the php <a %1>money_format documentation</a>.{/ts}
{/capture}
-{htxt id="inheritLocale"}
- <p>
- {ts}If checked, CiviCRM will follow CMS language changes.{/ts}
- </p>
-{/htxt}
{htxt id="defaultCurrency"}
<p>
{ts}Default currency assigned to contributions and other monetary transactions.{/ts}
+++ /dev/null
-CRM.$(function($) {
- $('input[name=inheritLocale]').click(function () {
- showHideUiLanguages();
- });
-
- function showHideUiLanguages() {
- var val = $('input[name=inheritLocale]:checked').val();
- if(val == 0) {
- $('.crm-localization-form-block-uiLanguages').show();
- } else {
- $('.crm-localization-form-block-uiLanguages').hide();
- }
- }
-
- showHideUiLanguages();
-});
</tr>
{/if}
<tr class="crm-localization-form-block-inheritLocale">
- <td class="label">{$form.inheritLocale.label} {help id='inheritLocale' title=$form.inheritLocale.label}</td>
- <td>{$form.inheritLocale.html}</td>
+ <td class="label">{$form.inheritLocale.label}</td>
+ <td>{$form.inheritLocale.html}<br />
+ <span class="description">{$settings_fields.inheritLocale.description}</span>
+ </td>
</tr>
{if !$form.languageLimit}
<tr class="crm-localization-form-block-uiLanguages">
<tr class="crm-localization-form-contact_default_language">
<td class="label">{$form.contact_default_language.label}</td>
<td>{$form.contact_default_language.html}<br />
- <span class="description">{ts}Default language (if any) for contact records.{/ts}</span></td>
+ <span class="description">{$settings_fields.contact_default_language.description}</span>
+ </td>
</tr>
<tr class="crm-localization-form-block-defaultCurrency">
<td class="label">{$form.defaultCurrency.label} {help id='defaultCurrency' title=$form.defaultCurrency.label}</td>