Language string not translated

  • Posts: 22
  • Thank you received: 0
11 years 6 months ago #109384

Hello,

Can you please tell me where i can find a solution for the folowing problem?

I created a custom field "Antibacterieel" in de product table, with a single dropdown field type.
The dropdown list has two values, where the labels (HIKASHOP_YES, HIKASHOP_NO) has to be translated from the language file.
In the picture "custom_field_language_string.jpg", you can see by Preview, that the value HIKASHOP_YES is translated into "Yes"

Then I created a custom filter of the type radio button, and use it in combination of the custom field "Antibacterieel"
In the picture "custom_filter_language_string.jpg" you can see the settings.

When i use this filter on a category page, the language string are not translated coresponding the chosen language.
See picture "Language_string_not_translated.jpg"

Can you please tell me what I do wrong?

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 6 months ago #109471

Hi there,

THis is indeed something which was not handled.
To fix it, edit the file filter.php (in administrator/components/com_hikashop/classes) and replace this line:

$html.='<span class="hikashop_filter_checkbox">'.$input.'<label for="field_'.$filter->filter_id.'_'.$key.'_'.$divName.'">'.$val[1].'</label>'.$deleteButton.'</span>'.$br;

By this one:
$html.='<span class="hikashop_filter_checkbox">'.$input.'<label for="field_'.$filter->filter_id.'_'.$key.'_'.$divName.'">'.JText::_($val[1]).'</label>'.$deleteButton.'</span>'.$br;

It should solve the problem :)

The following user(s) said Thank You: Rebo2k

Please Log in or Create an account to join the conversation.

  • Posts: 22
  • Thank you received: 0
11 years 6 months ago #109495

Hi Eliot,

Thaks for the solution, the problem is solved.

René

Please Log in or Create an account to join the conversation.

  • Posts: 22
  • Thank you received: 0
11 years 6 months ago #109518

Hi Eliot,

After further testing, I came to the conclusion, that there are multiple translation errors in the file fillter.php.

Useful to mention this right away, or sent a completely new file without the errors.

This cost me extra time, while that was not necessary :(

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 6 months ago #109527

Hi René,

Could be more precise about the errors you encounter?

Please Log in or Create an account to join the conversation.

  • Posts: 22
  • Thank you received: 0
11 years 6 months ago #109534

Hi Eliot,

Line 755:
$html.='> <a class="hikashop_filter_list_selected" style="font-weight:bold">'.JText::_($val[1]).'</a>, ';

Line 1252:
$html.='<OPTION '.$selectedItem.' name="'.$filter->filter_data.'" value="'.$val[0].'">'.JText::_($val[1]).'</OPTION>';

Line 1403:
$html.='<span class="hikashop_filter_checkbox">'.$input.'<label for="field_'.$filter->filter_id.'_'.$key.'_'.$divName.'">'.JText::_($val[1]).'</label>'.$deleteButton.'</span>'.$br;

Line 1529:
$html.='> <a class="hikashop_filter_list_selected" style="font-weight:bold">'.JText::_($val[1]).'</a>';

Line 1532:
$html.='> <a class="hikashop_filter_list" onclick="document.getElementById(\'filter_'.$filter->filter_namekey.'_'.$divName.'\').value=\''.$val[0].'\'; document.forms[\'hikashop_filter_form_'.$divName.'\'].submit();">'.JText::_($val[1]).'</a>'.$br;

I have also a translation problem in the back-end.
If I create, or edit a product, and the product has a custom field, in this case a single dropdown, the label is not translated.

After i fixed the $val[1] into JText::_($val[1]), I don't have the translation problem anymore at the front-end.

Attachments:
Last edit: 11 years 6 months ago by Rebo2k.

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 6 months ago #109543

Sorry about the errors, I just fixed it so it works in you case, I was working on the other custom fields possibilities. My bad.
For the backend translation issue, I can't reproduce it. Did you placed the translation in the Hikashop file language?

Please Log in or Create an account to join the conversation.

  • Posts: 22
  • Thank you received: 0
11 years 6 months ago #109550

No problem.

Yes I put the translation strings in the Hikashop "Dutch" language file, in the override section.

Since I'm testing in the English language, that makes it easier for me to make snapshot's for you to understand the problem, I forgot to add the language strings in the "English" language file :huh:

Thanks for your help :)

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 6 months ago #109551

Glad to see you found a solution!
and thanks for reporting this bug ;)

The following user(s) said Thank You: Rebo2k

Please Log in or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum