Since the official API interface does not provide the function of obtaining the system language, I tried to use JavaScript, and the test code is as follows:

var JsSrc1 = navigator.language

var JsSrc2 = navigator.browserLanguage;

alert(JsSrc1+"|"+JsSrc2);
Copy the code

 

Output when using Android+ English system:

en-US|undefined

Output when using IOS+ Chinese system:

zh-CN|undefined

Var JsSrc1 = navigator. Language; var JsSrc1 = navigator. To obtain apicloud platform system language compatible with Android and IOS. The following simplified code to achieve the judgment system language for our use:

var JsSrc1 = navigator.language;

if (JsSrc1 == "zh-CN") {}else if (JsSrc1 == "en-US") {}else{}Copy the code

 

Reference: JavaScript’s way of getting the browser language