VirtueMart Forum

VirtueMart 2 + 3 => Language/Translations => Topic started by: thefbi on June 29, 2022, 17:08:42 pm

Title: Translation problem
Post by: thefbi on June 29, 2022, 17:08:42 pm
Hi,
I just update a shop to VM 4.0.2 10661 to a Joomla 3.10.10.
I have some problem with the category module and also the VMuikit (I use Yoothem Pro + VMuikit).

I have 3 languages in my shop. French (as default) + EN + DE.
When i change the language, to DE for example, the title of the VM cat module change, but not the category text. Also, the main category stay in french. All the other part of the site it in DE (cart, other Joomla modules, etc), except the VM cat.

So i dont know if it is related to this update or other.

Any idea ?
Title: Re: Translation problem
Post by: Jumbo! on June 29, 2022, 17:23:08 pm
It is probably a cache issue. Try this.

Open - modules/mod_virtuemart_category/mod_virtuemart_category.php

Find the following codes in line 73:

Code: [Select]
echo $cache->get( array( 'mod_virtuemart_category', 'displayCatsMod' ), array($module, $params, $active_category_id, $category_id, $layout));
Replace the above by:

Code: [Select]
echo $cache->get( array( 'mod_virtuemart_category', 'displayCatsMod' ), array($module, $params, $active_category_id, $category_id, $layout, JFactory::getLanguage()->getTag()));
Now check if it helps.
Title: Re: Translation problem
Post by: thefbi on June 29, 2022, 20:53:19 pm
Thank you, but it dos not solve the problem.
Title: Re: Translation problem
Post by: thefbi on June 30, 2022, 11:23:20 am
I see the same problem in the my account pages. It seem VM will not switch the language. It is a big problem.
Title: Re: Translation problem
Post by: thefbi on June 30, 2022, 13:17:22 pm
In fact, for the categories, it is the titles that do not translate. However, the links of the titles (to the categories) are in the chosen language.
Title: Re: Translation problem
Post by: thefbi on June 30, 2022, 15:10:37 pm
New edit : When i am on the homepage and switch the language, nothing of VM change. But as already said, the links are good. If i click a link, and go to the category view, the left module switch to the good language. The category title on the category view page still in french.

All of that is very strange.

EDIT Again : I have desactivated the url rewrite. I reactivate it = The problem of category left module come back. Even if i click on a link, it still in french. There is a big bug with VM and languages...
Title: Re: Translation problem
Post by: jjk on July 01, 2022, 22:49:40 pm
I don't have a language switching problem with my bilingual shop VM 10658. Which php version do you use? Php 8 can produce problems in language files, which are not updated to the latest versions. In order to make the language files compatible to strict php8, we recently needed to replace a number of placeholders like "%1s", "%2s", %ds" to read "%1$s", "%2$s", "%d$s".
Title: Re: Translation problem
Post by: thefbi on July 02, 2022, 08:34:18 am
Hi,
I use php 7.4.
Title: Re: Translation problem
Post by: jjk on July 02, 2022, 14:13:56 pm
I suppose your multilanguage configuration is not yet complete.
It looks like you didn't rename the htaccess.txt in the root directory to .htaccess yet.

Switching between French and German currently seems to work on your website, but English language configuration is missing one or more settings.
Look at your current urls:
lampedesign.ch/index.php/
lampedesign.ch/index.php/de-de/
lampedesign.ch/index.php/en/

Also have a look at the language settings of the menu modules and the menu item language associations.

Most likely not related to your language switcher problem, but you should also have a look at some errors:
Title: Re: Translation problem
Post by: thefbi on July 02, 2022, 20:56:05 pm
Hello,
Thank you.

How do you know it's lampedesign.ch? I didn't mention it...

For the translations, no, the German doesn't work, I did it manually. I created a custom module with the text links of the categories, since VM doesn't do it.

I did the same with the category page of VMuikit. So in fact, it's a DIY.

For the English, the client hasn't translated the texts yet, so they stay in French, which is normal.

And yes, the .htaccess is there on the server. This site has been working very well for several years without any problems with the translation.

Thanks for the console error, i will try to take a look.
Title: Re: Translation problem
Post by: jjk on July 03, 2022, 19:51:09 pm
How do you know it's lampedesign.ch? I didn't mention it...

I was browsing through your old forum posts to see if you ever posted a link to the site.  ;)

Anyway, looking at it again, I'm pretty sure the custom modules holding the VM category links are related to the problem and probably cause the router/language switcher to fail in certain cases.

I would suggest to use the 'standard' setup for multilingual VM shops. For each language create a menu module holding the VM categories. There should be a one menu item pointing to a VM category, which is set as a top level category, set to 'Default page' = 'Yes'  and 'Show Categories' in the second configuration tab set to 'Yes'. This simulates the old 'VM frontpage' used in very old VM versions. Below that you can create menu items for each individual shop category.

Your frontpage design is pretty similar to my own website kiekebusch.com (using an old template but with VM 4.0.4, not officially released yet), where the language switching works without problems since many years.
Title: Re: Translation problem
Post by: thefbi on July 03, 2022, 20:12:14 pm
OK, thank you.
I have several sites on VM, but indeed for the language problem, it's this one :)

I had not made the custom modules with my text links before having the problem... If that's what you mean.
But I'll try to start from the beginning, according to your idea, and I'll see if it works or not.
Title: Re: Translation problem
Post by: thefbi on July 04, 2022, 09:27:30 am
Hi,

I have now duplicated the site to do my tests. I upgraded to Joomla 4, which is what this is all about. And now, it's even better!

The categories only display the same one! I'm going to pull out my hair soon.

See my screenshots. The categories module (and the links of the categories homepage) have all taken the same link, to a single category. Extraordianary !

PS: I tested by making only menu links in "standard" multilanguage as explained, but it does not change anything.
Title: Re: Translation problem
Post by: thefbi on July 04, 2022, 09:27:59 am
The rest of images...
Title: Re: Translation problem
Post by: thefbi on July 04, 2022, 09:53:23 am
What I'll do now:
- install J4 and VM4 on a new, blank installation.
- Create the multilanguage and test
- IF OK => install Yootheme pro + VMuikit and test
- If OK => see to migrate the database with categories, products, etc

I come back later with reslults
Title: Re: Translation problem
Post by: jjk on July 04, 2022, 11:14:27 am
If you like, I can email you newer VM versions 10686/10687 for testing. But of course I don't know if those cure your problem. The VirtueMart developer (Max) still doesn't recommend using Joomla 4.x with a life shop. In a few days we will have the Joomla 4.0.2 RC and I'm pretty sure it will break some VM code again.
Title: Re: Translation problem
Post by: thefbi on July 04, 2022, 11:37:17 am
After several tries, it seems that the problem appears when I activate VMuikit.
As long as this component is inactive, the translations work with J4, VM4 and Yootheme Pro.

I'm waiting for the next step from the developer of VMuikit...
Title: Re: Translation problem
Post by: thefbi on July 04, 2022, 11:39:34 am
If you like, I can email you newer VM versions 10686/10687 for testing. But of course I don't know if those cure your problem. The VirtueMart developer (Max) still doesn't recommend using Joomla 4.x with a life shop. In a few days we will have the Joomla 4.0.2 RC and I'm pretty sure it will break some VM code again.

OK, thank you, but not for now. I will wait before go to Joomla 4 on this live shop, but i think VM 4 on Joomla 3.x will run ? I have to fix the language issue.
I can wait after for go to J4.
Title: Re: Translation problem
Post by: GJC Web Design on July 04, 2022, 14:12:32 pm
VM4 has always been intended as a bridging version between J3 and J4 so of course it runs seamlessly on J3

please read the release info for versions