I am doing UWP application for non English users. I need to use DatePicker but I don't like that the months' names are written in English, I also dont want to show month with their numeral values. How can I set my own list of string to show it on the months picker?
问题:
回答1:
If you change the region from english to spanish or someone else region then the months names is to be changed to spanish language or someone else language. This mean the name for months and day like Fri, Mon, etc, Is get the name from region. And is not fixed with the english name.
UPDATE:
Try to put this somewhere when is after or before InitializeComponent();
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("ka-GE"); // Georgia culture code. I'm not sure this is correct.
回答2:
As I known, the DatePicker
does not provide the mechanism of custom own strings for month.
If you want to use Georgian in your app, you don't need to custom string for month. The DatePicker
support Globalization and localization.
You can specify the supported languages in the app's manifest. To modify app's manifest, we can select the "Package.appxmanifest" in "Solution Explorer" and right click, then select "View Code".
For example:
<Resources>
<Resource Language="ka-ge" />
<Resource Language="en-us" />
</Resources>
When the user sets in Settings > Time & language > Region & language, add Georgian language and Set as default.
The month in DatePicker
will show in Georgian.