Can I get localized abbreviations for temporary parameters using C # in ASP.NET?

I am writing for ASP.NET using C #, and I was wondering if it is possible to get the following words in their localized form (preferably abbreviated)?

  • Second
  • a minute
  • hour
  • day
  • a week
  • Month
  • Year
+6
source share
2 answers

You can localize some temporary parts using:

  • CultureInfo.DateTimeFormat.GetDayName
  • CultureInfo.DateTimeFormat.GetAbbreviatedDayName
  • CultureInfo.DateTimeFormat.GetMonthName
  • CultureInfo.DateTimeFormat.GetAbbreviatedMonthName

I created a custom implementation of TimeCalendar with the ITimeFormatter provider (GetDuration method) in the Time Library for .NET . It uses a resource file to localize temporary parts.

+4
source

The .Net runtime does not include localized versions of these words. You will need to provide them yourself.

+2
source

Source: https://habr.com/ru/post/924821/


All Articles