Closed (fixed)
Project:
Answers
Version:
7.x-3.2
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
9 Aug 2015 at 08:25 UTC
Updated:
8 Dec 2018 at 00:19 UTC
Jump to comment: Most recent
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
Comment #2
tlito commentedComment #3
tlito commentedComment #4
tlito commentedComment #5
chipcleary commentedThanks, updated and committed.
Comment #7
bluegeek9 commented