To localize the content of the calendar control, assign the appropriate culture to the Calendar.Culture property. To further customize how dates and times are displayed, modify the properties of the Calendar.DateTimeFormat object. For example, to customize the names of the week days, use the DateTimeFormatInfo.DayNames.
To localize the result returned by the Recurrence.ToLocalizedString method, create a LocalizationInfo object, populate its properties (either directly or by loading them from an XML file) and pass it as an argument to the method.
The Localization Template
Below is the full XML format of the localization template. You can create a copy, replace the values marked in bold with their counterparts, then use the LoadFromXml method to load the template in code.
Template (XML)
Copy Code
|
---|
<?xml version="1.0" encoding="UTF-8"?> <localization> <NewFormHeader>Appointment</NewFormHeader> <EditFormHeader>Edit Appointment</EditFormHeader> <NewRecurrenceFormHeader>Recurrence</NewRecurrenceFormHeader> <EditRecurrenceFormHeader>Edit Recurrence</EditRecurrenceFormHeader> <CueFormHeader>Cue items</CueFormHeader> <DateCaption>Date</DateCaption> <DatesCaption>Dates</DatesCaption> <SubjectCaption>Subject</SubjectCaption> <StartTimeCaption>Start time</StartTimeCaption> <EndTimeCaption>End time</EndTimeCaption> <AllDayEventCaption>All day event</AllDayEventCaption> <ReminderCaption>Reminder</ReminderCaption> <DetailsCaption>Details</DetailsCaption> <ContactsCaption>Contacts</ContactsCaption> <TodayCaption>Today</TodayCaption> <LocationCaption>Location</LocationCaption> <PatternCaption>Pattern</PatternCaption> <RangeCaption>Range of recurrence</RangeCaption> <EveryCaption>Every</EveryCaption> <OfEveryCaption>of every</OfEveryCaption> <StartCaption>Start</StartCaption> <NoEndCaption>No end date</NoEndCaption> <EndAfterCaption>End after</EndAfterCaption> <EndDateCaption>End by</EndDateCaption> <SaveButtonCaption>Save</SaveButtonCaption> <OptionsButtonCaption>Options</OptionsButtonCaption> <CancelButtonCaption>Cancel</CancelButtonCaption> <RecurrenceButtonCaption>Recurrence</RecurrenceButtonCaption> <DeleteButtonCaption>Delete</DeleteButtonCaption> <SecondsValue>seconds</SecondsValue> <MinuteValue>minute</MinuteValue> <MinutesValue>minutes</MinutesValue> <HourValue>hour</HourValue> <HoursValue>hours</HoursValue> <DayValue>day</DayValue> <DaysValue>days</DaysValue> <WeeksValue>weeks</WeeksValue> <MonthValue>month</MonthValue> <DailyValue>Daily</DailyValue> <WeeklyValue>Weekly</WeeklyValue> <MonthlyValue>Monthly</MonthlyValue> <YearlyValue>Yearly</YearlyValue> <IntervalValue>By time interval</IntervalValue> <FirstValue>first</FirstValue> <SecondValue>second</SecondValue> <ThirdValue>third</ThirdValue> <FourthValue>fourth</FourthValue> <LastValue>last</LastValue> <WeekendValue>weekend</WeekendValue> <WeekdayValue>weekday</WeekdayValue> <RecurrenceDailyOnePattern>Occurs every day</RecurrenceDailyOnePattern> <RecurrenceDailyTwoPattern>Occurs every [Days] days</RecurrenceDailyTwoPattern> <RecurrenceDailyThreePattern>Occurs every weekday</RecurrenceDailyThreePattern> <RecurrenceDailyFourPattern>Occurs every weekend day</RecurrenceDailyFourPattern> <RecurrenceWeeklyOnePattern>Occurs every [DaysOfWeek]</RecurrenceWeeklyOnePattern> <RecurrenceWeeklyTwoPattern>Occurs every [Weeks] weeks on [DaysOfWeek]</RecurrenceWeeklyTwoPattern> <RecurrenceMonthlyOnePattern>Occurs day [DayOfMonth] of every [Months] month(s)</RecurrenceMonthlyOnePattern> <RecurrenceMonthlyTwoPattern>Occurs the [Occurrence] [Day] of every [Months] month(s)</RecurrenceMonthlyTwoPattern> <RecurrenceYearlyOnePattern>Occurs every [MonthOfYear] [DayOfMonth]</RecurrenceYearlyOnePattern> <RecurrenceYearlyTwoPattern>Occurs the [Occurrence] [Day] of [MonthOfYear]</RecurrenceYearlyTwoPattern> <RecurrenceIntervalPattern>Occurs every [Interval.Days] days [Interval.Hours] hours [Interval.Minutes] minutes [Interval.Seconds] seconds</RecurrenceIntervalPattern> <RecurrenceStartDatePattern>effective [StartDate]</RecurrenceStartDatePattern> <RecurrenceEndDatePattern>until [EndDate]</RecurrenceEndDatePattern> <RecurrenceTimeOnePattern>from [StartTime] to [EndTime]</RecurrenceTimeOnePattern> <RecurrenceTimeTwoPattern>at [StartTime]</RecurrenceTimeTwoPattern> <TaskFormHeader>Task</TaskFormHeader> <TaskPriorityLow>Low</TaskPriorityLow> <TaskPriorityNormal>Normal</TaskPriorityNormal> <TaskPriorityHigh>High</TaskPriorityHigh> <TaskStatusNotStarted>Not Started</TaskStatusNotStarted> <TaskStatusInProgress>In Progress</TaskStatusInProgress> <TaskStatusCompleted>Completed</TaskStatusCompleted> <TaskStatusWaiting>Waiting on someone else</TaskStatusWaiting> <TaskStatusDeferred>Deferred</TaskStatusDeferred> <PercentCompleteCaption>% Complete</PercentCompleteCaption> <DueDateCaption>Due date</DueDateCaption> <PriorityCaption>Priority</PriorityCaption> <StartDateCaption>Start date</StartDateCaption> <StatusCaption>Status</StatusCaption> <TimeCaption>Time</TimeCaption> <OKButtonCaption>OK</OKButtonCaption> <RemoveButtonCaption>Remove</RemoveButtonCaption> <WeekValue>week</WeekValue> <DurationCaption>Duration</DurationCaption> <EndCaption>End</EndCaption> <DaysCaption>Days</DaysCaption> <HoursCaption>Hours</HoursCaption> <MinutesCaption>Minutes</MinutesCaption> <SecondsCaption>Seconds</SecondsCaption> <MonthsValue>month(s)</MonthsValue> <RecurEveryValue>Recur every</RecurEveryValue> <OccurrencesValue>occurrences</OccurrencesValue> <WeeksOnValue>week(s) on</WeeksOnValue> <EveryWeekdayValue>Every weekday</EveryWeekdayValue> <EveryWeekendValue>Every weekend day</EveryWeekendValue> <TheValue>The</TheValue> <InvalidRecurrenceIntervalHeader>Invalid recurrence</InvalidRecurrenceIntervalHeader> <InvalidRecurrenceIntervalMessage>The recurrence interval needs to be greater than zero.</InvalidRecurrenceIntervalMessage> <ConfirmRecurrenceRemoveHeader>Remove recurrence</ConfirmRecurrenceRemoveHeader> <ConfirmRecurrenceRemoveMessage>Confirm recurrence removal?</ConfirmRecurrenceRemoveMessage> </localization> |