Closed (fixed)
Project:
Internationalization
Version:
master
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2007 at 10:19 UTC
Updated:
17 Feb 2012 at 03:22 UTC
I am encountering what seems to be a basic problem. I have a Drupal website translated in 7 languages with a lot of content. I used i18n module and I am happy with it, except for one thing. In template.php and other *.tpl.php I want to put some short sentences. How can I translate them?? I tried to use t('mySentence') function but it doesn't work in these files (no problem in a *.module file). I also tried to use i18n.String experimental module, without success.
Does anybody can give me some help?
Thank you in advance ...
Comments
Comment #1
adrienf commentedNo idea?
Comment #2
jordanlewin commentedI've run into the same issue and have found no success as of yet. It seems this might be a more base issue with the way locale.module processes the t() function. Any one else have any ideas how to get around this? I'm still looking around for a solution to get the Manage Strings functionality to recognize strings in *.tpl.php and template.php files (and even in page or block content, for that matter).
Comment #3
Roberto Gerola commentedIf you don't need to pass additional arguments, you can use locale function instead :
locale('my string').
Otherwise you can add this modified function in your template.php :
And use it in this way :
tr('my string');Comment #4
jose reyero commentedYeah, you can use t() function all around.
Whatever this is plain localization, nothing to do with i18n.
Comment #5
NeilChen commentedMy drupal version is 6.20
I test it can't working.
I changed:
Comment #6
NeilChen commentedMy drupal version is 6.20
I test it can't working.
I changed: