1

How can I request the Java developers to add support for my home language Afrikaans - South Africa? Especially to get the correct labels when formatting a date (month names etc.)

Alternatively, is it possible for me to add my own implementation of my home language to my Java-EE project?

Users can dynamically switch between languages and I like Java's support for English, French, German, etc.

English: works great!

new SimpleDateFormat("dd MMMM yyyy", new Locale("en_US")).format(new Date());

Afrikaans: returns English labels too.

new SimpleDateFormat("dd MMMM yyyy", new Locale("af_ZA")).format(new Date());
Max
  • 1,107
  • 12
  • 24
  • I found a similar requirement here: http://stackoverflow.com/questions/7743435/how-to-modify-dateformatsymbols-month-values – Max May 12 '17 at 20:19

2 Answers2

0

Check out the method SimpleDateFormat#setDateFormatSymbols(). There you will find that you can set your completely customized set of localized configuration data. There's also a constructor available to set them at construction time.

For even wider localization support you should check out the extensive documentation on the Locale class.

Marko Topolnik
  • 195,646
  • 29
  • 319
  • 436
0

You can add support for any locale you want with http://docs.oracle.com/javase/tutorial/i18n/locale/services.html

Or you can use ICU4J, much better.

But there is something weird with your code. Does new SimpleDateFormat("dd MMMM yyyy", "af_ZA") even build? There is no SimpleDateFormat(String, String) constructor. http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html

Mihai

Mihai Nita
  • 5,547
  • 27
  • 27