Closed (fixed)
Project:
Redirect 403 to User Login
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2012 at 15:19 UTC
Updated:
21 May 2014 at 19:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
deekayen commentedSInce this touches on it, t() shouldn't wrap variables.
Comment #2
gregglesI believe that requirement is no longer relevant.
Comment #3
gregglesRe-rolled so that it applies to 7.x-1.x-dev.
In spite of what the docs say, I really do think that it's fine to do t($foo) if $foo is some complete string entered by site administrators.
Comment #4
iamEAP commentedt($foo) is a no-no. The problem is twofold:
To properly translate Drupal variables, you're looking for this kind of thing. Where you're registering your variable with the Variable module and i18n_variable is taking care of things behind the scenes for you (so you can
variable_get('your_variable');and it'll return the localized value for you, without having to run it through anything liket()). Something like this:Note that this does not create a dependency on Variable, or i18n. It just allows sites that have a need for variable translation to localize your variable (because they would have those modules installed and enabled and know how to use them already).
Comment #5
gregglesOK, awesome, thanks for the explanation. It seems like that can be a followup in its own issue (indeed it is at #1138562: Integrate with i18n_variable) and we can just go ahead here with #3.
Comment #6
greggles#3 still makes sense and still applies.
Any reason not to commit it?
Comment #8
deekayen commented8.x got started on this project
Comment #9
deekayen commentedComment #10
bdone commentedworking on adding this to the 8.x-1.x branch.
Comment #12
bdone commented