Call the civicrm function to get the equivalent in CiviCRM :
CRM_Core_I18n_PseudoConstant::longForShort($drupalLanguage)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | provision_civicrm_1485920_6.x-1.x.patch | 3.91 KB | sluc23 |
Call the civicrm function to get the equivalent in CiviCRM :
CRM_Core_I18n_PseudoConstant::longForShort($drupalLanguage)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | provision_civicrm_1485920_6.x-1.x.patch | 3.91 KB | sluc23 |
Comments
Comment #2
bgm commentedFixed in provision_civicrm 6.x-2.x, commit bb8fdb28fccd1497220ec93c0c905a25a91fcbe8. http://cgit.drupalcode.org/provision_civicrm/commit/?id=bb8fdb2
It assumes that if Drupal is in French (fr), CiviCRM's language will be fr_FR. We can override the language association by declaring in ~/config/includes/global.inc a global constant such as:
define('PROVISION_CIVICRM_LANGUAGE_MAPPING_FR', 'fr_CA');A few language/country exceptions are handled explicitely, such as af_ZA, he_IL, zh_CN, etc.
A "nice to have" would be to add a front-end option in hosting_civicrm so that we can choose the language.
NB: due to a limitation in the CiviCRM installer, you still have to switch the language after the installation, but the data will all be in the correct locale. This need to be fixed in CiviCRM core.
NB: if you have issues with "flushing the cache", it's a bug in CiviCRM 4.4.6: https://issues.civicrm.org/jira/browse/CRM-14935
Finally.. note that the diff is bigger than it should be, since this was done while in the process of dropping the duplication of civicrm.drush.inc for #2133493: Error: Cannot redeclare civicrm_drush_command().
Thanks to Ixiam.com for sponsoring the development of this feature.
Comment #3
sluc23 commentedHi, I created a patch for this issue for branch 6.x-1.x
Basically uses the function provision_civicrm_language_uf_to_civicrm to determine the civicrm language to use, and then import localized sql data files (if they exist, if not english installation by default)