Fixed deprecation warnings on Locale constructor and editor viewToModel/modelToView

This commit is contained in:
Jindra Petřík
2023-11-05 21:11:10 +01:00
parent 8b3b740b44
commit 47a5d6f8dc
4 changed files with 152 additions and 30 deletions
@@ -51,6 +51,7 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.util.ArrayList;
@@ -1239,10 +1240,13 @@ public class Translator extends JFrame implements ItemListener {
public String toString() {
String[] parts = locale.split("_");
Locale loc;
if (parts.length == 2) {
loc = new Locale(parts[0], parts[1]);
if (parts.length == 2) {
loc = View.createLocale(parts[0], parts[1]);
} else {
loc = new Locale(parts[0]);
loc = View.createLocale(parts[0]);
}
String ret = loc.getDisplayName() + " [" + locale + "]";