We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to translate all labels from custom appointment window on Recurrence

Hi, 


I have a Scheduler with a customAppointmentWindow but the DatePicker of customappointmentwindow is not in pt-BR I have everything from scheduler in portuguese using on the master page

    <html lang="pt-BR" xml:lang="pt-BR" xmlns="http://www.w3.org/1999/xhtml">
    <%: Scripts.Render("~/Scripts/ej/ej.web.all-pt-BR.js")%>
    <%: Scripts.Render("~/Scripts/ej/i18n/ej.culture.pt-BR.min.js")%>
    <%: Scripts.Render("~/Scripts/ej/l10n/ej.localetexts.pt-BR.js")%>

But recurring popup is not using this settings .. 



at recurring window I started to translate 

ej.web.all.js and I created a ej.web.all-PT-BR.js I left as en-US because I dont know how to change locations on file ej.web.all.js but now working well





1 Reply

RV Ravikumar Venkatesan Syncfusion Team January 6, 2023 06:39 PM UTC

Hi Jorge,


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ej_webforms_schedule_with_locale1043233314


Q1: The DatePicker of the custom appointment window is not in pt-BR

We suspect that you didn’t set the locale property to the start and end time fields. So, we suggest you set the locale property to the start and end date time pickers as shown in the below code snippet.


<asp:Content ID="ScriptContent" runat="server" ContentPlaceHolderID="ScriptSection">

    <script type="text/javascript">       

        var startObj;

        var endObj;

        function onAppointmentWindowOpen(args) {

            // to add custom element in default appointment window

            if (this._appointmentAddWindow.find(".custom-fields").length == 0) {

                var start = "<tr class='custom-fields'><td class='e-textlabel'>início</td><td colspan='3'><input id='start' class='start' name='StartTime' type='text'/></td></tr>";

                $(start).insertBefore(this._appointmentAddWindow.find("#Schedule_appStartTime"));

                $('#start').ejDateTimePicker({

                    width: "100%",

                    locale: "pt-BR",

                    value: !ej.isNullOrUndefined(args.appointment) ? args.appointment.StartTime : args.startTime,

                });

                startObj = $('#start').data("ejDateTimePicker");

 

                var end = "<tr class='custom-fields'><td class='e-textlabel'>fim</td><td colspan='3'><input id='end' class='end' name='EndTime' type='text'/></td></tr>";

                $(end).insertBefore(this._appointmentAddWindow.find("#Schedule_appEndTime"));

                $('#end').ejDateTimePicker({

                    width: "100%",

                    locale: "pt-BR",

                    value: !ej.isNullOrUndefined(args.appointment) ? args.appointment.EndTime : args.endTime,

                });

                endObj = $('#end').data("ejDateTimePicker");

            }

        }

    </script>

</asp:Content>



Q2: Recurring popup is not using these settings

Make sure the ej.web.all.min.js, ej.culture.pt-BR.min.js, and ej.localetexts.pt-BR.min.js files are referred to with Portuguese translations as highlighted in the below code snippet. You can get the culture-specific files from the below repository. Refer to the below UG links for localizing.


EJ Locale: https://github.com/syncfusion/ej-global

UG:

https://help.syncfusion.com/aspnet/localization

https://help.syncfusion.com/aspnet/globalization

https://help.syncfusion.com/aspnet/schedule/globalization-and-localization


[Site.Master]

<!DOCTYPE html>

 

<html lang="en">

<head runat="server">

    <%:Scripts.Render(https://cdn.syncfusion.com/20.3.0.57/js/web/ej.web.all.min.js) %>

    <%: Scripts.Render("~/Scripts/ej/i18n/ej.culture.pt-BR.min.js")%>

    <%: Scripts.Render("~/Scripts/ej/l10n/ej.localetexts.pt-BR.min.js")%>

</head>

<body>

</body>

</html>


Output:



Regards,

Ravikumar Venkatesan


Loader.
Live Chat Icon For mobile
Up arrow icon