3
package linguagem;
import java.util.*;
public class Linguagem {
public static void main(String[] args) {
Locale locale = new Locale("PORTUGUESE", "PT");
System.out.println("Linguagem: " + locale.getDisplayLanguage());
}
}
Then he returns portuguese
.
However, my system is in English, I need you to call me back english
.
Is there any way to auto detect the current system language?
Welcome to Stackoverflow in English. Whenever you have both the code and an image of the code, prefer to leave only the code, which is sufficient, as long as it is formatted correctly.
– Isac
An important detail is that
new Locale("PORTUGUESE", "PT")
nay returns a locale that corresponds to the Portuguese language. The problem is that the constructor does not validate the entry and accepts anything. Correct for Portuguese from Portugal isnew Locale("pt", "PT")
– hkotsubo