// caller needs to free() the result WCHAR *GetLanguageName(int langIdx) { assert(IsValidLangIdx(langIdx)); if (!IsValidLangIdx(langIdx)) return NULL; return str::conv::FromUtf8(gLangData[langIdx].fullName); }
bool IsLanguageRtL(int langIdx) { assert(IsValidLangIdx(langIdx)); if (!IsValidLangIdx(langIdx)) return false; return gLangData[langIdx].isRTL; }
// checks whether the language code is known and returns // a static pointer to the same code if so (else NULL) const char *ValidateLanguageCode(const char *code) { int index = GetLangIndexFromCode(code); if (IsValidLangIdx(index)) return gLangData[index].code; return NULL; }
// caller MUST NOT free the result const char *GetLanguageCode(int langIdx) { if (!IsValidLangIdx(langIdx)) return NULL; return gLangData[langIdx].code; }