- Posts: 22
- Thank you received: 0
Language string not translated
13 years 3 months ago #109384
by Rebo2k
Language string not translated was created by Rebo2k
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?
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?
Please Log in or Create an account to join the conversation.
13 years 3 months ago #109471
by Eliot
Replied by Eliot on topic Language string not translated
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:
By this one:
It should solve the problem
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:
Code:
$html.='<span class="hikashop_filter_checkbox">'.$input.'<label for="field_'.$filter->filter_id.'_'.$key.'_'.$divName.'">'.$val[1].'</label>'.$deleteButton.'</span>'.$br;
By this one:
Code:
$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.
13 years 3 months ago #109495
by Rebo2k
Replied by Rebo2k on topic Language string not translated
Hi Eliot,
Thaks for the solution, the problem is solved.
René
Thaks for the solution, the problem is solved.
René
Please Log in or Create an account to join the conversation.
13 years 3 months ago #109518
by Rebo2k
Replied by Rebo2k on topic Language string not translated
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
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.
13 years 3 months ago #109527
by Eliot
Replied by Eliot on topic Language string not translated
Hi René,
Could be more precise about the errors you encounter?
Could be more precise about the errors you encounter?
Please Log in or Create an account to join the conversation.
13 years 3 months ago - 13 years 3 months ago #109534
by Rebo2k
Replied by Rebo2k on topic Language string not translated
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.
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.
Last edit: 13 years 3 months ago by Rebo2k.
Please Log in or Create an account to join the conversation.
13 years 3 months ago #109543
by Eliot
Replied by Eliot on topic Language string not translated
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?
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.
13 years 3 months ago #109550
by Rebo2k
Replied by Rebo2k on topic Language string not translated
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
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.
13 years 3 months ago #109551
by Eliot
Replied by Eliot on topic Language string not translated
Glad to see you found a solution!
and thanks for reporting this bug
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.364 seconds