Joe
Joe

Reputation: 15359

How can you find translations of a word in english to other languages programmatically

The following is a sample set of translations from english --> french

lundi (monday)
mardi (tuesday)
mercredi (wednesday)
janvier (january)

Is there an easier way to find the equivalent words for days and months from english to say french | german | japanese?

Upvotes: 0

Views: 348

Answers (2)

Katarina
Katarina

Reputation: 41

I would consider using java.text.SimpleDateFormat with a correct Locale - it should provide day/month names in many languages.

Upvotes: 4

denis.solonenko
denis.solonenko

Reputation: 11775

You could use SimpleDateFormat:

Locale locale = new Locale("fr");
SimpleDateFormat df = new SimpleDateFormat("EEEE", locale);
System.out.println(df.format(new Date()));

Now instead of new Date() create a date with the required day - monday, tuesday, etc

Upvotes: 8

Related Questions