This is a migrated thread and some comments may be shown as answers.

Navigator localization (Agenda View)

6 Answers 90 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Jaime
Top achievements
Rank 1
Jaime asked on 07 Jan 2021, 12:48 PM

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

6 Answers, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 08 Jan 2021, 11:05 AM

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/.

0
Jaime
Top achievements
Rank 1
answered on 08 Jan 2021, 11:52 AM

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.

 

 

 

0
Jaime
Top achievements
Rank 1
answered on 08 Jan 2021, 12:16 PM

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>

0
Nadya | Tech Support Engineer
Telerik team
answered on 08 Jan 2021, 01:37 PM

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/.

0
Jaime
Top achievements
Rank 1
answered on 08 Jan 2021, 03:43 PM

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.

0
Nadya | Tech Support Engineer
Telerik team
answered on 12 Jan 2021, 01:38 PM

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/.

Tags
Scheduler and Reminder
Asked by
Jaime
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Jaime
Top achievements
Rank 1
Share this question
or