Forum Stats

  • 3,769,827 Users
  • 2,253,026 Discussions
  • 7,875,217 Comments

Discussions

i18n capitalization of month and weekdays

843807
843807 Member Posts: 46,582
edited Oct 15, 2002 4:09PM in Java Desktop Applications
Hi all,

I ran into the following with JDK1.4.0 on Windows (have not tested on other platforms): basically when I try to format dates in a language other than Windows, weekdays and month names are given all in small case letters, as opposed to having the first letter capitalized and all the others in small letters.

As an example, if I set my locale to Spanish, and do this:
SimpleDateFormat globalMessagesFormatter
= new SimpleDateFormat ("EEEE MMM dd yyyy", locale);

I get this: lunes oct 07 2002
As opposed to this: Lunes Oct 07 2002
(notice "lunes" and "oct" instead of "Lunes" and "Oct").

So, any ideas??? Is this a i18n bug???

Comments

  • 843807
    843807 Member Posts: 46,582
    No, it's not an i18n bug. In Spanish, names used in dates are not capitalized like for example in the English language. I extracted the following from the "Real Academia Espanola" which is the organization that set the rules for the Spanish language:

    b) El sistema mas comun combina letras y numeros. En este caso, el dia y el ano se escriben con numeros arabigos, y el mes, con letras y siempre con inicial minuscula: 12 de octubre de 1492.


    So, using: SimpleDateFormat("EEEE MMM dd yyyy", locale);
    gave you the correct format for the date (the spanish way, obviously).

    Based on your name, I am assuming that you speak spanish, so here is the link: http://www.rae.es/
    Use the "Diccionario de Dudas" option and search for letter "F" and click on "FECHA".
This discussion has been closed.