我正在寻找一个免费的 Java翻译API,我发现 microsoft-translator-java-api,它很容易使用我喜欢它,但是当我从英语翻译成阿拉伯语时,就像:
public static void main( String[] args ) throws Exception {
// Set the Client ID / Client Secret once per JVM. It is set statically and applies to all services
Translate.setClientId("MY_CLIENT_ID_KEY");
Translate.setClientSecret("MY_CLIENT_SECRET_KEY");
// From English-> Arabic
String translatedText = Translate.execute("When creating a text field component, it’s common to specify some initial text and/or a number of columns from which the field’s width is calculated.", Language.ENGLISH, Language.ARABIC);
System.out.println(" English -> Arabic: " + translatedText);
}
我在控制台上显示为:
English -> Arabic : ??? ????? ???? ??? ??? ?????? ?????? ??? ???? ??????? ?/?? ??? ?? ??????? ???? ?? ?????? ??? ???? ????? ?????.
我很困惑如何修复这个错误,以便我可以在控制台上获得一些有意义的完整字符,而不是上面的。