Details
-
Type: Patch
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.0, 4.0.0, 4.0.7
-
Fix Version/s: None
-
Component/s: Internationalisation
-
Labels:None
Description
- Introduction:
The definition of the config variable $gettextResourceDir in /civicrm/CRM/Core/Config/Defaults.php looks like:
—
$this->gettextResourceDir =
$civicrm_root . DIRECTORY_SEPARATOR .
'l10n' . DIRECTORY_SEPARATOR ;
—
=> Creates the following path: /civicrm/l10n/ (Note: with trailing slash)
- Problem description:
The constructor of CRM_Core_I18n (in /civicrm/CRM/Core/I18n.php) uses an instance of a Filereader with the following path construction:
—
$streamer = new FileReader(implode(DIRECTORY_SEPARATOR, array($config->gettextResourceDir, $locale, 'civicrm.mo')));
—
=> Creates the following path: /civicrm/l10n//de_DE/civicrm.mo (Note: double slashes because of the implode() and the trailing slash from $gettextResourceDir)
- The correct path sould be created like:
—
$streamer = new FileReader($config->gettextResourceDir . $locale . DIRECTORY_SEPARATOR . 'civicrm.mo');
—
=> Creates the following path: /civicrm/l10n/de_DE/civicrm.mo (Note: without double slashes)
Attached is a patch which will fix this issue. I guess it depends on the operating system (tested on CentOS and Debian)
Best regards
Uwe David