Navigator localization (Agenda View)

7 posts, 0 answers
  1. Jaime
    Jaime avatar
    4 posts
    Member since:
    Jan 2021

    Posted 07 Jan Link to this post

    I have successfully located it, but I cannot change the "Agenda View" text. All other items are shown in Spanish.

     

    How could I change that text?

     

     

        Inherits SchedulerNavigatorLocalizationProvider
        Public Overrides Function GetLocalizedString(ByVal id As String) As String
            Select Case id
                Case SchedulerNavigatorStringId.DayViewButtonCaption
                    Return "Día"
                Case SchedulerNavigatorStringId.WeekViewButtonCaption
                    Return "Semana"
                Case SchedulerNavigatorStringId.MonthViewButtonCaption
                    Return "Mes"
                Case SchedulerNavigatorStringId.TimelineViewButtonCaption
                    Return "Línea tiempo"
                Case SchedulerNavigatorStringId.AgendaViewButtonCaption
                    Return "Agenda"
                Case SchedulerNavigatorStringId.ShowWeekendCheckboxCaption
                    Return "Fin de semana"
                Case SchedulerNavigatorStringId.TodayButtonCaptionToday
                    Return "Hoy"
                Case SchedulerNavigatorStringId.TodayButtonCaptionThisWeek
                    Return "Esta semana"
                Case SchedulerNavigatorStringId.TodayButtonCaptionThisMonth
                    Return "Este mes"
                Case SchedulerNavigatorStringId.SearchInAppointments
                    Return "Buscar en citas"
                Case SchedulerNavigatorStringId.AgendaViewButtonCaption
                    Return "Vista Agenda"
            End Select
            Return String.Empty
        End Function

     

    Best Regards

    Jaime

  2. Nadya
    Admin
    Nadya avatar
    486 posts

    Posted 08 Jan Link to this post

    Hello, Jaime,

    The provided code snippet for localizing RadSchedulerNavigator is greatly appreciated. After investigating it seems that you have "Case SchedulerNavigatorStringId.AgendaViewButtonCaption" set two times. This is why the second string for the AgendaViewButtonCaption is not respected. I changed the code and now it works fine.

    Please refer to the updated code snippet:

    Public Class CustomSchedulerNavigatorLocalizationProvider
        Inherits SchedulerNavigatorLocalizationProvider
        Public Overrides Function GetLocalizedString(ByVal id As String) As String
            Select Case id
                Case SchedulerNavigatorStringId.DayViewButtonCaption
                    Return "Día"
                Case SchedulerNavigatorStringId.WeekViewButtonCaption
                    Return "Semana"
                Case SchedulerNavigatorStringId.MonthViewButtonCaption
                    Return "Mes"
                Case SchedulerNavigatorStringId.TimelineViewButtonCaption
                    Return "Línea tiempo"
                'Case SchedulerNavigatorStringId.AgendaViewButtonCaption
                '    Return "Agenda"
                Case SchedulerNavigatorStringId.ShowWeekendCheckboxCaption
                    Return "Fin de semana"
                Case SchedulerNavigatorStringId.TodayButtonCaptionToday
                    Return "Hoy"
                Case SchedulerNavigatorStringId.TodayButtonCaptionThisWeek
                    Return "Esta semana"
                Case SchedulerNavigatorStringId.TodayButtonCaptionThisMonth
                    Return "Este mes"
                Case SchedulerNavigatorStringId.SearchInAppointments
                    Return "Buscar en citas"
                Case SchedulerNavigatorStringId.AgendaViewButtonCaption
                    Return "Vista Agenda"
            End Select
            Return MyBase.GetLocalizedString(id)
        End Function
    End Class
    

    I hope this helps. If you have any other questions please let me know.

    Regards,
    Nadya
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  3. Jaime
    Jaime avatar
    4 posts
    Member since:
    Jan 2021

    Posted 08 Jan in reply to Nadya Link to this post

    Thanks Nadya

    Unfortunately I have not been able to solve my problem.

    I added the duplicate entry when I saw that it won't translate, I not realizing that there was already an entry for that button.

    In any case, I am including this control in an old development. To rule out any incompatibility, I will create a project from scratch and inform you of the results.

     

     

     

  4. Jaime
    Jaime avatar
    4 posts
    Member since:
    Jan 2021

    Posted 08 Jan Link to this post

    Hi again

    The same behavior in a development from scratch.

     

    Imports Telerik.WinControls.UI

    Public Class RadForm1
        Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles Me.Load
            SchedulerNavigatorLocalizationProvider.CurrentProvider = New CustomSchedulerNavigatorLocalizationProvider
        End Sub
    End Class

     

    Imports Telerik.WinControls.UI

    Public Class CustomSchedulerNavigatorLocalizationProvider
        Inherits SchedulerNavigatorLocalizationProvider
        Public Overrides Function GetLocalizedString(ByVal id As String) As String
            Select Case id
                Case SchedulerNavigatorStringId.DayViewButtonCaption
                    Return "Día"
                Case SchedulerNavigatorStringId.WeekViewButtonCaption
                    Return "Semana"
                Case SchedulerNavigatorStringId.MonthViewButtonCaption
                    Return "Mes"
                Case SchedulerNavigatorStringId.TimelineViewButtonCaption
                    Return "Línea tiempo"
                'Case SchedulerNavigatorStringId.AgendaViewButtonCaption
                '    Return "Agenda"
                Case SchedulerNavigatorStringId.ShowWeekendCheckboxCaption
                    Return "Fin de semana"
                Case SchedulerNavigatorStringId.TodayButtonCaptionToday
                    Return "Hoy"
                Case SchedulerNavigatorStringId.TodayButtonCaptionThisWeek
                    Return "Esta semana"
                Case SchedulerNavigatorStringId.TodayButtonCaptionThisMonth
                    Return "Este mes"
                Case SchedulerNavigatorStringId.SearchInAppointments
                    Return "Buscar en citas"
                Case SchedulerNavigatorStringId.AgendaViewButtonCaption
                    Return "Vista Agenda"
            End Select
            Return MyBase.GetLocalizedString(id)
        End Function
    End Class

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <startup>
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
        </startup>
    </configuration>

  5. Nadya
    Admin
    Nadya avatar
    486 posts

    Posted 08 Jan Link to this post

    Hello, Jaime,

    I am sorry to hear that you still have difficulties localizing the scheduler navigator. From the provided code snippet I can see that you set the CurrentProvider property in the form's Load event. Can you please set it before  InitializeComponent() like shown below:

    Public Class RadForm1
        Sub New()
            SchedulerNavigatorLocalizationProvider.CurrentProvider = New CustomSchedulerNavigatorLocalizationProvider()
            InitializeComponent()
        End Sub
    End Class
    
    Public Class CustomSchedulerNavigatorLocalizationProvider
        Inherits SchedulerNavigatorLocalizationProvider
        Public Overrides Function GetLocalizedString(ByVal id As String) As String
            Select Case id
                Case SchedulerNavigatorStringId.DayViewButtonCaption
                    Return "Día"
                Case SchedulerNavigatorStringId.WeekViewButtonCaption
                    Return "Semana"
                Case SchedulerNavigatorStringId.MonthViewButtonCaption
                    Return "Mes"
                Case SchedulerNavigatorStringId.TimelineViewButtonCaption
                    Return "Línea tiempo"
                'Case SchedulerNavigatorStringId.AgendaViewButtonCaption
                '    Return "Agenda"
                Case SchedulerNavigatorStringId.ShowWeekendCheckboxCaption
                    Return "Fin de semana"
                Case SchedulerNavigatorStringId.TodayButtonCaptionToday
                    Return "Hoy"
                Case SchedulerNavigatorStringId.TodayButtonCaptionThisWeek
                    Return "Esta semana"
                Case SchedulerNavigatorStringId.TodayButtonCaptionThisMonth
                    Return "Este mes"
                Case SchedulerNavigatorStringId.SearchInAppointments
                    Return "Buscar en citas"
                Case SchedulerNavigatorStringId.AgendaViewButtonCaption
                    Return "Vista Agenda"
            End Select
            Return MyBase.GetLocalizedString(id)
        End Function
    End Class
    

    I hope this helps. Let me know if you have further difficulties.

    Regards,
    Nadya
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  6. Jaime
    Jaime avatar
    4 posts
    Member since:
    Jan 2021

    Posted 08 Jan in reply to Nadya Link to this post

    That was the problem.

    Changing it to Sub New () works correctly.

    I'm surprised because in other forms I have the RadGridView and RadScheduler located in the Load event and they work like a charm.

    I understand that it is always advisable to put it in New (), correct?

    Thank you very much for your help.

  7. Nadya
    Admin
    Nadya avatar
    486 posts

    Posted 12 Jan Link to this post

    Hi, Jaime,

    CurrentProvider is a static property that is used for retrieving strings and should be set just in one place. It is recommended to be set before InitializeComponent() is called.

    Should you have other questions please let me know.

    Regards,
    Nadya
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Back to Top