0

I am French and in a JSF application i use a french locale in a f:convertdatetime to translate the name of the months and the days of a date. However, all the names have their first letter in lowercase.

After some researches, i found the class where these translations are ( Java\jdk1.8.0_45\jre\lib\ext\localedata.jar\FormatData_fr.class ). I edited it with the java class file editor software and the file does appear edited in my IDE but when i launch my application, the translations always begin with a lowercase.

So i wonder what I did wrong and i would like some help to solve my issue.

Thanks =)

  • You cannot edit stuff from the JDK. A **dirty** solution would be to use class shadowing i.e. put a copy of the [class code (check version)](http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7u40-b43/sun/text/resources/FormatData_fr.java/) in a package named like the original class (here `sun.text.resources`) –  Dec 02 '15 at 18:12
  • Maybe a better solution: see http://www.coderanch.com/t/212573/JSF/java/simultaneously-Converters –  Dec 02 '15 at 18:15
  • It is typographically incorrect to write week-day and months names with an uppercase in French, unless they're starting a sentence. Why do you want to go against correctness? – Olivier Grégoire Dec 02 '15 at 18:15
  • Thank you RC, i am trying your method with the -Xbootclasspath/p: option (http://stackoverflow.com/questions/4838301/how-to-overwrite-classes-from-jdk) but it doesn't work, i might do something wrong. Olivier, I simply prefere write them this way =) – Littlemonster Dec 02 '15 at 20:12
  • @OlivierGrégoire peut-être qu'il est dans un cas du genre "Juin 2015" (des axes de graphs par ex.) –  Dec 02 '15 at 20:15
  • Ah mais vous êtes français ! Dans mon cas c'est pour afficher ce genre de sortie : "Vendredi 15 Décembre 2016 à 00:00" – Littlemonster Dec 02 '15 at 20:22
  • No, I'm not French. French people don't event represent 1/3 of francophonia. Plus, this is an English-speaking website. To answer, it's incorrect to write `Vendredi 15 Décembre 2016 à 00:00`. In correct French, one must write `Le vendredi 15 décembre 2016 à 00 h 00`, possibly `Vendredi 15 décembre 2016 à 00 h 00`. Hence my first question: why do you prefer something incorrect? In any case, you should write your own converter, and do NOT change the classes from your JDK, you'll only get bugs and broken things. – Olivier Grégoire Dec 02 '15 at 21:50
  • Désolé je voulais dire que vous parliez Français =) Sinon, s'agissant d'un projet personnel ne sortant pas du cadre familiale, il me semble que j'ai tout à fait le droit de pouvoir déroger aux standards. Ceci étant dit, je voulais vous remercier car j'ai finalement réussi ! – Littlemonster Dec 04 '15 at 08:13

0 Answers0