Hello,
We're creating a website using profile2_regpath module and we noticed that the title of the user register form can't be translated, to fix that, we embed check_plain($title) with the t() function.
File : profile2_regpath/registration_form.inc
Line : 84
// Set title.
drupal_set_title(t(check_plain($title)));
And now we can translate the title using the translate interface of Drupal.
Hope it will be helpfull ;)
Bye!
Comments
Comment #1
grasmash commentedThanks for the tip.
The best way to do this would be:
Technically, you're not supposed to run functions inside of t(). Using the '@' character before a t() variable will run it through check_plain() automatically. I've made this change and pushed it to dev.
Thanks!
Comment #2
gghh2 commentedThanks for your "pragmatic" adwise !
Comment #3
guillaume.d commentedHi,
@madmatter23 : The problem i see putting '@title' inside t() is that we going to have only the string '@title' to translate in the interface (and not the 'real' one). For example if we have the title 'Create new Teenager account' on a form and another form with 'Create new Elected account', we want to translate specifically these titles and we can't use '@title'.
To fix that we can put the real title in the translate method, like this:
Bye :)
Comment #4
guillaume.d commentedComment #5
grasmash commentedChange committed. Thanks!