const char *BLT_translate_do(const char *msgctxt, const char *msgid)
{
#ifdef WITH_INTERNATIONAL
	if (BLT_translate()) {
		return BLT_pgettext(msgctxt, msgid);
	}
	else {
		return msgid;
	}
#else
	(void)msgctxt;
	return msgid;
#endif
}
Example #2
0
/* Get the current locale (short code, e.g. es_ES). */
const char *BLT_lang_get(void)
{
#ifdef WITH_INTERNATIONAL
	if (BLT_translate()) {
		const char *locale = LOCALE(ULANGUAGE);
		if (locale[0] == '\0') {
			/* Default locale, we have to find which one we are actually using! */
			locale = bl_locale_get();
		}
		return locale;
	}
	return "en_US";  /* Kind of default locale in Blender when no translation enabled. */
#else
	return "";
#endif
}