Hi.
Working on monthcal control I've realized that some locales could have 13 months calendars. How could I guess that I'm running such locale? After a brief look I didn't find anything useful in GetLocaleInfo().
"Nikolay Sivov" bunglehead@gmail.com wrote:
Working on monthcal control I've realized that some locales could have 13 months calendars. How could I guess that I'm running such locale? After a brief look I didn't find anything useful in GetLocaleInfo().
Check LOCALE_SMONTHNAME13/LOCALE_SABBREVMONTHNAME13?
Dmitry Timoshkov wrote:
"Nikolay Sivov" bunglehead@gmail.com wrote:
Working on monthcal control I've realized that some locales could have 13 months calendars. How could I guess that I'm running such locale? After a brief look I didn't find anything useful in GetLocaleInfo().
Check LOCALE_SMONTHNAME13/LOCALE_SABBREVMONTHNAME13?
Yes, maybe it's the only choice now. Anyway I checked all locale info in nls directory and it seems there's no support for that currently, so we always could assume 12.
Nikolay Sivov pisze:
Hi.
Working on monthcal control I've realized that some locales could have 13 months calendars. How could I guess that I'm running such locale? After a brief look I didn't find anything useful in GetLocaleInfo().
AFAIK the GetCalendarInfo() and EnumCalendarInfo() are for that. However, I have a faint recollection of a post on some blog that the monthcal control is not good for internationalization as it doesn't support non-Gregorian calendars. Thus, it may be worth checking if this is needed before using it.
Mikołaj
Mikołaj Zalewski wrote:
Nikolay Sivov pisze:
Hi.
Working on monthcal control I've realized that some locales could have 13 months calendars. How could I guess that I'm running such locale? After a brief look I didn't find anything useful in GetLocaleInfo().
AFAIK the GetCalendarInfo() and EnumCalendarInfo() are for that. However, I have a faint recollection of a post on some blog that the monthcal control is not good for internationalization as it doesn't support non-Gregorian calendars. Thus, it may be worth checking if this is needed before using it.
Mikołaj
If it does support Gregorian only there's nothing to worry about. Actually I don't know how to test this, if we're talking about some Asian locales like Chinese or Japanese are you experienced with that?
A best way will be to test under Linux with native comctl32 but I'm not sure builtin kernel32 (and maybe something else) is capable to support such locale features.
If it does support Gregorian only there's nothing to worry about. Actually I don't know how to test this, if we're talking about some Asian locales like Chinese or Japanese are you experienced with that?
A best way will be to test under Linux with native comctl32 but I'm not sure builtin kernel32 (and maybe something else) is capable to support such locale features.
The last time I checked (something like one year ago), our kernel32 calendar function were hardcoded for Gregorian Calendar. Thus, to check this, you would need native Windows, change the locale to several Asian or Arabic ones (in Regional Settings, this shouldn't change the UI language) and create a monthcal control. If it still displays a Gregorian calendar, then, I think, no implementation is necessary. You could also check if there is no monthcal message to choose the calendar (locales can support multiple calendars. But AFAIR all support also the Gregorian one), but I think I've been checking this once and there wasn't (however, I might have been checking the datetime control instead).
Mikołaj