I am using i18n, my multilingual site needs Answers module to be translated.

please add t() to lines 224:

$form['actions']['submit']['#value'] = (!isset($form_state['node']->nid) || isset($form_state['node']->is_new)) ? $create_text : $edit_text;

and 247

$form['actions']['submit']['#value'] = (!isset($form_state['node']->nid) || isset($form_state['node']->is_new)) ? $create_text : $edit_text;

now i solved using my theme hooks on template.php:

<?php
function MYtheme_form_question_node_form_alter(&$form, &$form_state) {
  if (module_exists('answers')) {
	  $create_text = variable_get('answers_question_create_button_text', t('Ask Your Question'));
      $edit_text = variable_get('answers_question_edit_button_text', t('Update Your Question'));
	  $form['actions']['submit']['#value'] = (!isset($form_state['node']->nid) || isset($form_state['node']->is_new)) ? t($create_text) : t($edit_text);
  }
}


function MYtheme_form_answer_node_form_alter(&$form, &$form_state) {
  if (module_exists('answers')) {
     $create_text = variable_get('answers_answer_create_button_text', t('Post Your Answer'));
     $edit_text = variable_get('answers_answer_edit_button_text', t('Update Your Answer'));
     $form['actions']['submit']['#value'] = (!isset($form_state['node']->nid) || isset($form_state['node']->is_new)) ? t($create_text) : t($edit_text);
  }
}
?>

after this i open nodes add and edit pages and after that i've found string in translations interface: admin/config/regional/translate/translate

Comments

tlito created an issue. See original summary.

tlito’s picture

Issue summary: View changes
tlito’s picture

Issue summary: View changes
tlito’s picture

Issue summary: View changes
chipcleary’s picture

Assigned: Unassigned » chipcleary
Status: Needs work » Needs review

Thanks, updated and committed.

  • chipcleary committed 87ebd33 on 7.x-3.x
    Issue #2548247 by tlito, chipcleary: Capture strings using t() for...
bluegeek9’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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