Author Topic: [SOLVED] Multilingual: Variants label are not translated  (Read 4637 times)

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3656
  • using Matomo instead of Google Analytics
Re: Multilingual: Variants label are not translated
« Reply #30 on: February 05, 2020, 11:40:46 am »
Just wondering - does VP Framework have it's own override file?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

m.davide82

  • Jr. Member
  • **
  • Posts: 166
Re: Multilingual: Variants label are not translated
« Reply #31 on: February 05, 2020, 14:16:11 pm »
Hi Jorgen,

as I thought, the problem is in the custom field title.

If I insert the variable after the code, it is translated.

Code: [Select]
<span <?php echo $titleClass $title ?>>
          <?php echo vmText::_($field->custom_title) . vmText::_('TEST') .' ' vmText::_('CAMPI_MOBILE'); ?>
</span>

Any idea?


Thank. Davide

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4341
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Multilingual: Variants label are not translated
« Reply #32 on: February 05, 2020, 18:41:03 pm »
Try to use trim to be sure you have no special char
Code: [Select]
vmText::_(trim($field->custom_title));

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 500
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Multilingual: Variants label are not translated
« Reply #33 on: February 05, 2020, 19:10:16 pm »
If you constantly insist on this version and want to use this functionality that I only used in conjunction with CustomField4All -

there is no problem in the order of triggering individual triggers:
- rendering value customfiled_title
- call translation function (vmtext,  JTEXT)
???

For me, I would be the first (before writing on the forum) to test using the right Joomla function JTEXT.

Replacing all internal Joomla functions with their own "hooray now all VM instead of Joomla" may not always be required and useful (maybe for a standalone application installed subsequently on WordPress - once Virtuemart was already a standalone application - PS_SHOP).

Only then would I wonder how to render the content of customfield_title before calling the vmTEXT function respectively. JTEXT.

If I still fail here, I would ask here or return to the proven and functional method of using the CustomField4All plugin.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

m.davide82

  • Jr. Member
  • **
  • Posts: 166
Re: Multilingual: Variants label are not translated
« Reply #34 on: February 05, 2020, 21:00:10 pm »
Try to use trim to be sure you have no special char
Code: [Select]
vmText::_(trim($field->custom_title));

Hi,

thank you very much, finally it works!!!

Probably the best will be to resolve this in VM core.


Thanks a lot,
Davide


m.davide82

  • Jr. Member
  • **
  • Posts: 166
Re: Multilingual: Variants label are not translated
« Reply #35 on: February 05, 2020, 21:02:12 pm »
If you constantly insist on this version and want to use this functionality that I only used in conjunction with CustomField4All -

there is no problem in the order of triggering individual triggers:
- rendering value customfiled_title
- call translation function (vmtext,  JTEXT)
???

For me, I would be the first (before writing on the forum) to test using the right Joomla function JTEXT.

Replacing all internal Joomla functions with their own "hooray now all VM instead of Joomla" may not always be required and useful (maybe for a standalone application installed subsequently on WordPress - once Virtuemart was already a standalone application - PS_SHOP).

Only then would I wonder how to render the content of customfield_title before calling the vmTEXT function respectively. JTEXT.

If I still fail here, I would ask here or return to the proven and functional method of using the CustomField4All plugin.

Before to write I tested JText, but the result was the same.
If you have a website with more than 10.000 products, you can't change all the custom fields, trust me.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4341
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: [SOLVED] Multilingual: Variants label are not translated
« Reply #36 on: February 05, 2020, 23:08:44 pm »
if it work with trim, then you have hidden special char in your custom_title

m.davide82

  • Jr. Member
  • **
  • Posts: 166
Re: [SOLVED] Multilingual: Variants label are not translated
« Reply #37 on: February 06, 2020, 10:26:19 am »
Hi,

it's very strange, I checked everything...
I deleted all the strings from override, I inserted just one string and it wasn't working...

Have a nice day,
Davide

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2855
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: [SOLVED] Multilingual: Variants label are not translated
« Reply #38 on: February 06, 2020, 19:45:53 pm »
There are a a lot of installs that do not need trim. If You don´t insert space characters in Your language keys, You simply do not need the extra trim call. Checking the strings for strange characters, spaces and syntax errors would probably do the trick.

Jörgen @ Kreati Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 500
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: [SOLVED] Multilingual: Variants label are not translated
« Reply #39 on: February 07, 2020, 17:51:02 pm »
Quote
If you have a website with more than 10.000 products, you can't change all the custom fields, trust me.

I trust You, we have eshops with 220 000 products :)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates