Details
-
Bug
-
Resolution: Fixed
-
P4
-
11, 14
-
None
-
Mac OS/X
-
b23
-
x86_64
-
os_x
Description
FULL PRODUCT VERSION :
openjdk version "14-ea" 2020-03-17
OpenJDK Runtime Environment (build 14-ea+17-721)
OpenJDK 64-Bit Server VM (build 14-ea+17-721, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Mac OS/X
A DESCRIPTION OF THE PROBLEM :
Even if OS sets Japanese language and Japanese calendar,
Host Locale Provider on Mac returns English strings.
Default Locale provider (CLDR) can show translated strings.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Open OS setting of language and region
Set Japanese to Language.
Set Japanese imperial calendar to Calendar.
2. Execute the following sample code
% jshell -R-Djava.locale.providers=HOST
import java.text.DateFormat
var calendar = Calendar.getInstance()
var df = DateFormat.getDateInstance(DateFormat.FULL, Locale.getDefault())
df.format(calendar.getTime())
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected:
The values of Era and Day of week are translated.
Actual:
% jshell -R-Djava.locale.providers=HOST
jshell> import java.text.DateFormat
jshell> var calendar = Calendar.getInstance()
calendar ==> java.util.JapaneseImperialCalendar[time=157181987 ... SET=32400000,DST_OFFSET=0]
jshell> var df = DateFormat.getDateInstance(DateFormat.FULL, Locale.getDefault())
df ==> java.text.SimpleDateFormat@de9db2c9
jshell> df.format(calendar.getTime())
$4 ==> "Reiwa1年10月23日 Wednesday"
The values of Era and Day of week are in English.
REPRODUCIBILITY :
This bug can be reproduced always.
openjdk version "14-ea" 2020-03-17
OpenJDK Runtime Environment (build 14-ea+17-721)
OpenJDK 64-Bit Server VM (build 14-ea+17-721, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Mac OS/X
A DESCRIPTION OF THE PROBLEM :
Even if OS sets Japanese language and Japanese calendar,
Host Locale Provider on Mac returns English strings.
Default Locale provider (CLDR) can show translated strings.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Open OS setting of language and region
Set Japanese to Language.
Set Japanese imperial calendar to Calendar.
2. Execute the following sample code
% jshell -R-Djava.locale.providers=HOST
import java.text.DateFormat
var calendar = Calendar.getInstance()
var df = DateFormat.getDateInstance(DateFormat.FULL, Locale.getDefault())
df.format(calendar.getTime())
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected:
The values of Era and Day of week are translated.
Actual:
% jshell -R-Djava.locale.providers=HOST
jshell> import java.text.DateFormat
jshell> var calendar = Calendar.getInstance()
calendar ==> java.util.JapaneseImperialCalendar[time=157181987 ... SET=32400000,DST_OFFSET=0]
jshell> var df = DateFormat.getDateInstance(DateFormat.FULL, Locale.getDefault())
df ==> java.text.SimpleDateFormat@de9db2c9
jshell> df.format(calendar.getTime())
$4 ==> "Reiwa1年10月23日 Wednesday"
The values of Era and Day of week are in English.
REPRODUCIBILITY :
This bug can be reproduced always.