I have had a look at setlocale but I am struggling to find what I am looking for.
In my code I have:
void CMeetingScheduleAssistantApp::SetLocale()
{
CString strLang[NUM_LANGUAGES] =
{
_T("eng"), _T("deu"), _T("esp"), _T("ita"),
_T("plk"), _T("fra"), _T("ptb"), _T("nld"),
_T("sve"), _T("slv"), _T("csy"), _T("fin"),
_T("dan"), _T("ukr"), _T("rus"),
_T("eng"), /*_T("fpo") Tagalog */
_T("eng"), /* Haitian Creole */
_T("eng"), /* Afrikaans */
_T("sqi"),
_T("chs"), /* Chinese (Simplified) */
_T("hrv"),
_T("trk"),
_T("eng"), /* Twi */
_T("swk"), // AJT v11.3.4
_T("eng"), // _T("eti") Estonian AJT v12.0.5
_T("rom"), // Romanian AJT v12.0.8
_T("ell"), // Greek AJT v13.0.0
_T("bgr"), // Bulgarian AJT v13.0.2
_T("eng"), // Malagasy AJT v14.0.4
_T("ara"), // Arabic AJT v16.0.0
_T("ind"), // Indonesian AJT v16.0.2
_T("hin"), // Hindi AJT v16.0.7
_T("tai"), // Tamil AJT v16.1.0
_T("vit"), // Vietnamese v16.1.1
_T("eng"), // Zulu AJT v16.1.6
_T("eng"), // Gun AJT v17.0.9
_T("ln-CG"), // Lingala v17.0.9
_T("ptg") // Portuguese Portugal v17.1.0
// Add more languages here
};
_tsetlocale(LC_ALL, strLang[m_eLanguage - LANGUAGE_ENGLISH]);
}
This has done and always works OK. Dates format correct after making this call.
But looking at the links provided with the aforementioned help topic I can't find codes like ptb
etc. listed. Only pt-BR
.
I assume my codes are still valid and are they documented anywhere?
setlocale expects a locale name as documented under Locale Names, Languages, and Country/Region Strings. A locale can be identified by locale name:
A locale name is based on the language tagging conventions of RFC 4646 (Windows Vista and later), and is represented by LOCALE_SNAME. Generally, the pattern <language>-<REGION> is used. Here, language is a lowercase ISO 639 language code. The codes from ISO 639-1 are used when available. Otherwise, codes from ISO 639-2/T are used.
[...]
If the locale is a neutral locale (no region), the LOCALE_SNAME value follows the pattern <language>.
A complete list of ISO 639-2 three-letter language codes is published at wikipedia.