Unity 3D Game Engine – Get OS Language

Inside Hierarchy create a scene with:

1. Main Camera

2. GUI Text, attach the script ‘GetLanguage.js’

GetLanguage.js

1
2
3
4
5
6
7
8
9
10
#pragma strict
 
function Start () {
    // Prints to a guiText the actual language that the system is using.
    guiText.text = Application.systemLanguage.ToString();
}
 
function Update () {
 
}

NOTICE ToString(); function that converts value to string.

The final result is: Italian