ant-design-blazor/components/date-picker/locale/DatePickerLocale.cs

70 lines
3.7 KiB
C#
Raw Normal View History

using System;
namespace AntDesign
{
public class DatePickerLocale
{
public DayOfWeek FirstDayOfWeek { get; set; } = DayOfWeek.Sunday;
feat(module: date-picker): support localization (#803) * start trying to add a different first day of the week based on localization. * add first day of week parameter and get weekday local from .net * fix some issues * extend demo * remove no longed needed Locale parameter * fix range for selection * add german localization * add entry for API section * remove obsolet things from the react ant documentation * add description to chart documentation * translate general configuration to english. * code cleanup * use LocalProvider to get first day of week. * use localeprovider instead of date picker localization * remove no longer used parameter * delete no longer used interface * change from enum to string due to parsing issue. * add missing formats and use culture info from localprovider * correct locales * us Sunday as a default * remove no longer used culture info parameter * adjust locales * add parameter for Locale instead of directly accessing it. * add inheritance to access locale * typo * readd culture info parameter * fixes for locale jsons * adjust demo and api * small adjustments on docs, set monday in chinese as first day of the week. * use locale in calendar as well. * adjust docs * use enum * adjust demo * adjust for different starting date. * add defaults for DatePickerLocale * add short week days to locale files * use days from locale file * code cleanup use consts instead of magic numbers, add code comment and use dayOfWeek As param instead of the whole locale object. Remove no longed used method. * not sure about the chinese translation so I remove them * Revert "not sure about the chinese translation so I remove them" This reverts commit 54017513c7b684494cf06184b4051a4dcfc43850.
2020-11-25 11:08:12 +08:00
public DateLocale Lang { get; set; } = new DateLocale();
public TimePickerLocale TimePickerLocale { get; set; } = new TimePickerLocale();
}
public class DateLocale
{
feat(module: date-picker): support localization (#803) * start trying to add a different first day of the week based on localization. * add first day of week parameter and get weekday local from .net * fix some issues * extend demo * remove no longed needed Locale parameter * fix range for selection * add german localization * add entry for API section * remove obsolet things from the react ant documentation * add description to chart documentation * translate general configuration to english. * code cleanup * use LocalProvider to get first day of week. * use localeprovider instead of date picker localization * remove no longer used parameter * delete no longer used interface * change from enum to string due to parsing issue. * add missing formats and use culture info from localprovider * correct locales * us Sunday as a default * remove no longer used culture info parameter * adjust locales * add parameter for Locale instead of directly accessing it. * add inheritance to access locale * typo * readd culture info parameter * fixes for locale jsons * adjust demo and api * small adjustments on docs, set monday in chinese as first day of the week. * use locale in calendar as well. * adjust docs * use enum * adjust demo * adjust for different starting date. * add defaults for DatePickerLocale * add short week days to locale files * use days from locale file * code cleanup use consts instead of magic numbers, add code comment and use dayOfWeek As param instead of the whole locale object. Remove no longed used method. * not sure about the chinese translation so I remove them * Revert "not sure about the chinese translation so I remove them" This reverts commit 54017513c7b684494cf06184b4051a4dcfc43850.
2020-11-25 11:08:12 +08:00
public string Placeholder { get; set; } = "Select date";
public string YearPlaceholder { get; set; } = "Select year";
public string QuarterPlaceholder { get; set; } = "Select quarter";
public string MonthPlaceholder { get; set; } = "Select month";
public string WeekPlaceholder { get; set; } = "Select week";
public string[] RangePlaceholder { get; set; } = new[] { "Start date", "End date" };
public string[] RangeYearPlaceholder { get; set; } = new[] { "Start year", "End year" };
public string[] RangeMonthPlaceholder { get; set; } = new[] { "Start month", "End month" };
public string[] RangeWeekPlaceholder { get; set; } = new[] { "Start week", "End week" };
public string Locale { get; set; } = "en_US";
public string Today { get; set; } = "Today";
public string Now { get; set; } = "Now";
public string BackToToday { get; set; } = "Back to today";
public string Ok { get; set; } = "Ok";
public string Clear { get; set; } = "Clear";
public string Month { get; set; } = "Month";
public string Year { get; set; } = "Year";
public string TimeSelect { get; set; } = "select time";
public string DateSelect { get; set; } = "select date";
public string WeekSelect { get; set; } = "Choose a week";
public string MonthSelect { get; set; } = "Choose a month";
public string YearSelect { get; set; } = "Choose a year";
public string DecadeSelect { get; set; } = "Choose a decade";
public string MonthFormat { get; set; } = "MMM";
public string YearMonthFormat { get; set; } = "yyyy-MM";
feat(module: date-picker): support localization (#803) * start trying to add a different first day of the week based on localization. * add first day of week parameter and get weekday local from .net * fix some issues * extend demo * remove no longed needed Locale parameter * fix range for selection * add german localization * add entry for API section * remove obsolet things from the react ant documentation * add description to chart documentation * translate general configuration to english. * code cleanup * use LocalProvider to get first day of week. * use localeprovider instead of date picker localization * remove no longer used parameter * delete no longer used interface * change from enum to string due to parsing issue. * add missing formats and use culture info from localprovider * correct locales * us Sunday as a default * remove no longer used culture info parameter * adjust locales * add parameter for Locale instead of directly accessing it. * add inheritance to access locale * typo * readd culture info parameter * fixes for locale jsons * adjust demo and api * small adjustments on docs, set monday in chinese as first day of the week. * use locale in calendar as well. * adjust docs * use enum * adjust demo * adjust for different starting date. * add defaults for DatePickerLocale * add short week days to locale files * use days from locale file * code cleanup use consts instead of magic numbers, add code comment and use dayOfWeek As param instead of the whole locale object. Remove no longed used method. * not sure about the chinese translation so I remove them * Revert "not sure about the chinese translation so I remove them" This reverts commit 54017513c7b684494cf06184b4051a4dcfc43850.
2020-11-25 11:08:12 +08:00
public string DateFormat { get; set; } = "yyyy-MM-dd";
public string DayFormat { get; set; } = "D";
public string TimeFormat { get; set; } = "HH:mm:ss";
feat(module: date-picker): support localization (#803) * start trying to add a different first day of the week based on localization. * add first day of week parameter and get weekday local from .net * fix some issues * extend demo * remove no longed needed Locale parameter * fix range for selection * add german localization * add entry for API section * remove obsolet things from the react ant documentation * add description to chart documentation * translate general configuration to english. * code cleanup * use LocalProvider to get first day of week. * use localeprovider instead of date picker localization * remove no longer used parameter * delete no longer used interface * change from enum to string due to parsing issue. * add missing formats and use culture info from localprovider * correct locales * us Sunday as a default * remove no longer used culture info parameter * adjust locales * add parameter for Locale instead of directly accessing it. * add inheritance to access locale * typo * readd culture info parameter * fixes for locale jsons * adjust demo and api * small adjustments on docs, set monday in chinese as first day of the week. * use locale in calendar as well. * adjust docs * use enum * adjust demo * adjust for different starting date. * add defaults for DatePickerLocale * add short week days to locale files * use days from locale file * code cleanup use consts instead of magic numbers, add code comment and use dayOfWeek As param instead of the whole locale object. Remove no longed used method. * not sure about the chinese translation so I remove them * Revert "not sure about the chinese translation so I remove them" This reverts commit 54017513c7b684494cf06184b4051a4dcfc43850.
2020-11-25 11:08:12 +08:00
public string DateTimeFormat { get; set; } = "yyyy-MM-dd HH:mm:ss";
public bool MonthBeforeYear { get; set; } = true;
public string PreviousMonth { get; set; } = "Previous month (PageUp)";
public string NextMonth { get; set; } = "Next month (PageDown)";
public string PreviousYear { get; set; } = "Last year (Control + left)";
public string NextYear { get; set; } = "Next year (Control + right)";
public string PreviousDecade { get; set; } = "Last decade";
public string NextDecade { get; set; } = "Next decade";
public string PreviousCentury { get; set; } = "Last century";
public string NextCentury { get; set; } = "Next century";
public string YearFormat { get; set; } = "yyyy";
public string StartDate { get; set; } = "Start date";
public string StartWeek { get; set; } = "Start week";
public string StartMonth { get; set; } = "Start month";
public string StartYear { get; set; } = "Start year";
public string StartQuarter { get; set; } = "Start quarter";
public string EndDate { get; set; } = "End date";
public string EndWeek { get; set; } = "End week";
public string EndMonth { get; set; } = "End month";
public string EndYear { get; set; } = "End year";
public string EndQuarter { get; set; } = "End Quarter";
public string QuarterSelect { get; set; } = "Select quarter";
public string Week { get; set; } = "Week";
public string[] ShortWeekDays { get; set; } = new string[] { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" };
}
}