Modal form field validation message not translated - Joomla! Forum - community, help and support


using com_helloword example, added field config.xml requires entry of correctly formatted email address.

code: select all

<field
   name="email"
   type="email"
   label="com_helloworld_helloworld_field_email_label"
   description="com_helloworld_helloworld_field_email_desc"
   default=""
   validate="email"
   message="com_helloworld_helloworld_field_email_invalid"
/>

the following definitions added en-gb.com_helloworld.ini file.

code: select all

com_helloworld_helloworld_field_email_desc="enter correctly formatted email address."
com_helloworld_helloworld_field_email_label="email address"
com_helloworld_helloworld_field_email_invalid="email address incorrectly formatted."

screenshot result of entering incorrectly formatted email address.
image

if message parameter removed field definition, joomla attempts display name of field.
image

i used jdump extension examine contents of $lang @ line 133 of libraries/joomla/methods.php
image

seems com_helloworld's language files haven't been included field validation process.

this problem doesn't occur if same field used in xml file plugin's options.

found solution.

i created custom email validation rule , added following code test function in order reload language file(reference).

code: select all

$request = jrequest::get();
$extension = $request['component'];
$base_dir = jpath_administrator;
$lang =& jfactory::getlanguage();
$language_tag = $lang->gettag();
$reload = true;
$lang->load($extension, $base_dir, $language_tag, $reload);

is bug, did need create custom rule re-load language file, or matter of me not understanding complexities of language file utilization?





Comments