UWP DatePicker custom strings for month

匆匆过客 提交于 2019-12-06 12:35:29

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!