Is there a Java Translation library that works offline?

前端 未结 3 2071
别跟我提以往
别跟我提以往 2021-02-20 03:57

I really need to find a translation library for Java that can translate between languages such as french,english,german - whilst not requiring Internet connectivity.

相关标签:
3条回答
  • 2021-02-20 04:32

    As far as I can see, there are two possibilities here.

    i18n

    You are trying to internationalize (i18n) your offline application, in which case you don't need a translation "library" per se. Instead you need to use translation bundles and translate all possible strings in your application to their different languages. See these links for more information:

    Oracle i18n Doc

    Official Oracle Example

    Good Java i18n Example

    Dynamic Translation

    You are trying to translate dynamic or user generated content offline. In which case, this is a non-trival problem. Their may be some frameworks for this, but they would be very large and unwieldy, and probably NOT free or open-source. Google Translate is the most obvious online one, and even it doesn't get it right half the time. And this is a system built by some of the top developers and computer scientists in the world working on ONLY this problem.

    In short, you may want to reconsider what your application truly needs.

    0 讨论(0)
  • 2021-02-20 04:33

    For translating separate words take a look at Debian's freedict packages. They have simple text based format which easily parsable with Java.

    0 讨论(0)
  • 2021-02-20 04:39

    I don't know if you can find it. Think about how big can be the grammar and lexicon of only one idiom to be stored and processed later using a local library. I think can't be efficient a process translation like this.

    0 讨论(0)
提交回复
热议问题