CiviCRM 2.1 have the ts() function too, so drupal won't work with both modules installed (civicrm and i18nstrings).

CommentFileSizeAuthor
#7 ts.patch4.3 KBmfb
#2 i18n-ts.patch4.14 KBmfb

Comments

steve.m’s picture

I second this. CiviCRM's position is that they chose the function name first:
http://forum.civicrm.org/index.php/topic,4269.0.html

Apparently Localizer renamed their ts() function in response to the same problem:
http://drupal.org/node/239525

mfb’s picture

Version: 6.x-1.0-beta3 » 6.x-1.0-beta6
Component: Experimental modules » Code
Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new4.14 KB

Hope this will get fixed here, civicrm trunk still has ts() in global scope. You probably want a shorter function name than the attached patch, I'm just trying to get the ball rolling.

nedjo’s picture

Yes, this is worth fixing. Many sites will need both i18n and CiviCRM.

Is i18ncontent indeed the only place in i18n that ts() is called?

If so, apparently the longer name won't be much of a problem.

mrfelton’s picture

I can confirm that the above patch works for me with beta6 (it doesn't apply cleanly against the latest dev release)

mrfelton’s picture

It seems that one (or more) were missed:

Fatal error: Call to undefined function tt() in /home/tom/public_html/concern-6.x/sites/all/modules/i18n/i18nmenu/i18nmenu.module on line 109

mfb’s picture

@mrfelton: that should be a different issue, as this patch is re: ts() not tt().

mfb’s picture

Version: 6.x-1.0-beta6 » 6.x-1.x-dev
StatusFileSize
new4.3 KB

re-rolled against latest 6.x-1.x-dev

nedjo’s picture

Issue tags: +i18n sprint
jose reyero’s picture

Status: Needs review » Fixed

Committed, thanks

(Also seriously considering to rename all these short functions to use i18n_ namespace, this short names may not have been a good idea...)

ClearXS’s picture

Thanks to Jose for recommending me this page with the solution. Through a google search on the error message I couldn't find this page before, so I'll quote the error message again for others:

Fatal error: Cannot redeclare ts() in .../sites/all/modules/civicrm/CRM/Core/I18n.php on line 320

And for the very latest civicrm module:
Fatal error: Cannot redeclare ts() in .../sites/all/modules/civicrm/CRM/Core/I18n.php on line 321

I'd opened this forumtopic:
http://drupal.org/node/357667
-which is only for the record with the solution/page here.

Status: Fixed » Closed (fixed)
Issue tags: -i18n sprint

Automatically closed -- issue fixed for 2 weeks with no activity.