开发者

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

The following is a sample set of tra开发者_StackOverflownslations 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?


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜