It's also a different take on the Help file example which uses Select...EndSelect.
Function:
; #FUNCTION# ==================================================================================================================== ; Name ..........: _GetOSLanguage ; Description ...: Retrieves the language of the OS, this supports 19 of the most popular languages. ; Syntax ........: _GetOSLanguage() ; Parameters ....: None ; Return values .: OS language ; Author ........: guinness ; Link ..........: http://www.autoitscript.com/forum/topic/131832-getoslanguage-retrieve-the-language-of-the-os/ ; Example .......: Yes ; =============================================================================================================================== Func _GetOSLanguage() Local Const $aString[20] = [19, $LANG_ENGLISH, $LANG_CHINESE, $LANG_DANISH, $LANG_DUTCH, $LANG_ESTONIAN, $LANG_FINNISH, $LANG_FRENCH, $LANG_GERMAN, _ $LANG_HUNGARIAN, $LANG_ITALIAN, $LANG_JAPANESE, $LANG_NORWEGIAN, $LANG_POLISH, $LANG_PORTUGUESE, $LANG_ROMANIAN, $LANG_RUSSIAN, _ $LANG_SERBIAN, $LANG_SPANISH, $LANG_SWEDISH], _ $aLanguage[20] = [19, 'English', 'Chinese', 'Danish', 'Dutch', 'Estonian', 'Finnish', 'French', 'German', _ 'Hungarian', 'Italian', 'Japanese', 'Norwegian', 'Polish', 'Portuguese', 'Romanian', 'Russian', _ 'Serbian', 'Spanish', 'Swedish'], _ $iOSLang = Dec(StringRight(@OSLang, 2)) ; @OSLang is four characters in length, the first two is the dialect and the remaining is the language. Thanks GEOSoft. For $i = 1 To $aString[0] If $iOSLang = $aString[$i] Then $aLanguage[1] = $aLanguage[$i] ExitLoop EndIf Next Return $aLanguage[1] EndFunc ;==>_GetOSLanguage
Example use of Function:
Edited by guinness, 31 January 2013 - 12:23 PM.







