File tree Expand file tree Collapse file tree 3 files changed +21
-13
lines changed
main/java/com/graphhopper/util
test/java/com/graphhopper/util Expand file tree Collapse file tree 3 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 12
12
matrix :
13
13
include :
14
14
- jdk : openjdk8
15
- - env : JDK='OpenJDK 16'
16
- install : . ./install-jdk.sh -F 16 -C --url 'https://api.adoptopenjdk.net/v3/binary/latest/16/ga/linux/x64/jdk/hotspot/normal/adoptopenjdk'
17
15
- env : JDK='OpenJDK 17'
18
- install : . ./install-jdk.sh -F 17 -C --url 'https://api.adoptopenjdk.net/v3/binary/latest/17/ea/linux/x64/jdk/hotspot/normal/adoptopenjdk'
16
+ install : . ./install-jdk.sh -F 17 -C
17
+ - env : JDK='OpenJDK 18'
18
+ install : . ./install-jdk.sh -F ea -C
19
19
20
20
# avoid default dependency command for maven, 'true' means 'return true' and continue
21
21
install : true
Original file line number Diff line number Diff line change @@ -85,14 +85,18 @@ public void add(Translation tr) {
85
85
if (!locale .getCountry ().isEmpty () && !translations .containsKey (tr .getLanguage ()))
86
86
translations .put (tr .getLanguage (), tr );
87
87
88
- // Map old Java 'standard' to latest, Java is a bit ugly here: http://stackoverflow.com/q/13974169/194609
89
- // Hebrew
90
- if ("iw" .equals (locale .getLanguage ()))
91
- translations .put ("he" , tr );
92
-
93
- // Indonesia
94
- if ("in" .equals (locale .getLanguage ()))
95
- translations .put ("id" , tr );
88
+ // Hebrew locale was "iw" in old JDKs but is now he
89
+ // required in old JDKs:
90
+ if ("iw" .equals (locale .getLanguage ())) translations .put ("he" , tr );
91
+ // required since jdk17 to still provide translation for "iw":
92
+ if ("he" .equals (locale .getLanguage ())) translations .put ("iw" , tr );
93
+
94
+ // Indonesia locale was "in_ID" in old JDKs but is now id_ID
95
+ // required in old JDKs:
96
+ if ("in" .equals (locale .getLanguage ())) translations .put ("id" , tr );
97
+ // required since jdk17 to still provide translation for "in":
98
+ if ("id" .equals (locale .getLanguage ())) translations .put ("in" , tr );
99
+ // Indian locales are: en-IN and hi-IN and are not overwritten by that
96
100
}
97
101
98
102
/**
Original file line number Diff line number Diff line change 19
19
20
20
import org .junit .jupiter .api .Test ;
21
21
22
+ import java .util .Arrays ;
22
23
import java .util .Locale ;
23
24
24
25
import static org .junit .jupiter .api .Assertions .assertEquals ;
@@ -60,8 +61,11 @@ public void testToString() {
60
61
assertEquals ("רגל" , trMap .tr ("web.FOOT" ));
61
62
62
63
// Indonesian
63
- assertEquals ("in" , SINGLETON .get ("in" ).getLanguage ());
64
- assertEquals ("in" , SINGLETON .get ("in_ID" ).getLanguage ());
64
+ // for jdk17 and later "id" is returned, before "in" was returned
65
+ String lang = SINGLETON .get ("id" ).getLanguage ();
66
+ assertTrue (Arrays .asList ("id" , "in" ).contains (lang ));
67
+ assertEquals (lang , SINGLETON .get ("in" ).getLanguage ());
68
+ assertEquals (lang , SINGLETON .get ("in_ID" ).getLanguage ());
65
69
66
70
// Vietnamese
67
71
assertEquals ("vi" , SINGLETON .get ("vi" ).getLanguage ());
You can’t perform that action at this time.
0 commit comments