?
avatar durgesh4
durgesh4
18 Oct 2014

Steps to reproduce the issue

Use Joomla.JText._('LANGUANGE_CONSTANT') in any of the the js file
Include the file in the components view

Also use the JLoader import for replacing the language constant
& call the specified function
foe eg.

// Import helper for declare language constant
JLoader::import('ExampleFrontendHelper', JUri::root().'components/com_example/helpers/example.php');
// Call helper function
ExampleFrontendHelper::getLanguageConstant();

Enable the Mootools for the enable template & check the language constant working properly
Disable the mootools for the template & check the language constant not replaced properly.

Expected result

It should also be working with the Mootools disbaled.

Actual result

Not working without mootols

System information (as much as possible)

Additional comments

IS it necessary to enable mootools for using Joomla language constant in the js files?

avatar durgesh4 durgesh4 - open - 18 Oct 2014
avatar durgesh4 durgesh4 - change - 18 Oct 2014
The description was changed
avatar wilsonge
wilsonge - comment - 19 Oct 2014

Yes it is necessary to have mootools for this. There are still (an ever decreasing number of) areas of javascript in the CMS that require mootools unfortunately and this is one of them!

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4839.

avatar dgt41
dgt41 - comment - 19 Oct 2014

Try to load core.js. The script that does the conversion is pretty vanilla BUT requires Joomla variable. I use it like this and it works here!

avatar dgt41
dgt41 - comment - 22 Oct 2014

@wilsonge I am trying to figure out why this is happening looking at joomla/language/… and document/html/renderer/head.php
But I get nowhere. Any hints?

avatar Bakual
Bakual - comment - 22 Oct 2014

I guess you are already loading core.js (using JHtmlBehavior::core())?

avatar dgt41
dgt41 - comment - 22 Oct 2014

@Bakual so my comment about core.js was correct after all

avatar Bakual
Bakual - comment - 22 Oct 2014

core.js defines the Joomla namespace for JavaScript functions and also defines the Joomla.JText method.
Previously this was loaded together with the MooTools framework and it also depended on it.
Core.js was rewritten to jQuery recently (I think with 3.3.0) and thus we can now load it without loading MooTools. That's what JHtmlBehavior::core() is for :)

avatar durgesh4
durgesh4 - comment - 24 Oct 2014

Hello guys,

Thanks for your replies.
I found out this issues for the custom template.
It's having configuration for enabling bad disabling the mootools

Hence I though it should be used without mootools library in Joomla.

I hope you will take my opinion in consideration.
On Oct 22, 2014 8:05 PM, "Dimitri Grammatiko" notifications@github.com
wrote:

@wilsonge https://github.com/wilsonge I am trying to figure out why
this is happening looking at joomla/language/… and
document/html/renderer/head.php
But I get nowhere. Any hints?


Reply to this email directly or view it on GitHub
#4839 (comment).

avatar brianteeman brianteeman - change - 3 Jan 2015
Labels Added: ?
avatar mbabker
mbabker - comment - 27 Jun 2015

Is this still an issue?

avatar dgt41
dgt41 - comment - 27 Jun 2015

It shouldn't be because core.js is not mootools dependent

avatar gunjanpatel
gunjanpatel - comment - 14 Jul 2015

I have go through the issue description and also tested, found that it work without Mootools.
So, we can close this issue now.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4839.

avatar gunjanpatel gunjanpatel - change - 14 Jul 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-07-14 11:10:01
Closed_By gunjanpatel
avatar gunjanpatel
gunjanpatel - comment - 14 Jul 2015
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jul 2015
Closed_By gunjanpatel joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 14 Jul 2015

Add a Comment

Login with GitHub to post a comment