Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hello,
I would love to translate the string in the subscription block, but I can't seem to be able to do that.
Is this because the string has been put in a variable_get() instead of a t() ? I'm no expert in this, so I can't tell.
I want to translate this: $name_action_long = variable_get('emf_default_name_action_long', 'If you subscribe to !name, we will keep you up to date by sending newsletters.');
Thanks in advance.
Cheers,
Danny
Comments
Comment #1
davyvdb CreditAttribution: davyvdb commentedYou can use the multilingual variables feature to translate this: http://drupal.org/node/313272
Comment #2
Danny_Joris CreditAttribution: Danny_Joris commentedAh yes, tnx ! :)
Comment #3
Danny_Joris CreditAttribution: Danny_Joris commentedI've made translations for the variable and it seems they are saved to the i18n_variable table correctly, but I don't see any changes in my actual subscription block. Only the original variable is visible in any language even after I changed that original variable too. I flushed all caches. Any idea what I might be doing wrong?
http://www.dannyjoris.be/files/fora/i18n_variable.png
I can't change the original variable either:
http://www.dannyjoris.be/files/fora/emf_list.png
Comment #4
davyvdb CreditAttribution: davyvdb commentedCorrect. My mistake. Forget about my previous solution.
The only way you can do this correctly now, is to do a form alter for the emf_subscription_list_form form. There you can wrap a t() around the string.
Make sure you use the english string in the settings.
Comment #5
Danny_Joris CreditAttribution: Danny_Joris commentedThanks, that worked. This is what I did:
Comment #7
Cyberwolf CreditAttribution: Cyberwolf commentedI think this should be reopened as it's still not possible to translate those texts, without workarounds.
What about integrating with i18n_strings, maybe that's a possible solution?