Good afternoon,
I have found a way to translate my app's static text, however I have been able to find a way to translate the input text. Any idea on how to achieve this?
Thanks
Hello.
There are several options. It will depend on the type of problem you have.
One would be to create an extension on each data table and for the user to insert the translations.
The other is to add an extra layer (either webservice or AI) to translate it in real time.
Finally, you can mix them and save an automatic translation.
Can you please elaborate on the adding extra layer option, please?
To translate static texts, you have a tool that automatically translates them.
https://success.outsystems.com/documentation/11/building_apps/user_interface/multilingual_reactive_web_and_mobile_apps/translate_your_app/
This is the standard for localization.
It will depend on the complexity of your app and target audience. But probably you need to make something like that. A middle layer to translate every dynamic text.
......................
One scenario is to change all your Get actions to translate each text outputed. For instance, by adding an action with cache that receives Source Language, Target Language, Entity, Attribute, String and returns a new String (Entity/Attribute are here because the same text in a different context can have different translations).
This way each user will see everything in the wanted language.
.......................
The other is to have a button in UI to translate only the texts that the users needs help with.
And again, you can have your local table(s) of translations managed by humans, or do it with AI (like this Forge component).
Or just forget the tables (saving AOs) and rely on AI real time (can get expensive if you have many users).
@Helga Afonso : One option I can think of is using Google Translate on the client side. You can make a request to:https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(text)}and extract the translated text. However, please note that this is an undocumented API and may stop working at any time. Consider using Google's official Cloud Translation API for a more stable solution.
Hi @Helga Afonso
can you pls refer the below documentation, If it helps.
Thanks,
sivasakthi
Not quite, this only works for static text
Hi Helgan Afonso,
Do you mean that you want to translate the text entered by the user in the input field?
If so, I think you can use some AI APIs, with the input being the text entered by the user and the output being the translation result from the API.
We can process it either right after the user enters the text or after the user saves the data into the database.
I hope this solution helps.
Which AI APIs cab I use?
DeepL is quite good and has a competitive price.
https://www.deepl.com/en/pro-api
You have components in both Forges for it.
Hi,
You can use this component too:
https://www.outsystems.com/forge/component-overview/7366/google-translate-connector-lite
You just need to give in the input of the Service Action the text to translate and the language.
Hope this can help.
You can use the Google Translate API or Microsoft Translator API. Alternatively, you can store translations in an OutSystems entity by adding an attribute for different languages. When the user inputs text, retrieve the corresponding translation based on the locale.