Hi there!
I am experiencing a cruel doubt on how add new language definition item...
What I am trying to do is insert new field in account create form.
Sor far I followed these steps bellow:
1) Hook up my code to create a new field into fields array then calling batchAssign, as follows:
public function onControllerPagesAccountCreate_UpdateData()
{
$that = $this->baseObject;
$form = new AForm();
$form->setForm(array ('form_name' => 'AccountFrm'));
$that->data['form']['fields']['general']['teste'] = $form->getFieldHtml(
array (
'type' => 'input',
'name' => 'teste',
'value' => $that->request->post['teste'],
'required' => true)
);
$that->view->batchAssign($that->data);
$that->processTemplate('pages/account/create.tpl');
}
2) So far, so good. When I reloaded the create account page, the 'teste' field showed up... But for my surprise with no caption text!
>>> See image attached
3) Ok, I learned that I need to insert new language definition under System > Localization menu at Admin page, but there is a catch...
The question is: I am developing a new extension and how do I provide that new language definition at my extension's installation?
I tried to create a new xml file under extensions/myextensionname/language/english/account/create.xml as follows, but it did not work.
<?xml version="1.0"?>
<definitions>
<definition>
<key>entry_teste</key>
<value><![CDATA[Teste Field:]]></value>
</definition>
<definition>
<key>error_teste</key>
<value><![CDATA[O campo Teste é obrigatório!]]></value>
</definition>
</definitions>
Any ideas?
Thanks,
Renato