mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
Merge pull request #1784 from knoxHuang/v2.1.3
improve getCurrentLanguage to android
This commit is contained in:
@@ -128,8 +128,7 @@ void Application::setPreferredFramesPerSecond(int fps)
|
||||
|
||||
std::string Application::getCurrentLanguageCode() const
|
||||
{
|
||||
std::string language = getCurrentLanguageJNI();
|
||||
return language;
|
||||
return getCurrentLanguageCodeJNI();
|
||||
}
|
||||
|
||||
bool Application::isDisplayStats() {
|
||||
|
||||
@@ -305,7 +305,11 @@ public class Cocos2dxHelper {
|
||||
public static String getCurrentLanguage() {
|
||||
return Locale.getDefault().getLanguage();
|
||||
}
|
||||
|
||||
|
||||
public static String getCurrentLanguageCode() {
|
||||
return Locale.getDefault().toString();
|
||||
}
|
||||
|
||||
public static String getDeviceModel(){
|
||||
return Build.MODEL;
|
||||
}
|
||||
|
||||
@@ -599,6 +599,11 @@ std::string getCurrentLanguageJNI()
|
||||
return JniHelper::callStaticStringMethod(JCLS_HELPER, "getCurrentLanguage");
|
||||
}
|
||||
|
||||
std::string getCurrentLanguageCodeJNI()
|
||||
{
|
||||
return JniHelper::callStaticStringMethod(JCLS_HELPER, "getCurrentLanguageCode");
|
||||
}
|
||||
|
||||
std::string getSystemVersionJNI()
|
||||
{
|
||||
return JniHelper::callStaticStringMethod(JCLS_HELPER, "getSystemVersion");
|
||||
|
||||
@@ -42,6 +42,7 @@ extern int getDeviceSampleRateJNI();
|
||||
extern int getDeviceAudioBufferSizeInFramesJNI();
|
||||
|
||||
extern std::string getCurrentLanguageJNI();
|
||||
extern std::string getCurrentLanguageCodeJNI();
|
||||
extern std::string getSystemVersionJNI();
|
||||
extern bool openURLJNI(const std::string& url);
|
||||
extern void copyTextToClipboardJNI(const std::string& text);
|
||||
|
||||
Reference in New Issue
Block a user