(solved) Translate (user) Custom Text Value

  • Posts: 101
  • Thank you received: 12
11 years 5 months ago #103398

Hi,

I added a custom text field for the table USER to show some text under the VAT-box.
I want to punt something like: (in case you don’t have a VAT n°, please indicate **)
This should appear under the VAT-box.

I initially didn't fill in the name of the label because I DON'T want to display the label, just the value of it, because the value is aligned under the vat-box (see picture)



The problem is now how to translate this value.
I have no problems translating the other TYPES of custom fields like TEXT, TEXTAREA, RADIOBUTTONS with Falang.
Just this CUSTOMTEXT field doesn't want to be translated.

(Even when I use a the label, the label get's translated but not the value)

I also tried to put a value like #VATMSG# and then NOT use Falang but the translation override in Hikashop configuration.

Thanks!!!

PS: If there is a way to show the Label under the VAT-box than that would solve the problem too and I won't need to translate the value just the label. But labels are TD class=key and I'm not sure how to make it appear under the VAT-box

Last edit: 11 years 5 months ago by SG.

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

  • Posts: 82727
  • Thank you received: 13343
  • MODERATOR
11 years 5 months ago #103435

Hi,

The custom text type custom fields do not handle translations.
Actually you're the first one who asked for it.

Edit the file administrator/components/com_hikashop/classes/field.php and change the line:

return @$field->field_options['customtext'];
to:
return $this->trans(@$field->field_options['customtext']);

and the if you enter a translation key like MY_TEXT in the value of the custom field, you can then translate it in each translation file override with such line:
MY_TEXT=" the text I want to add"

www.hikashop.com/en/download/languages.html#modify

Last edit: 11 years 5 months ago by nicolas.
The following user(s) said Thank You: SG

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

  • Posts: 30
  • Thank you received: 1
10 years 10 months ago #136821

hi nicolas.. i need to transalte custom field too, but cant find that line of code..

its still there??

thanks

update
ok i got it.. its working

Last edit: 10 years 10 months ago by adambako.

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

Time to create page: 0.067 seconds
Powered by Kunena Forum