Commit 7f7d3d0
committed
Adapt locales support for GraalVM >= 24.2
Starting with GraalVM for JDK 24 (24.2) native image will no longer set
the locale default at build time. As a result, the default locale won't
be included by default in the native image unless explicitly specified.
As discussed in
quarkusio#43533 (reply in thread)
this patch updates the locales support so that:
- if neither `quarkus.locales` nor `quarkus.default-locale` is set, the
Quarkus applications should default to English (`en_US`), instead of the
build systems locale (which is the current behavior), at run-time.
- if `quarkus.default-locale` is set but `quarkus.locales` is not set,
then we should only include the locale `quarkus.default-locale` is set
to. This is the current behavior with GraalVM for JDK 21.
- if both `quarkus.default-locale` and `quarkus.locales` are set, then
we should include only the locales from `quarkus.locales` and the one
from `quarkus.default-locale` (this is the current behavior).
- if `quarkus.locales` is set but `quarkus.default-locale` is not set,
then we should include only the locales from `quarkus.locales` and
default to English, instead of the build systems locale (which is the
current behavior), at run-time (similarly to point 1).
- if `quarkus.default-locale` (which is build time fixed) is set, it is used to set the default `user.language` and `user.country` values at run-time, while users may still override them.
For points 2 and 3 starting with graalVM for JDK 24 we also include
`en_US` which shouldn't be a big issue as mentioned in
quarkusio#43533 (reply in thread),
CAUTION: Point 1 changes the current behavior, meaning we need to
clearly document and communicate it.
This patch also updates the Locales integration tests accordingly.
See oracle/graal#96941 parent 7273685 commit 7f7d3d0
File tree
24 files changed
+358
-41
lines changed- .github
- core
- deployment/src/main/java/io/quarkus/deployment
- pkg
- steps
- steps
- runtime/src/main/java/io/quarkus/runtime
- extensions
- hibernate-validator/runtime/src/main/java/io/quarkus/hibernate/validator/runtime
- qute
- deployment/src/main/java/io/quarkus/qute/deployment
- runtime/src/main/java/io/quarkus/qute/runtime
- integration-tests/locales
- all/src/test
- java/io/quarkus/locales/it
- resources
- default
- src
- main/java/io/quarkus/locales/it
- test
- java/io/quarkus/locales/it
- resources
- some/src/test
- java/io/quarkus/locales/it
- resources
- test-framework/junit5/src/main/java/io/quarkus/test/junit
24 files changed
+358
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
103 | | - | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
194 | 196 | | |
195 | 197 | | |
196 | 198 | | |
| |||
Lines changed: 0 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | 749 | | |
759 | 750 | | |
760 | 751 | | |
| |||
Lines changed: 40 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
62 | 80 | | |
63 | 81 | | |
64 | 82 | | |
| |||
80 | 98 | | |
81 | 99 | | |
82 | 100 | | |
83 | | - | |
| 101 | + | |
| 102 | + | |
84 | 103 | | |
85 | 104 | | |
86 | 105 | | |
| |||
93 | 112 | | |
94 | 113 | | |
95 | 114 | | |
| 115 | + | |
96 | 116 | | |
| 117 | + | |
97 | 118 | | |
98 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
99 | 123 | | |
100 | 124 | | |
101 | 125 | | |
| |||
112 | 136 | | |
113 | 137 | | |
114 | 138 | | |
| 139 | + | |
115 | 140 | | |
| 141 | + | |
116 | 142 | | |
117 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
118 | 147 | | |
119 | 148 | | |
120 | 149 | | |
| |||
124 | 153 | | |
125 | 154 | | |
126 | 155 | | |
127 | | - | |
| 156 | + | |
128 | 157 | | |
129 | 158 | | |
130 | 159 | | |
| |||
139 | 168 | | |
140 | 169 | | |
141 | 170 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
145 | 174 | | |
146 | | - | |
| 175 | + | |
147 | 176 | | |
148 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
149 | 180 | | |
150 | 181 | | |
151 | 182 | | |
152 | | - | |
153 | 183 | | |
154 | 184 | | |
155 | 185 | | |
| |||
Lines changed: 46 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
38 | 49 | | |
39 | 50 | | |
40 | 51 | | |
| |||
58 | 69 | | |
59 | 70 | | |
60 | 71 | | |
61 | | - | |
62 | 72 | | |
63 | 73 | | |
64 | 74 | | |
65 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
| |||
81 | 93 | | |
82 | 94 | | |
83 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
84 | 128 | | |
85 | 129 | | |
86 | 130 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | | - | |
50 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
1417 | 1418 | | |
1418 | 1419 | | |
1419 | 1420 | | |
1420 | | - | |
| 1421 | + | |
1421 | 1422 | | |
1422 | 1423 | | |
1423 | 1424 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
0 commit comments