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

don't understand how localization works

1 Answer 48 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Maxence
Top achievements
Rank 1
Maxence asked on 17 Oct 2011, 03:48 AM
Hi telerik Team,

like the built in localization for french culture have some translation errors (translation of "hours" must be "heures" and not "heurs", ...).
i would like to use a resource file to put the right translation. i read your article about localization and it seems very easy but i never used localization and i didn't manage to make it works.
I create a folder "localization" and add it a new resources file named "ScheduleViewResources.fr.resx"
containing some translations :

AllDayEvent Evènement pour la journée
AppearanceCategory Apparence
Appointment Rendez-vous
AppointmentRecurrence Périodicité du rendez-vous

i put this in the constructor of my page who display the radscheduleview :
public SchedulePage()
 {
 
LocalizationManager.Manager = new LocalizationManager()
{
   ResourceManager = ScheduleViewResources.ResourceManager
};
 
 InitializeComponent();
ViewModel = new ScheduleViewModel();
this.DataContext = ViewModel;
}
like mentionned in the article but "ScheduleViewResources" is not recognized, what is it ? is it a custom class that i have to create ? is there some other changes to do ? thanks by advance for your information, Regards, Maxence

1 Answer, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 20 Oct 2011, 08:34 AM
Hi Maxence,

Here are some things you could have missed:

Set the access modifier of ScheduleViewResources.resx to public.
Set the access modifier of ScheduleViewResources.fr.resx to No code generation.
Set the CurrentCulture to French :
public App()
{
    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr");
    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr");
    this.Startup += this.Application_Startup;
    this.Exit += this.Application_Exit;
    this.UnhandledException += this.Application_UnhandledException;
 
    InitializeComponent();
}
Add French to SupportedCultures tag into your .csproj file:
<SupportedCultures>en;fr;</SupportedCultures>

Hope this helps.

Regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ScheduleView
Asked by
Maxence
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or