如何使用java编程将一种语言翻译成另一种语言

时间:2022-06-07 03:19:07

in my project, there is a content section. where user can view contents in four diff languages. Is there any way, that i put contents in one language, and according to user's choice my java program translate it to the selected language and now user can view it to that selected language.(Say for example translate English to French)

在我的项目中,有一个内容部分。用户可以用四种差异语言查看内容。有什么办法,我把内容放在一种语言中,并根据用户的选择,我的java程序将其翻译成所选语言,现在用户可以查看所选语言。(例如,将英语翻译成法语)

3 个解决方案

#1


0  

http://code.google.com/apis/language/translate/overview.html

http://code.google.com/apis/language/translate/overview.html

Google Translate provides an API for just that. Of course, the translations aren't always good.

谷歌翻译为此提供了一个API。当然,翻译并不总是好的。

And you have to pay money for it.

而你必须为此付钱。

Alternative: you write your content in every language you support, and at the correct event you update the UI with another version.

替代方案:您使用您支持的每种语言编写内容,并在正确的事件中使用其他版本更新UI。

#2


0  

I assume that you're not talking about machine translation. Take a look at ResourceBundles, but the solution depends also on the frameworks you are using.

我假设你不是在谈论机器翻译。看看ResourceBundles,但解决方案还取决于您使用的框架。

#3


0  

Depending on your implementation ResourceBundles may be what you are looking for, see:

根据您的实现,您可能正在寻找ResourceBundles,请参阅:

http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/

http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/

and

http://download.oracle.com/javase/6/docs/api/java/util/ResourceBundle.html

http://download.oracle.com/javase/6/docs/api/java/util/ResourceBundle.html

#1


0  

http://code.google.com/apis/language/translate/overview.html

http://code.google.com/apis/language/translate/overview.html

Google Translate provides an API for just that. Of course, the translations aren't always good.

谷歌翻译为此提供了一个API。当然,翻译并不总是好的。

And you have to pay money for it.

而你必须为此付钱。

Alternative: you write your content in every language you support, and at the correct event you update the UI with another version.

替代方案:您使用您支持的每种语言编写内容,并在正确的事件中使用其他版本更新UI。

#2


0  

I assume that you're not talking about machine translation. Take a look at ResourceBundles, but the solution depends also on the frameworks you are using.

我假设你不是在谈论机器翻译。看看ResourceBundles,但解决方案还取决于您使用的框架。

#3


0  

Depending on your implementation ResourceBundles may be what you are looking for, see:

根据您的实现,您可能正在寻找ResourceBundles,请参阅:

http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/

http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/

and

http://download.oracle.com/javase/6/docs/api/java/util/ResourceBundle.html

http://download.oracle.com/javase/6/docs/api/java/util/ResourceBundle.html