Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the phone language with libgdx?

I'm tyring to set a default language for my game and I would like it to be the phone's language, the question is: how can I get the phone's language?

like image 937
Javier Diaz Avatar asked Dec 11 '22 06:12

Javier Diaz


1 Answers

In my last game I used the default locale of the JVM:

java.util.Locale.getDefault().toString();

to get the device language. That seemed to work fine for Android as well.

like image 188
donfuxx Avatar answered Dec 24 '22 11:12

donfuxx