Aug 20, 2024
Locale
.Locale
:
Locale locale = new Locale("id", "ID");
getLanguage()
getCountry()
getDisplayLanguage()
getDisplayCountry()
hello=hello
goodbye=goodbye
ResourceBundle
:
ResourceBundle bundle = ResourceBundle.getBundle("message");
String hello = bundle.getString("hello");
message_in_ID.properties
untuk bahasa Indonesia.message.properties
.SimpleDateFormat
.SimpleDateFormat
:
SimpleDateFormat sdf = new SimpleDateFormat("EEEE dd MMMM yyyy", Locale.forLanguageTag("id-ID"));
Date
dan sebaliknya sudah didukung.String formattedDate = sdf.format(new Date());
Date date = sdf.parse("Rabu 3 Maret 2021");
Locale
, ResourceBundle
, dan SimpleDateFormat
membantu dalam implementasi I18N.