CRM-9976 Support native gettext, fallback on php-gettext

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.2.0
    • Component/s: None
    • Labels:

      Description

      It would be nice to support gettext natively for the systems that can.
      On non-usenglish installations, translation will add a 20-30% overhead, if APC is not correctly configured.

      We need to:

      • use native gettext in CRM/Core/I18n.php, if supported (fallback otherwise)
      • show a warning in the UI, if people are using a localized version of CiviCRM without native gettext
      • document how to configure native gettext (the operating system must support it) - in the wiki?
      • change the hierarchy of l10n files to l10n/fr_FR/LC_MESSAGES/civicrm.mo

      See: http://forum.civicrm.org/index.php/topic,22740.msg101591.html#msg101591

        Attachments

          Activity

          [CRM-9976] Support native gettext, fallback on php-gettext
          Mathieu Lutfy added a comment -

          Committed to version 39390.

          To use it, you must define a constant in your civicrm.settings.php:

          define('CIVICRM_GETTEXT_NATIVE', 1);

          If your operating system does not support your locale, it will fallback to English. We have no method to detect whether the locale is supported or not.

          Mathieu Lutfy added a comment -

          Seems like I didn't cross-ref my commit correctly with the issue, so here is a patch for those that would like to test it on their 4.1 installs.

          Mathieu Lutfy added a comment -

          Closing this issue. There has been feedback on the forums of people who benchmarked it and noticed a good improvement on speed and memory.

          Documentation is also in the wiki:
          http://wiki.civicrm.org/confluence/display/CRMDOC41/CiviCRM+Localisation#CiviCRMLocalisation-Usingnativegettextsupport

          It is still a rather experimental feature, and not enabled by default, but it's a good start, and we can see for later releases how to make it evolve/easier to config.

            People

            • Assignee:
              Mathieu Lutfy
              Reporter:
              Mathieu Lutfy

              Dates

              • Created:
                Updated:
                Resolved: