Correct locales logic to get some kind of ISO 639-3 support, update pom, make ja_ryu appear (unfortunately as 'Japanese' language and not as 'Central Okinawan')
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9aa4551ef0
commit
8b23b8967b
5 changed files with 15 additions and 15 deletions
|
@ -55,7 +55,9 @@ Sometimes I add new posts about this project [on my blog page](https://developer
|
||||||
* Czech by [Spenaat](https://github.com/spenaat)
|
* Czech by [Spenaat](https://github.com/spenaat)
|
||||||
* Arabic by [eslamabdel](https://github.com/eslamabdel)
|
* Arabic by [eslamabdel](https://github.com/eslamabdel)
|
||||||
* Romanian by [Călin Ilie](https://github.com/calini)
|
* Romanian by [Călin Ilie](https://github.com/calini)
|
||||||
* Swedish by [Daniel Nylander](https://github.com/yeager) - (coming soon)
|
* Swedish by [Daniel Nylander](https://github.com/yeager)
|
||||||
|
* Japanese by [kuragehime](https://github.com/kuragehimekurara1)
|
||||||
|
* Ryukyuan languages by [kuragehime](https://github.com/kuragehimekurara1)
|
||||||
|
|
||||||
### System requirements
|
### System requirements
|
||||||
|
|
||||||
|
@ -71,7 +73,7 @@ JDK 11 for MacOS and Linux
|
||||||
| v0.6.1 | v0.6 |
|
| v0.6.1 | v0.6 |
|
||||||
| v0.7 - 0.7.3 | v0.7+ |
|
| v0.7 - 0.7.3 | v0.7+ |
|
||||||
| v0.8 - 0.9 | v1.0+ |
|
| v0.8 - 0.9 | v1.0+ |
|
||||||
| v0.10 | v6.0 |
|
| v0.10 | v6.0+ |
|
||||||
|
|
||||||
where '+' means 'any next NS-USBloader version'.
|
where '+' means 'any next NS-USBloader version'.
|
||||||
|
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -8,7 +8,7 @@
|
||||||
<name>NS-USBloader</name>
|
<name>NS-USBloader</name>
|
||||||
|
|
||||||
<artifactId>ns-usbloader</artifactId>
|
<artifactId>ns-usbloader</artifactId>
|
||||||
<version>6.1</version>
|
<version>6.2</version>
|
||||||
|
|
||||||
<url>https://redrise.ru</url>
|
<url>https://redrise.ru</url>
|
||||||
<description>
|
<description>
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class AppPreferences {
|
||||||
private AppPreferences(){
|
private AppPreferences(){
|
||||||
this.preferences = Preferences.userRoot().node("NS-USBloader");
|
this.preferences = Preferences.userRoot().node("NS-USBloader");
|
||||||
String localeCode = preferences.get("locale", Locale.getDefault().toString());
|
String localeCode = preferences.get("locale", Locale.getDefault().toString());
|
||||||
this.locale = new Locale(localeCode.substring(0, 2), localeCode.substring(3, 5));
|
this.locale = new Locale(localeCode.substring(0, 2), localeCode.substring(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTheme(){
|
public String getTheme(){
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2019-2020 Dmitry Isaenko
|
Copyright 2019-2022 Dmitry Isaenko
|
||||||
|
|
||||||
This file is part of NS-USBloader.
|
This file is part of NS-USBloader.
|
||||||
|
|
||||||
|
@ -26,16 +26,14 @@ public class LocaleHolder {
|
||||||
private final String localeCode;
|
private final String localeCode;
|
||||||
private final String languageName;
|
private final String languageName;
|
||||||
|
|
||||||
public LocaleHolder(Locale locale){
|
|
||||||
this.locale = locale;
|
|
||||||
this.localeCode = locale.toString();
|
|
||||||
this.languageName = locale.getDisplayLanguage(locale) + " (" + locale + ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocaleHolder(String localeFileName) {
|
public LocaleHolder(String localeFileName) {
|
||||||
String country = localeFileName.substring(7, 9);
|
String language = localeFileName.substring(7, 9);
|
||||||
String language = localeFileName.substring(10, 12);
|
String country;
|
||||||
this.locale = new Locale(country, language);
|
if (localeFileName.length() > 23) // ISO 639-3 not supported by Java
|
||||||
|
country = localeFileName.substring(10, localeFileName.indexOf('.'));
|
||||||
|
else // ISO 639-1
|
||||||
|
country = localeFileName.substring(10, 12);
|
||||||
|
this.locale = new Locale(language, country);
|
||||||
this.localeCode = locale.toString();
|
this.localeCode = locale.toString();
|
||||||
this.languageName = locale.getDisplayLanguage(locale) + " (" + locale + ")";
|
this.languageName = locale.getDisplayLanguage(locale) + " (" + locale + ")";
|
||||||
}
|
}
|
||||||
|
@ -47,7 +45,7 @@ public class LocaleHolder {
|
||||||
|
|
||||||
public String getLocaleCode(){
|
public String getLocaleCode(){
|
||||||
return localeCode;
|
return localeCode;
|
||||||
};
|
}
|
||||||
|
|
||||||
public Locale getLocale() {
|
public Locale getLocale() {
|
||||||
return locale;
|
return locale;
|
||||||
|
|
Loading…
Reference in a new issue