开发者

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

开发者 https://www.devze.com 2023-03-10 08:52 出处:网络
The following is a sample set of tra开发者_StackOverflownslations from english --> french lundi (monday)

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

精彩评论

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

关注公众号