(Ann) Open Lingua with Deepl version 1.4

I’m nearly 70 and never heard about these terms/expressions.

Please, stop using the pot. :joy:

:ukraine:

It is certainly a thing in England. Taking Flak is to be strongly criticised, typically from multiple sources. It is still quite commonly used today.

2 Likes

“Taking flak” is also common in American English. As native speakers noted above, it’s not used that way in German. (I live in Germany)

1 Like

Will this work with the latest Xojo?

There are a couple of issues where Xojo doesn’t like the old code:


Just change Set Class into mySet and check code, then change few things and it works in 5 minutes

2 Likes

I found those errors and made what I thought were the changes. I was trying to test it (with MBS) but I am not seeing any translations and it hits a break.

  • I created a DeepL account and got a key and placed it here
    d.FormAddField(“auth_key”, “199OI1Tzi???”)
  • I loaded my exported localised strings, hit NEXT then Translate
  • Then this error
Dim err As New TypeMismatchException
err.Message = "NewValue is of unsupported vartype: " + Str(ValueType)
Raise err

When I change back to MBS it keeps hitting the Break point

Private Sub ParseResult()
   dim theJson as new JSONItem(Result)
  
  if theJson.HasName("translations") then
    dim TranslationResult as JsonItem = theJson.Value("translations")
    if TranslationResult.IsArray then
      TranslationResult = TranslationResult.Child(0)
      
      if TranslationResult.HasName("text") then
        result = TranslationResult.Value("text")
      end if
    end if
    
  elseif theJson.HasName("message") then
    ErrorMessage = theJson.Value("message")
  else
    Break
  end if
End Sub

What is in the Json string?

Do you set the UseMBS to True in the Class DeepTranslation ?

Yes

Ok I have made progress, removed the breaks and hared coded Dutch in the line below and it worked but I assume I am missing something in the process.
d.FormAddField(“target_lang”, “NL”)'TargetLanguage) '“DE”

Also not sure how to easily get this back into my project but will chip away at it

You need to save the data in Open Lingua. This updates the language file. You then only need to import the file back into Xojo.

Does that consider that there is 4 other languages in the localised String?

There is always only one language in a localised strings file. Which is really a pity.