(Ann) Open Lingua with Deepl version 1.4

Open Lingua is an open source version of Lingua which can be used to manage translations. The original version was developed by Thomas Tempelmann. There is a Deepl integration to do automatic translations.

Version 1.4 adds a curl version for talking to Deepl instead of using the MBS plugin. Libcurl from GitHub - charonn0/RB-libcURL: A Realbasic and Xojo binding to libcurl is used for this.

The new version can be downloaded from Xojo + Alfred .

10 Likes

!!! nice ! :slight_smile:
thanks a lot !!

Thank you, but I still have 2 errors because I donā€™t have MBS :

TextToTranslate = EncodingToHTMLMBS(TextToTranslate)
Result = DecodingFromHTMLMBS(Result)

Or I didnā€™t understand, I downloaded it from your website Beatrix.

Ups, the brain was overheated.

I made a new version 1.4.1 which replaces the Html Encoding and Decoding. I also added the script by Jeremy to export all locales at once.

2 Likes

Thank you.

Maybe write in the ReadMe (et the top, before History) that we have to put the constant ā€œUseMBSā€ to false if we donā€™t use MBS pluggin.

I donā€™t pay for DeepL but I click the button Translate just to see what happens and nothing occurs. When Iā€™m suppose to enter my API key if I have one?

Good idea.

If you click on translate the code should break at the location where you need to enter the API key. There is a free version of Deepl which is more than enough to do the occasional translation. The Deepl has has different endpoints for the free and the paid version which is also explained in some comments.

'there are 2 endpoints for the API
'for the paid version: https://api.deepl.com/v2/translate
'for the free version: https://api-free.deepl.com/v2/translate


Call form.AddElement("auth_key", "")
break 'insert your API key here

Break will only work in a DebugBuild, so maybe it would be a good idea to mention the place where to put the DeepL key in the ReadMeā€¦

Yes, there is a break, but also Your API key :face_with_open_eyes_and_hand_over_mouth:

EDIT: Ok, itā€™s not. Itā€™s the free API key. Phew.

1 Like

Better a

Call form.AddElement("auth_key", "")
#pragma Error Insert your API key above and comment this line
2 Likes

Thanks! Iā€™ve already revoked the key and uploaded a new version without the key.

You mean I cannot test anymore without having to register? Ooohh ā€¦ :upside_down_face:

2 Likes

ā€œTa flackā€ wie der Franzose sagt.

Iā€™m French and I donā€™t know what ā€œTa flackā€ means.

The Translate button didnā€™t have any effect because my sentence was already translated, maybe a button ā€œReplace the actual translationā€ ? Because I thought there was a problem.
I didnā€™t look for the comment for person who do not have an API key. (Iā€™m still working on my new website and it take me many times). But I would prefer a Preferences window in the application where the user enter his API key, if he leave it blank then ā†’ Free DeepL.

I didnā€™t have any person who asked me to localize my applications for a while, but the goal is to make a download with a built application people can use, with or without API key. People who translate are not suppose to know Xojo, they are not suppose to be developer.

Many thanks for your work beatrix.

That was a German joke. It means ā€œtough luckā€ for those who donā€™t know either French nor English. The other thing the French person says is ā€œtel avivā€ which means ā€œcā€™est la vieā€.

Select ā€œOnly untranslatedā€ and then click on the translate button.

Flak is a German slang for strong criticism. Maybe Ta flack comes from Tag Flak like in a ā€œthatā€™s just the criticism of the day, as usualā€.

Uh Beatrix, what have you caused? :joy:
Me being a German have never heard the term Flak for string criticism. Only definition known to me is a WW II aerial defence cannon.

1 Like

I really donā€™t know what Rick means. And yes, a Flak is an aerial defence cannon.

1 Like

There is not a word about the term ā€œFlakā€ being used in colloquial German / slang. Maybe it is used like that in English - even if I doubt itā€¦

It seems a term entering in disuse due to its age.