Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14769

Extension translation: bugfix and add support for phpgettext

    Details

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

      Description

      I found a small (but frustrating) bug in how ts() handles the gettext domain changes for extensions.

      • sometimes the $params['domain'] is empty, not null, so it goes through useless lookups for extensions
      • CRM_Core_I18n::setGettextDomain() was not returning anything, but then the return value was used to change the domain back afterwards.. this led to weird things happening sometimes.

      I also added support for phpgettext translation of extensions. It works, but I can't vouch for the performance, since phpgettext is horribly slow, but presumably it's not much slower than just translating for core.

        Attachments

          Activity

            People

            • Assignee:
              timotten Tim Otten
              Reporter:
              mlutfy Mathieu Lutfy
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: