PDA

View Full Version : [CLOSED] ext:EventWindow: Localization



supera
Apr 16, 2012, 5:54 PM
Hi!

I wish localize to pt-BR the ext:EventWindow...

4106

The fieldlabels are in english and the dates as formated in english format.
Buttons text are in english too...

Thanks for any help!

Daniil
Apr 16, 2012, 7:55 PM
Hi,

It should be localized manually.

Example

<%@ Page Language="C#" %>

<%@ 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">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>

<ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />

<%-- Localization --%>
<script type="text/javascript">
Ext.calendar.form.field.DateRange.override({
toText : "My to",
allDayText : "My All day",
dateFormat : "y-m-d",
timeFormat : "H:i"
});

var onBeforeRender = function (win) {
var titleItem = win.formPanel.getComponent('title'),
dateRangeItem = win.formPanel.getComponent('date-range'),
calendarItem = win.formPanel.getComponent('calendar'),
fbar = win.getDockedComponent(0);

titleItem.fieldLabel = 'My Title';
dateRangeItem.fieldLabel = 'My When';
calendarItem.fieldLabel = 'My Calendar';

fbar.items.get(0).text = '<a href="#" id="tblink">My Edit Details...</a>';
fbar.items.get(2).text = "My Save";
fbar.items.get(3).text = "My Delete";
fbar.items.get(4).text = "My Cancel";
};
</script>
<%-- End of Localization --%>

<script type="text/javascript">
var CompanyX = {
getWindow : function() {
return CompanyX.EventWindow1;
},

dayClick : function(cal, dt, allDay, el) {
this.record.show.call(this, cal, {
StartDate: dt,
IsAllDay: allDay
}, el);
},

record : {
show: function(cal, rec, el) {
CompanyX.getWindow().show(rec, el);
}
}
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" Namespace="CompanyX" />
<ext:Viewport runat="server" Layout="FitLayout">
<Items>
<ext:CalendarPanel ID="CalendarPanel1" runat="server">
<EventStore ID="EventStore1" runat="server">
<Events>
<ext:EventModel
Title="My event"
StartDate="2011/10/13"
EndDate="2011/10/13"
CalendarId="1" />
</Events>
</EventStore>
<CalendarStore ID="CalendarStore1" runat="server">
<Calendars>
<ext:CalendarModel CalendarId="1" Title="Home" />
<ext:CalendarModel CalendarId="2" Title="Work" />
<ext:CalendarModel CalendarId="3" Title="School" />
</Calendars>
</CalendarStore>
<Listeners>
<DayClick Fn="CompanyX.dayClick" Scope="CompanyX" />
<EventClick Fn="CompanyX.record.show" Scope="CompanyX" />
</Listeners>
</ext:CalendarPanel>
</Items>
</ext:Viewport>
<ext:EventWindow
ID="EventWindow1"
runat="server"
Hidden="true"
CalendarStoreID="CalendarStore1"
TitleTextAdd="TitleTextAdd"
TitleTextEdit="TitleTextEdit">
<Listeners>
<BeforeRender Fn="onBeforeRender" />
</Listeners>
</ext:EventWindow>
</form>
</body>
</html>

supera
Apr 16, 2012, 8:29 PM
Hi Daniil!

Thanks a lot... works very fine

bossun
Aug 07, 2012, 9:03 PM
Hi,

Thank you for your example but how can I localize toText and allDayText from resource files?

Regards,

Daniil
Aug 08, 2012, 5:48 AM
Hi,



Thank you for your example but how can I localize toText and allDayText from resource files?


You can use <asp:Literal>.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>

<%-- Localization --%>
<script type="text/javascript">
Ext.calendar.form.field.DateRange.override({
toText : <asp:Literal runat="server" Text="<%$ Resources:Resource1, ToText%>" />,
allDayText : <asp:Literal runat="server" Text="<%$ Resources:Resource1, AllDayText%>" />,
dateFormat : "y-m-d",
timeFormat : "H:i"
});

var onBeforeRender = function (win) {
var titleItem = win.formPanel.getComponent('title'),
dateRangeItem = win.formPanel.getComponent('date-range'),
calendarItem = win.formPanel.getComponent('calendar'),
fbar = win.getDockedComponent(0);

titleItem.fieldLabel = 'My Title';
dateRangeItem.fieldLabel = 'My When';
calendarItem.fieldLabel = 'My Calendar';

fbar.items.get(0).text = '<a href="#" id="tblink">My Edit Details...</a>';
fbar.items.get(2).text = "My Save";
fbar.items.get(3).text = "My Delete";
fbar.items.get(4).text = "My Cancel";
};
</script>
<%-- End of Localization --%>

<script type="text/javascript">
var CompanyX = {
getWindow : function() {
return CompanyX.EventWindow1;
},

dayClick : function(cal, dt, allDay, el) {
this.record.show.call(this, cal, {
StartDate: dt,
IsAllDay: allDay
}, el);
},

record : {
show: function(cal, rec, el) {
CompanyX.getWindow().show(rec, el);
}
}
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" Namespace="CompanyX" />
<ext:Viewport runat="server" Layout="FitLayout">
<Items>
<ext:CalendarPanel ID="CalendarPanel1" runat="server">
<EventStore ID="EventStore1" runat="server">
<Events>
<ext:EventModel
Title="My event"
StartDate="2011/10/13"
EndDate="2011/10/13"
CalendarId="1" />
</Events>
</EventStore>
<CalendarStore ID="CalendarStore1" runat="server">
<Calendars>
<ext:CalendarModel CalendarId="1" Title="Home" />
<ext:CalendarModel CalendarId="2" Title="Work" />
<ext:CalendarModel CalendarId="3" Title="School" />
</Calendars>
</CalendarStore>
<Listeners>
<DayClick Fn="CompanyX.dayClick" Scope="CompanyX" />
<EventClick Fn="CompanyX.record.show" Scope="CompanyX" />
</Listeners>
</ext:CalendarPanel>
</Items>
</ext:Viewport>

<ext:EventWindow
ID="EventWindow1"
runat="server"
Hidden="true"
CalendarStoreID="CalendarStore1"
TitleTextAdd="TitleTextAdd"
TitleTextEdit="TitleTextEdit">
<Listeners>
<BeforeRender Fn="onBeforeRender" />
</Listeners>
</ext:EventWindow>
</form>
</body>
</html>

App_GlobalResources Resource1.resx
AllDayText -> 'MyAll'
ToText -> 'MyTo'

Please note that quotes symbols are important to get it working.

Daniil
Aug 08, 2012, 5:51 AM
Also you can be interested in Calendar Pro. Here are some more details:
http://forums.ext.net/showthread.php?19702&p=84928&viewfull=1#post84928

It is much more powerful control than the built-in one. Including much more properties for localization.

bossun
Aug 08, 2012, 7:23 AM
Also you can be interested in Calendar Pro. Here are some more details:
http://forums.ext.net/showthread.php?19702&p=84928&viewfull=1#post84928

It is much more powerful control than the built-in one. Including much more properties for localization.

Yes I'm interessed but what's its price? Can I see some examples how using it?

Daniil
Aug 08, 2012, 9:34 AM
Both answers are in the post I have referred.



The Ext.NET.CalendarPro (http://calendarpro.ext.net/) is also coming soon. Both Scheduler and CalendarPro are being converted to support Ext.NET 2.x.

Pricing and licensing terms are yet to be determined, although will more than likely be similar to regular .js only versions of the products.

If you are interested in purchasing now, please feel free to email me (geoff@object.net) and we can accomodate you before the official launch.

hujq
Dec 01, 2014, 3:34 PM
Hi@Daniil (http://forums.ext.net/member.php?2345-Daniil),please give a example for EventDetailsForm :Localization ,thanks!

Daniil
Dec 02, 2014, 8:04 AM
Sorry, it looks we don't have such an example.