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

Mechanism to override ts() for multi-lingual civicrm sites

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.9
    • Fix Version/s: 2.1
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      It would be great if we could override the ts() function using a hook/callback.

      For example, on multi-lingual sites, we have to do the following patch to CRM/Core/I18n.php:

      function ts($text, $params = array())
      {
      // [...]
      // If locale is French and if in "CiviContribute", pass strings in Drupal's t()
      global $locale;
      if ($locale == 'fr' && arg(1) == 'contribute')

      { $text = t($text); }

      // [...]
      }

      This kind of hacks cannot go in core, but it would be great if we could do it using a hook.

      c.f. http://forum.civicrm.org/index.php/topic,2510.msg11231.html#msg11231

      Thanks,

      mathieu (bgm on freenode)
      http://koumbit.org

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              mlutfy Mathieu Lutfy
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: