Change a variable based on the system language

Any suggestions to change a variable based on the Language system of the Pc/phone? I need to make an automatic translation without the user chose it firstly