PDA

View Full Version : [OPEN] [#15] Locale problem



RCN
Oct 11, 2012, 2:27 PM

Daniil
Oct 11, 2012, 6:15 PM
Hi Raphael,

I guess you mean that loading message is not localized, isn't that so?

I checked the Locale is applied, but a message is really not localized. It should be localized on ExtJS level, here is a related thread.
http://www.sencha.com/forum/showthread.php?196742

But it is still not fixed in ExtJS.

So, we decided to fix it in Ext.NET, revision #4410.

Thank you for the report!

RCN
Oct 11, 2012, 6:51 PM
Yes, i meant that loading message was not localized. Your solution worked like a charm. Please mark this Thread as closed when ExtJs team release a permanent solution for this problem.


Once again, thumbs up to you.

RCN
Oct 11, 2012, 7:44 PM

RCN
Oct 11, 2012, 8:05 PM
it's possible to overcome the problems above by doing the following:



Ext.view.AbstractView.prototype.loadingText = "Ext.Net";


But i think that ExtJs or Ext.Net should localize the message properly. What is your opinion?

Daniil
Oct 12, 2012, 5:29 AM
Raphael, you are right. It should be fixed.

Here is a bug report.
http://www.sencha.com/forum/showthread.php?245783

Here is a workaround for now:

Workaround

Ext.onReady(function () {
Ext.define("Ext.locale.view.AbstractView", {
override: "Ext.view.AbstractView",
loadingText: Ext.view.AbstractView.prototype.msg
});

Ext.define("Ext.locale.LoadMask", {
override: "Ext.LoadMask",
msg: Ext.view.AbstractView.prototype.msg
});
});

Daniil
Oct 15, 2012, 9:26 AM
Sencha opened a bug ticket. We will monitor.

RCN
Oct 15, 2012, 11:27 AM
Thank you Daniil, please keep me posted

geoffrey.mcgill
Nov 16, 2012, 7:20 AM
Opened an Issue to track this defect, see

https://github.com/extnet/Ext.NET/issues/15

Daniil
Dec 18, 2012, 3:41 AM
The thread is related to this one.
http://forums.ext.net/showthread.php?22698

RCN
Jun 03, 2013, 12:13 PM
After updating from SVN Ext.view.AbstractView.prototype.msg is undefined. Further more, Ext.LoadMask.prototype.msg is not localized correctly.

Daniil
Jun 03, 2013, 12:47 PM
Good news.

AbstractView's loadingText appears to be fixed. I see the following ticket in the Release Notes for 4.2.0 Beta 2.
EXTJSIV-6014 Incomplete Localisation for LoadMask and AbstractView

Bad news.

LoadMask' msg are still not localized. It is absent in the locales and a LoadMask doesn't pick up an AbstractView's loadingText anywhere in the sources.

I updated the Sencha thread.

According to the findings, I think it needs to change the workaround to:

Ext.onReady(function () {
Ext.define("Ext.locale.LoadMask", { override: "Ext.LoadMask",
msg: Ext.view.AbstractView.prototype.loadingText

});
});




Raphael, could you, please, confirm it is working for you or not?

RCN
Jun 03, 2013, 1:14 PM
Daniil, please wait few minutes. i am gonna retest.

RCN
Jun 03, 2013, 1:24 PM
Daniil, the workaround provided above overcomes the issue as expected.

Thumbs up to you.

Let's gonna wait for a permanent fix from sencha.

Thank you

Daniil
Jun 04, 2013, 6:06 AM
It is a very common feature, a loading mask. Due to the bug that a LoadMask's msg is not localized, all our stuff with a loading mask (DirectEvent, Ext.net.Mask, ComponentLoader, Image) is also not localized. So, I decided to fix it all in SVN and it has been done in the revision #5170. It will go to the next release (v2.2.1 or v2.3).

RCN
Jun 04, 2013, 11:58 AM
Daniil, i got the latest version from SVN (revision 5170) and Ext.LoadMask.prototype.msg seems to be not localized.

Note: I removed the workaround provided by you (post #12) after i downloaded from SVN.

Daniil
Jun 04, 2013, 12:28 PM
Ext.LoadMask picks up a localized text from Ext.view.AbstractView.prototype.loadingText at "initComponent" stage.

RCN
Jun 04, 2013, 12:58 PM
Shouldn't Ext.LoadMask.prototype.msg be localized during _btn1 click, since everything has been initialized?



<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
</head>
<body>
<ext:ResourceManager runat="server" Locale="pt" />
<%--NOT LOCALIZED--%>
<ext:Button ID="_btn1" Text="alert(Ext.LoadMask.prototype.msg)" runat="server">
<Listeners>
<Click Handler="alert(Ext.LoadMask.prototype.msg);" />
</Listeners>
</ext:Button>
<%--LOCALIZED--%>
<ext:Button ID="_btn2" Text="alert(Ext.view.AbstractView.prototype.loadingText)" runat="server">
<Listeners>
<Click Handler="alert(Ext.view.AbstractView.prototype.loadingText) ;" />
</Listeners>
</ext:Button>
</body>
</html>

Daniil
Jun 04, 2013, 1:21 PM
Well, I didn't localize it. As I said, Ext.LoadMask picks up a localized text from Ext.view.AbstractView.prototype.loadingText at "initComponent" stage.

For example, you will see a localized text after running this code snippet.

var mask = new Ext.LoadMask({ target: Ext.getBody() });
mask.show();

I am not sure how Sencha will fix it, but, probably they will do the same.

Why do you need Ext.view.LoadMask.prototype.msg?

RCN
Jun 04, 2013, 2:07 PM
Well, I didn't localize it. As I said, Ext.LoadMask picks up a localized text from Ext.view.AbstractView.prototype.loadingText at "initComponent" stage.

For example, you will see a localized text after running this code snippet.

var mask = new Ext.LoadMask({ target: Ext.getBody() });
mask.show();

I am not sure how Sencha will fix it, but, probably they will do the same.

That's ok Daniil.


Why do you need Ext.view.LoadMask.prototype.msg?

I do not need it. I was just trying to test the solution as a whole, and, as consequence, i noticed that Ext.view.LoadMask.prototype.msg was not localized.


Thank you for solving this issue internally

Daniil
Jun 04, 2013, 2:18 PM
Thank you for your vigilance!

RCN
Jun 04, 2013, 2:27 PM
You're welcome.

RCN
Jan 29, 2015, 3:35 PM
I tested all the issues presented on this thread and only one is stiil actual.

As stated on post #18 http://forums.ext.net/showthread.php?21464-OPEN-15-Locale-problem&p=110645&viewfull=1#post110645, Ext.LoadMask.prototype.msg is not localized.

Daniil, what is your position?

Daniil
Jan 30, 2015, 6:49 AM
Confirm, a LoadMask is still not localized in ExtJS 5.1.0, but it is in Ext.NET.

Yes, a prototype is not localized, but it pulls an AbstractView's loading message in the initComponent method.

Personally, I doubt Sencha will ever fix it:) Though, I still prefer to leave the Issue open to track it.

RCN
Jan 30, 2015, 11:51 AM
Thank you Daniil