We have a requirement to translate user entered text in a text area into spanish, do we have any option in to achieve this. With Localization we are achieving the drop down values, field values and messages by having localized labels created. But with our requirement we need to perform language translation for a text entered by user.
Localization requires you to create field values and for your requirement there might not be any straight forward way of doing it. If your users are entering it in text area, first you need to read the string, then split them word by word ( string tokenizer may be?), and then use a decision table or something similar to pick the translated value and then form the sentence again with translated value. So, it is a difficult. error prone process.
Other option could be using third party API like Google Translate. You can let the AI to take care of the translation.
Can you let us know what error is being shown in your activity reference and have you imported the google-cloud-translate jar file using import wizard? If so, could you try to place the jar file in your server lib directory and restart the JVM to test the behavior.
I was able to import the google-cloud-translate-1.14.0.jar file which is downloaded from here. After import of the jar file, restart the JVM with clear cache then try to use the translate class in your activity. Hope it helps you.
I did imported all dependency jars, now i ended up below error using this API. Is there any alternative approaches to call google API using REST? Seems java code not working due to its expecting service call using Json inputs?
I am trying with activity by calling API methods? will it work. Please suggest.