[Skip to main content](#vessel-content)

#   Duplicate instances of JLanguage

##

- **[virtualmotorpix](/forum/user/17252-virtualmotorpix "View virtualmotorpix's Profile")**
- [![virtualmotorpix's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/17252-virtualmotorpix "View virtualmotorpix's Profile") Topic Author
- [ Offline](/forum/user/17252-virtualmotorpix)

Less More

- Posts: 5
- Thank you received: 0
-
-

10 years 9 months ago [\#230501](#230501) by [virtualmotorpix](/forum/user/17252-virtualmotorpix "View virtualmotorpix's Profile")  *[Duplicate instances of JLanguage](/forum/3-bug-report/882422-duplicate-instances-of-jlanguage#230501 "-- 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&#95;config&amp;view=component&amp;component=com&#95;hikashop  I added &quot;xdebug&#95;call&#95;class()&quot; to the JLanguage constructor and two instances are being created, one inside the &quot;JLanguage&quot; class and one inside the &quot;hikaShopLanguage&quot; class. There should only be a single instance of the class in the application.  When &quot;JText::&#95;(&quot;JLIB&#95;RULES&#95;SETTINGS&#95;DESC&quot;)&quot; 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.")* was created by *[virtualmotorpix](/forum/user/17252-virtualmotorpix "View virtualmotorpix's Profile")*

-- 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&amp;view=component&amp;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

- [ ![Screenshot&#95;from&#95;2016-02-18&#95;104421.png](/forum/attachment/29613) ](/forum/attachment/29613 "...-18&#95;104421.png") [ ](/forum/attachment/29613?download=1 "...-18&#95;104421.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODI0MjItZHVwbGljYXRlLWluc3RhbmNlcy1vZi1qbGFuZ3VhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 9 months ago [\#230507](#230507) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Duplicate instances of JLanguage](/forum/3-bug-report/882422-duplicate-instances-of-jlanguage#230507 "-- 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&#95;config&amp;view=component&amp;component=com&#95;hikashop  I added &quot;xdebug&#95;call&#95;class()&quot; to the JLanguage constructor and two instances are being created, one inside the &quot;JLanguage&quot; class and one inside the &quot;hikaShopLanguage&quot; class. There should only be a single instance of the class in the application.  When &quot;JText::&#95;(&quot;JLIB&#95;RULES&#95;SETTINGS&#95;DESC&quot;)&quot; 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.")*

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,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [virtualmotorpix](/forum/user/17252-virtualmotorpix "View virtualmotorpix's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODI0MjItZHVwbGljYXRlLWluc3RhbmNlcy1vZi1qbGFuZ3VhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[virtualmotorpix](/forum/user/17252-virtualmotorpix "View virtualmotorpix's Profile")**
- [![virtualmotorpix's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/17252-virtualmotorpix "View virtualmotorpix's Profile") Topic Author
- [ Offline](/forum/user/17252-virtualmotorpix)

Less More

- Posts: 5
- Thank you received: 0
-
-

10 years 9 months ago [\#230711](#230711) by [virtualmotorpix](/forum/user/17252-virtualmotorpix "View virtualmotorpix's Profile")  Replied by *[virtualmotorpix](/forum/user/17252-virtualmotorpix "View virtualmotorpix's Profile")* on topic *[Duplicate instances of JLanguage](/forum/3-bug-report/882422-duplicate-instances-of-jlanguage#230711 "-- 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&#95;config&amp;view=component&amp;component=com&#95;hikashop  I added &quot;xdebug&#95;call&#95;class()&quot; to the JLanguage constructor and two instances are being created, one inside the &quot;JLanguage&quot; class and one inside the &quot;hikaShopLanguage&quot; class. There should only be a single instance of the class in the application.  When &quot;JText::&#95;(&quot;JLIB&#95;RULES&#95;SETTINGS&#95;DESC&quot;)&quot; 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.")*

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.

---

Best regards,

Steffan Harris
Virtual Motorpix

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODI0MjItZHVwbGljYXRlLWluc3RhbmNlcy1vZi1qbGFuZ3VhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.062 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
