cocos2dx入门之获取当前语言环境

很多时候需要将游戏国际化,这个时候需要知道系统语言了,以下代码可以获取当前语言环境。

ccLanguageType currentLanguageType = CCApplication::sharedApplication()->getCurrentLanguage();
		switch (currentLanguageType)
		{
		case kLanguageEnglish:
			//do something
			break;
		case kLanguageChinese:
			//do something
			break;
		case kLanguageFrench:
			//do something
			break;
		case kLanguageGerman:
			//do something
			break;
		case kLanguageItalian:
			//do something
			break;
		case kLanguageRussian:
			//do something
			break;
		case kLanguageSpanish:
			//do something
			break;
		case kLanguageKorean:
			//do something
			break;
		}


你可能感兴趣的:(语言,国际化,cocos2dx)