VirtueMart Forum

VirtueMart 2 + 3 + 4 => Language/Translations => Topic started by: sandomatyas on November 04, 2017, 09:35:41 AM

Title: English strings in customer mail
Post by: sandomatyas on November 04, 2017, 09:35:41 AM
I run a Hungarian webshop which uses Hungarian language only, latest Joomla and Virtuemart and Rupostel's OPC.
It works well but when I order something the confirmation mail is half Hungarian and half English
English words are the user fields titles (City, Address, Phone, etc), the product headers (SKU, Price, Qty) except the "product name", the "total" title, order status and Page 1/1. Every other strings are Hungarian.
OPC extensions allows append order details information to the thank you page, the same strings are also English but when I check my order details again, everything is Hungarian.
I tried to disable every Rupostel plugins, remove all template overrides but I got the very same problem.
I also tried to install another language (German) to check if the language files have any error but got the same result.
Here is a screenshot: https://snag.gy/W5X9gp.jpg

Any idea?
Title: Re: English strings in customer mail
Post by: jjk on November 04, 2017, 13:42:22 PM
I can see only an empty Snaggy page following your link. Which versions of Joomla and VM?
Title: Re: English strings in customer mail
Post by: Studio 42 on November 04, 2017, 18:01:08 PM
Vm version ?
Title: Re: English strings in customer mail
Post by: sandomatyas on November 07, 2017, 14:25:01 PM
Joomla 3.8.1, VM 3.2.4
The corrected screenshot: https://snag.gy/EyD7bq.jpg
Title: Re: English strings in customer mail
Post by: jflash on November 07, 2017, 15:00:33 PM
I have same issue. Language string overwrite under Joomla was my solution :) Joomla 3.8.1 and VM 3.2.4 (under 3.2.2 was same).
Title: Re: English strings in customer mail
Post by: Studio 42 on November 08, 2017, 00:43:40 AM
sandomatyas, do you changed the default field names?
Check administrator/index.php?option=com_virtuemart&view=userfields and open your field
Eg. email field title should be COM_VIRTUEMART_REGISTER_EMAIL
Title: Re: English strings in customer mail
Post by: sandomatyas on November 08, 2017, 13:03:22 PM
I use language constas everywhere.
But when I open the order from the link which is in the mail VM displays it correctly. It's only in the mail.
Title: Re: English strings in customer mail
Post by: Studio 42 on November 08, 2017, 18:29:11 PM
Have you check the settings in the VIrtuemart config about language in email ?
VIrtuemart config>email>Invoice in user language
Title: Re: English strings in customer mail
Post by: sandomatyas on November 10, 2017, 07:17:14 AM
I tried both ways even with/without login
Title: Re: English strings in customer mail
Post by: jjk on November 10, 2017, 17:22:39 PM
Did you try Joomla's 'Debug language' on that page already? It should list the problems in your language files.
Title: Re: English strings in customer mail
Post by: sandomatyas on November 24, 2017, 16:02:06 PM
yep, but it's half Hungarian half  English?
You can try it yourself, I built a very basic site (Joomla! 3.8.2 and VM 3.2.6) with one category and one product
http://vmlang.tk
After you place an order also the confirm message is half english: https://snag.gy/jucbyW.jpg
Title: Re: English strings in customer mail
Post by: Studio 42 on November 24, 2017, 21:24:11 PM
I had a problem on my own plugin loading language,
It seems that if you dont force language, this get not loaded anymore in Joomla 3.8.2(it was not the case in the releases before)
Eg if you load 2 language files

            $lang->load($name, $path,en-GB);
            $lang->load($name, $path);
the default language is not loaded anymore, but only en-GB.
I think it was not the case before in Joomla.
Now
            $lang->load($name, $path);
fallback to english i think.

Note that i have not do more test, but i had the problem adding en-GB and default, so perhaps language handle changed in Joomla ?
Title: Re: English strings in customer mail
Post by: sandomatyas on November 24, 2017, 21:42:47 PM
It seems disabling **Use english as fallback for untranslated strings** solved the problem, but in this case I get language strings if there is a missing translation and there are strings which aren't in transifex yet (e.g. COM_VM_CFG_ORDERTRACKING)
------------------------------------------
update: it helped on my demo site but not on the live site, so I'm a bit clueless
Title: Re: English strings in customer mail
Post by: Studio 42 on November 25, 2017, 02:55:29 AM
Have you try to activate language debug in Joomla, to check if you have problems in your language.ini files ?
You get a report on the bottom with loaded files and errors.
Title: Re: English strings in customer mail
Post by: sandomatyas on November 25, 2017, 05:51:13 AM
yes and no errors
---------------
update: I was able to get proper message once when language debug was enabled but not after I turned off
Title: Re: English strings in customer mail
Post by: sandomatyas on January 19, 2018, 14:33:55 PM
I updated all of my extensions and the problem is still there, so I tried to debug a bit and found static public function loadOrderLanguages($language = 0) in shopFunctionsF helper
When I switch $cache = true to $cache = false everything works fine. So maybe there are something around language caching ?
Title: Re: English strings in customer mail
Post by: jjk on January 19, 2018, 15:14:11 PM
Should be fixed meanwhile, maybe since VM 3.2.8. I don't see that problem anymore since that version was running on my website. Current public version is 3.2.12.
http://dev.virtuemart.net/projects/virtuemart/repository/changes/branches/com_virtuemart.3.0.12.4/components/com_virtuemart/helpers/shopfunctionsf.php
Title: Re: English strings in customer mail
Post by: sandomatyas on January 19, 2018, 16:25:48 PM
The site uses VM 3.2.12
Title: Re: English strings in customer mail
Post by: Studio 42 on January 19, 2018, 17:34:12 PM
JJK, Joomla changed the way language is loaded since 3.8 i think.
Now it always load 2 languages Current language+Default language, i explained this in another answer.
Problem is that when you debug Joomla language, only Current language is loaded, so when you activate lang DEBUG in Joomla all works perfectly.
I'm pretty sure the problems is from here. Because if you have some missing string, this are set from english.
So the english and current language need to have 100% same KEYs else it not work anymore as in Joomla 3.7 and before.
I don't have do many test, but have same problems with my own extentions., it's not specific to Virtuemart .
Title: Re: English strings in customer mail
Post by: jjk on January 19, 2018, 18:53:38 PM
Did you try to enable 'No Fallback' in the VM Configuration > 'Language  Settings' already? (In my case I don't have mixed language strings in the order emails. Mine is set to disabled)