CRM-13068 Add "LC_MESSAGES" in l10n directory hierarchy to simplify "Native gettext"

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.5
    • Fix Version/s: 4.5
    • Component/s: None
    • Labels:

      Description

      Currently, to use "native gettext" (which offers a 20% performance boost to localized/multi-lingual installs), we need to do basically three things:

      • make sure that the base operating system has the locale enabled, ex: fr_CA.utf8
      • define a constant in civicrm.settings.php, ex: define('CIVICRM_GETTEXT_NATIVE', 1);
      • move files around in the l10n directory so that it has the following structure: civicrm/l10n/LC_MESSAGES/fr_CA/civicrm.mo, instead of currently: civicrm/l10n/fr_CA/civicrm.mo. – this is something imposed by gettext in general.

      To make it easier to enable native gettext, I would like the l10n directory hierarchy to be in the correct form by default (civicrm/l10n/LC_MESSAGES/fr_CA/civicrm.mo).

      Changes required:

      • distmaker needs to generate the files with the right hierarchy (or modify SVN/git setup)
      • CRM/Core/I18n.php for php-gettext (non-native) will need to search in $config->gettextResources . '/LC_MESSAGES/[...]/;

      And then we need to blog about it, so that people who will update their translations using civicrm-l10n.tar.gz will not be confused.

        Attachments

          Issue Links

            Activity

            [CRM-13068] Add "LC_MESSAGES" in l10n directory hierarchy to simplify "Native gettext"
            Mathieu Lutfy added a comment -

            Conclusion of a discussion with Tim on IRC:

            "so to recap then – jenkins triggers a build on test-ubu1204-X, which creates [mo files], which we then scp (using a suitable SSH key) to www-prod:/var/www/localize.civicrm.org"

            • since we are changing the file hierarchy, and this will break some build scripts of developers, we may as well take the opportunity to stop publishing .mo files in git/svn, which is expensive (especially for git) since they are binary files (takes a lot of space, time to clone the git repo).
            • we'd publish the compiled weekly .mo files on localize.civicrm.org (so that translators/developers can easily update their .mo file without needing to know how to compile the .po files). Compiling/publishing should be done with Jenkins.
            • https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over
            Mathieu Lutfy added a comment -

            PR: https://github.com/civicrm/civicrm-core/pull/3105

            Also, the other items, such as publishing the .mo files on download.civicrm.org (sushi), are in other tickets that have been linked to this one.

            Mathieu Lutfy added a comment -

            Kurund suggested that I submit a PR for 4.4, since this will be backported to 4.2 also, and is non-intrusive.

            PR: https://github.com/civicrm/civicrm-core/pull/3111

            Mathieu Lutfy added a comment -

            Has been merged, closing

              People

              • Assignee:
                Mathieu Lutfy
                Reporter:
                Mathieu Lutfy

                Dates

                • Created:
                  Updated:
                  Resolved: