Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Following #2078137: t() should only be used on static string literals,
'placeholder_text_multiple' => t(variable_get('chosen_placeholder_text_multiple', 'Choose some options')),
(among others) was changed to
'placeholder_text_multiple' => variable_get('chosen_placeholder_text_multiple', t('Choose some options')),
But now, a string (e.g. "Choose some options") won't be translated, at least if the variable chosen_placeholder_text_multiple
is already stored.
Comments
Comment #1
dafederThe proper way to do this would be to implement the variable API, as per https://drupal.org/node/1113374
This isn't exactly a bug, but more of a feature request. I need this as well for a project and can probably submit a patch in the next few days.
Comment #2
tgmfn CreditAttribution: tgmfn commentedYou're right. Yes, that would be great, if you could submit a patch when you are concerned with that in your project as well. Thank you very much in advance.
(By now, I've used the old improper
t(variable_get(...))
as a quick workaround.)Comment #3
Hydra CreditAttribution: Hydra commentedAs far as I know, there is already an issue with a patch doing this. Please test this patch #1591908: Add Variable module integration (via hook_variable_info) Close this as a duplicate