MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to check on Mac OS which country or language is currently selected?
Feedback.

Answer: The code below returns a country value.
Example:
dim result as Integer

IF TargetMacOS THEN

CONST smScriptLang = 28
CONST smSystemScript = -1

DECLARE FUNCTION GetScriptManagerVariable LIB "Carbon" ( selector as Integer) as Integer
DECLARE FUNCTION GetScriptVariable LIB "Carbon" ( script as Integer, selector as Integer) as Integer

result=GetScriptVariable(smSystemScript, smScriptLang)

END IF
Notes:
Returns values like:

langEnglish0Roman script
langFrench1Roman script
langGerman2Roman script
langItalian3Roman script
langDutch4Roman script
langSwedish5Roman script
langSpanish6Roman script
langDanish7Roman script
langPortuguese8Roman script
langNorwegian9Roman script
langHebrew10Hebrew script
langJapanese11Japanese script
langArabic12Arabic script
langFinnish13Roman script
langGreek14Greek script using smRoman script code
langIcelandic15modified smRoman/Icelandic script
langMaltese16Roman script
langTurkish17modified smRoman/Turkish script
langCroatian18modified smRoman/Croatian script
langTradChinese19Chinese (Mandarin) in traditional characters
langUrdu20Arabic script
langHindi21Devanagari script
langThai22Thai script
langKorean23Korean script

For more values, check "Script.h" in the frameworks.




Links
MBS Xojo PDF Plugins