Download & Extend

Translating the string in the subscription block

Project:E-mail Marketing Framework
Version:6.x-1.3
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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

#1

Status:active» fixed

You can use the multilingual variables feature to translate this: http://drupal.org/node/313272

#2

Ah yes, tnx ! :)

#3

I'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

#4

Correct. 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.

#5

Thanks, that worked. This is what I did:

<?php
/**
* Implementation of hook_form_alter()
*/

function custom_form_alter(&$form, $form_state, $form_id) {
   
  if (
$form['#id'] == 'emf-subscription-list-form') {
     
$form['action_long']['#value'] = t('Feel free to subscribe to our newsletter if you want to be kept up to date.');
   
//print dsm($form);
 
}

}
?>

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#7

Status:closed (fixed)» active

I 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?