- Posts: 5
- Thank you received: 0
Duplicate instances of JLanguage
- virtualmotorpix
-
Topic Author
- Offline
Less
More
10 years 7 months ago #230501
by virtualmotorpix
Best regards,
Steffan Harris
Virtual Motorpix
Duplicate instances of JLanguage was created by virtualmotorpix
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5.9
-- Browser(s) name and version -- : N/A
Hi,
When I visit many pages I see missing translations, for example:
/administrator/index.php?option=com_config&view=component&component=com_hikashop
I added "xdebug_call_class()" to the JLanguage constructor and two instances are being created, one inside the "JLanguage" class and one inside the "hikaShopLanguage" class. There should only be a single instance of the class in the application.
When "JText::_("JLIB_RULES_SETTINGS_DESC")" is called then it is looking at the last instance, created within hikaShopLanguage, and cannot find the translation because it was loaded in the first instance, which was created inside the Joomla application.
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5.9
-- Browser(s) name and version -- : N/A
Hi,
When I visit many pages I see missing translations, for example:
/administrator/index.php?option=com_config&view=component&component=com_hikashop
I added "xdebug_call_class()" to the JLanguage constructor and two instances are being created, one inside the "JLanguage" class and one inside the "hikaShopLanguage" class. There should only be a single instance of the class in the application.
When "JText::_("JLIB_RULES_SETTINGS_DESC")" is called then it is looking at the last instance, created within hikaShopLanguage, and cannot find the translation because it was loaded in the first instance, which was created inside the Joomla application.
Best regards,
Steffan Harris
Virtual Motorpix
Please Log in or Create an account to join the conversation.
10 years 7 months ago #230507
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Duplicate instances of JLanguage
Hi,
If you take a look at the code of hikaShopLanguage, you'll see that the class is copying old strings into his object.
That class allows HikaShop to reload Override files into Joomla ; because in Joomla when you dynamically change the language (like to send an email in another language that the user one), the overrides are not reloaded so you can an email (or a page) with partial correct content.
The class we made is there to create that bridge and it keep all what the previous language class have loaded and done.
Regards,
If you take a look at the code of hikaShopLanguage, you'll see that the class is copying old strings into his object.
That class allows HikaShop to reload Override files into Joomla ; because in Joomla when you dynamically change the language (like to send an email in another language that the user one), the overrides are not reloaded so you can an email (or a page) with partial correct content.
The class we made is there to create that bridge and it keep all what the previous language class have loaded and done.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: virtualmotorpix
Please Log in or Create an account to join the conversation.
- virtualmotorpix
-
Topic Author
- Offline
Less
More
- Posts: 5
- Thank you received: 0
10 years 7 months ago #230711
by virtualmotorpix
Best regards,
Steffan Harris
Virtual Motorpix
Replied by virtualmotorpix on topic Duplicate instances of JLanguage
Hi Jerome,
Thanks, that's led me on the right track and now I can see one of my system plugins that includes "helper.php" is causing the clash. I have disabled the plugin and the languages now load correctly.
Thanks, that's led me on the right track and now I can see one of my system plugins that includes "helper.php" is causing the clash. I have disabled the plugin and the languages now load correctly.
Best regards,
Steffan Harris
Virtual Motorpix
Please Log in or Create an account to join the conversation.
Time to create page: 0.166 seconds