Hello,
I created multilingual constant for each name of the variant and I inserted the translation in the override are, but this name isn't translated.
Screen in attachment.
Why? A big?
Thanks.
Davide
What VM version, PHP version, Joomla version ?
Using custom template ?
In what view ?
Jörgen @ Kreativ Fotografi
Hi Jörgen,
Virtuemar 3.6.1
Php 7.2
Joomla 3.9.14
Product view
Template VP_Smart, but the problem persists with beez too.
Thanks a lot.
Davide
Have you entered the translation using joomla or directly in the override file ?
If you do a syntax error in the file, nothing is translated.
I created directly the file.
The other translations are working, only that ones of the custom fields not.
This is the syntax:
CAMPI_QUARTO_SPLIT="cuarto split"
CAMPI_TERZO_SPLIT="tercer split"
CAMPI_SECONDO_SPLIT="segundo split"
Thanks.
Davide
Try to use the Joomla extentions > language(s)> susbstitution to add the translation.
If should work here, if you selet the right language
Hi,
tested now, same problem.
Thanks,
Davide
Is this generic variant or multi-variant customfield type ?
They are simple "string".
If it's a generic 'string' type variant, did you set it to 'Published' in the custom field list?
Did you add the translation to both files? Overwriting Administration and Frontend?
@jjk
Yes, it's published.
@Ventsi Genchev
Sure, I did it, but no results.
??? You have this in the language file:
QuoteCAMPI_QUARTO_SPLIT="cuarto split"
CAMPI_TERZO_SPLIT="tercer split"
CAMPI_SECONDO_SPLIT="segundo split"
But you miss these translations:
QuoteCAMPI_COLORE_DEL_MOBILE
CAMPI_COLONNA_140x35x20
Or am I missing something ?
Jörgen @ Kreativ Fotografi
Hi Jörgen,
no no, the translation are present, it was just an example...
Thanks.
Davide
Did you enable and checked the output of Joomla 'Debug Language' already? If there is a parsing error in your language override file, it can stop loading before it reaches the custom variant labels.
Until today, I thought Virtuemart core should not translate customfiled values and I must always use the Customfield4All plugin from BreakDesign.
According to the discussion, it looks like it's a bug in Virtuemart?
Quote from: pinochico on January 18, 2020, 07:14:58 AM
According to the discussion, it looks like it's a bug in Virtuemart?
I don't think so. I've been using core VM custom fields in my shop since many years, including latest version.
See: http://forum.virtuemart.net/index.php?topic=96758.msg318220#msg318220 (http://forum.virtuemart.net/index.php?topic=96758.msg318220#msg318220)
Hi to everybody,
just tested everything, debug included, but the overrides are working for everything, but not for the custom fields.
Any help please?
Thanks.
Davide
Try to put this strings into your languagefile xx-XX.com_virtuemart.ini and just in case do it in admin and site languagefiles. Is it working this way?
Hi,
just tested, but the answer is NO.
It's not working.
Can you post screenshots of a custom field settings and of the 'Product [Edit] custom fields tab of a product to which you have assigned the custom field?
Hi jjk,
sure, please see the attachments.
Thanks.
Davide
I just tested the label translation with the settings from your screenshots in VM 3.6.11 build number 10238 (without finetuning the display for my template). It works in my case. See images attached. Note that the '0.00 €' is the translation of 'no additional charge' in my german language file. Also I didn't create a language key to translate the value (your 'Si')
When you enable 'Debug Language' in Joomla, does it really show now parsing errors in a language file?
Hi Jjk,
in debug language...
For that variables I see ?? instead off **.
Please see the attachment.
Any idea?
Thanks.
Davide
Quote from: m.davide82 on January 29, 2020, 09:04:34 AM
Hi Jjk,
in debug language...
For that variables I see ?? instead off **.
This mean that you have an error in the language file.
Try to remove or rename old override file and enter only 1 translation in the back-end and check if it work.
The question marks mean that the string is translatable but no match was found in the language definition file. In this case I suppose that Davide didn't enter a language key in the VM custom field value. In one of the examples above there should be something like:
In the VM custom field selected as the custom field type in the 'Custom Field' tab of the product: CAMPI_TEMPORIZZATORE
In the VM custom field value: CAMPI_TEMPORIZZATORE_VALUE_YES
Both language keys/strings have to be added to the site language override files (English/Italian).
So the override for the custom value field should be for example: CAMPI_TEMPORIZZATORE_VALUE_YES="Yes"
Hi,
I inserted just the:
CAMPI_TEMPORIZZATORE="Temporizzatore"
The dropdown results for the moment can be in english.
Thanks.
Davide
Any idea on how can I solve it?
Thanks.
Davide
Hi,
I just did anothet test.
I created another language variable, I inserted it near the custom field title and it is translated.
<div class="product-fields-title-wrapper">
<span <?php echo $titleClass . $title ?>> <?php echo vmText::_($field->custom_title) . vmText::_('TEST') ?> </span>
</div>
So, the problem is in the custom field title code.
Why I'm not able to translate this dynamic part? $field->custom_title
Thanks.
Davide
THE problem lies in THE text string. Are you Syre that you have No hidden characters and correct syntax for the customs field data. Place THE key string immediately arter THE custom field language string and try again.
IF THE custom field string is outputted it Will get translated only IF THE syntax is correct. Check for extra characters.
Jörgen
Just wondering - does VP Framework have it's own override file?
Hi Jorgen,
as I thought, the problem is in the custom field title.
If I insert the variable after the code, it is translated.
<span <?php echo $titleClass . $title ?>>
<?php echo vmText::_($field->custom_title) . vmText::_('TEST') .' ' . vmText::_('CAMPI_MOBILE'); ?>
</span>
Any idea?
Thank. Davide
Try to use trim to be sure you have no special char
vmText::_(trim($field->custom_title));
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.
Quote from: Studio 42 on February 05, 2020, 18:41:03 PM
Try to use trim to be sure you have no special char
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
Quote from: pinochico 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.
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.
if it work with trim, then you have hidden special char in your custom_title
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
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
QuoteIf 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 :)