PDA

View Full Version : [OPEN] Ext.Date.dayNames Error in 4.2.0



wangsong
4 May 2013, 8:36 AM
REQUIRED INFORMATION


Ext version tested:

Ext 4.2.0

Browser versions tested against:

firefox 20.0.1
IE9
FF3 (firebug 1.11.2 installed)

DOCTYPE tested against:

Can not display the day names correctly with the ext-lang-zh_CN.js

Description:

I fixed the issue by my way, but I want to know the reason. And the ext-4.0.7-gpl is right!In addition, the 'msg: "???..."' in ext-lang-zh_CN.js is the traditional Chinese not the Simple Chinese, which should be replace with '???...'.

Test Case:



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>DateField</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../Ext4/resources/css/ext-all.css"/>
<script type="text/javascript" src="../Ext4/bootstrap.js"></script>
<script type="text/javascript" src="../Ext4/locale/ext-lang-zh_CN.js"></script>
</head>
<body>
<script type="text/javascript">
Ext.onReady(function(){
if(Ext.BLANK_IMAGE_URL.substr(0,4)!="data"){
Ext.BLANK_IMAGE_URL="./images/s.gif";
}

Ext.create("Ext.form.Panel",{
title:"DateField",
width:500,
height:300,
renderTo:Ext.getBody(),
bodyPadding:5,
bodyStyle:"background:#DFE9F6",
defaultType:"datefield",
fieldDefaults:{msgTarget:"side",
labelSeparator:"?",
},
items:[
{xtype:"fieldcontainer",fieldLabel:"Date Range",layout:"hbox",
defaultType:"datefield",fieldDefaults:{width:150},
items:[
{name:"start",value:new Date()},
{xtype:"label",text:"to"},
{name:"end",value:new Date()}
]
}
],
bbar:[
{text:"Save",handler:function(){
var f=this.up("form").getForm();
if(f.isValid())
f.submit();
}}
]
})
});
</script>
</body>
</html>





HELPFUL INFORMATION


Screenshot or Video:

43526

Debugging already done:

none

Possible fix:

43525

Additional CSS used:

only default ext-all.css

Operating System:

Win7

*EDIT BY SLEMMON
Tested with ext-lang-zh_CN.js on Chrome 26 in OSX on 4.2 and 4.2.1.818

slemmon
6 May 2013, 7:57 AM
Thanks for the report! I have opened a bug in our bug tracker.

Daniil
23 May 2013, 8:50 PM
Hi,

I think a DatePicker's dayNames are not localized in any locale. It tested with some locales.

It is due the following thing. This is a related excerpt from the zh_CN locale.


Ext.onReady(function() {
if (Ext.Date) {
Ext.Date.dayNames = ["???", "???", "???", "???", "???", "???", "???"];
});

Ext.define("Ext.locale.zh_CN.picker.Date", {
override: "Ext.picker.Date",
dayNames: Ext.Date.dayNames

});

It is obvious that Ext.define() is executed prior to Ext.onReady's function. So, non localized day names are going to a DatePicker. Exactly the same thing happens with monthNames. And it happens with any locale since they all are designed in the same manner.

@slemmon, could you, please, confirm you have read this message and we can expect that it will be considered for fixing in all the locales, both dayNames and monthNames?

smartree
27 May 2013, 11:48 PM
why remove "Ext.define" from "Ext.onReady(function() {" scope, is it necessary?
not only zh_CN, most ext-4.2.0.663\locale s have the fault.

Daniil
30 May 2013, 2:12 AM
Hi @slemmon,

I think this issue has been fixed in 4.2.1 beta. There is the following in the Release Notes.
EXTJSIV-9340 Datepicker is not picking up localized text properly

Well, maybe, this ticket is not related to the dayNames issue, but it appears to be fixed in ExtJS 4.1.2 beta for sure, I see the related changes in the sources. I think the thread can be marked as fixed.

zzhouag
6 Aug 2013, 3:04 AM
yeah, I also do not understand why Ext.onReady() is necessary here