Dec 03, 2010, 12:18 PM
Localization: Ext.js language files not handled completely
Hi,
we use the existing translations of Ext.Js, located in the <Ext.Net basedirectory>\Ext.Net\Build\Ext.Net\extjs\src\loc ale folder for localization.
This is working fine for many controls, but for the PagingToolbar it is only working partially. Some properties as beforePageText, nextText and others are just not handled.
I have attached an example to reproduce the error easily.
The attachment shows correct translations in green and missing in red.
I assume this is a bug in Ext.Net. Am I right?
Cheers,
Ulf
The sample code:
we use the existing translations of Ext.Js, located in the <Ext.Net basedirectory>\Ext.Net\Build\Ext.Net\extjs\src\loc ale folder for localization.
This is working fine for many controls, but for the PagingToolbar it is only working partially. Some properties as beforePageText, nextText and others are just not handled.
I have attached an example to reproduce the error easily.
The attachment shows correct translations in green and missing in red.
I assume this is a bug in Ext.Net. Am I right?
Cheers,
Ulf
The sample code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Paging1.aspx.cs" %>
<%@ Import Namespace="System.Xml" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
private object[] TestData
{
get
{
return new object[]
{
new object[] { "3m Co", 71.72},
new object[] { "Alcoa Inc", 29.01},
new object[] { "Altria Group Inc", 83.81 },
new object[] { "American Express Company", 52.55 },
new object[] { "American International Group, Inc.", 64.13 },
new object[] { "AT&T Inc.", 31.61},
new object[] { "Boeing Co.", 75.43},
new object[] { "Caterpillar Inc.", 67.27 },
};
}
}
protected void Page_Init(object sender, EventArgs e)
{
X.Js.Call("initLanguage");
}
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = this.TestData;
this.Store1.DataBind();
}
}
protected void MyData_Refresh(object sender, StoreRefreshDataEventArgs e)
{
this.Store1.DataSource = this.TestData;
this.Store1.DataBind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<script type="text/javascript">
function initLanguage() {
if (Ext.PagingToolbar) {
Ext.apply(Ext.PagingToolbar.prototype, {
beforePageText: "Seite",
afterPageText: "von {0}",
firstText: "Erste Seite",
prevText: "vorherige Seite",
nextText: "nächste Seite",
lastText: "letzte Seite",
refreshText: "Aktualisieren",
displayMsg: "Anzeige Eintrag {0} - {1} von {2}",
emptyMsg: "Keine Daten vorhanden"
});
}
}
</script>
<link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager runat="server" />
<ext:Store
ID="Store1"
runat="server"
OnRefreshData="MyData_Refresh" >
<Reader>
<ext:ArrayReader IDProperty="company">
<Fields>
<ext:RecordField Name="company" />
<ext:RecordField Name="price" Type="Float" />
<ext:RecordField Name="change" Type="Float" />
<ext:RecordField Name="pctChange" Type="Float" />
<ext:RecordField Name="lastChange" Type="Date" DateFormat="yyyy-MM-ddTHH:mm:ss" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:GridPanel ID="GridPanel1"
runat="server"
StoreID="Store1"
Title="Array Grid"
Width="600"
Height="200">
<ColumnModel runat="server">
<Columns>
<ext:Column ColumnID="Company" Header="Company" Width="160" DataIndex="company">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column Header="Price" Width="75" DataIndex="price">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolbar runat="server" PageSize="5" />
</BottomBar>
</ext:GridPanel>
</form>
</body>
</html>