Testing automatic translations to English

I think it’s probably useful to separate the test posts from the actual decisions and configurations in

We intentionally don’t allow AI translations in private topics and direct messages, so a testing topic here makes sense for now. I’m also finding a number of issues with the builtin behaviors and will be fiddling with the prompts a bit more.

It still works with large blocks of code.

julia> struct Dog end; struct Cat end

julia> meet(a::Dog, b::Dog) = "The dogs play together"
       meet(a::Dog, b::Cat) = "The dog chases the cat"
       meet(a::Cat, b::Dog) = "The cat hisses at the dog"
       meet(a::Cat, b::Cat) = "The cats ignore each other. There's lots of English here!"

julia> meet(Dog(), Cat())
"The dog chases the cat"

Let me run an experiment here and post something a bit more technical to see if the translation holds up: I want to perform a local optimization on a piecewise differentiable function that lacks any other nice properties: it’s not convex, computing its values is expensive, and it’s impossible to obtain an explicit expression for the derivatives, even with automatic differentiation. Is Nelder-Mead the best option, or is there a better algorithm?

Also, let me test whether the automatic translation is smart enough not to break the code:

f() = print("essa string não deve ser traduzida")

I think the text translation was amazing, but it really shouldn’t be translating strings in code.

The lorry driver took his tools out of the car’s boot and looked under its bonnet.

(Test for BE, which is rightly treated as a separate language.)

EDIT: This is not translated so what is English (UK) supposed to mean? Different punctuation and spelling (e.g., centre)?

I do understand what you wrote – and can confirm: Probably NM is the best you can do.

Just for myself I cannot yet set languages for posts (the same language symbol as at the posts in the editor) – or is the language the detected automatically?

(post deleted by author)

I’ll try again.

Without tics:

f() = print("hier wil ik een vertaling zien")

with tics:

f() = print("hier wil ik geen vertaling zien")

@langestefan just to confirm: you didn’t manually edit that translation did you? That’s pretty unfortunate! We’ll have to see if a little prompt engineering can’t avoid that in more cases.

output

How lovely!

We should try that – but without too much technical jargon, just to see if it works even with my poor Norwegian.

Interesting that only Bokmål is available, but not Nynorsk, among the selectable languages.

For me that post only appears in Norwegian for now.

edit: Ah yes! Well, I checked that Norwegian does not need translation for me :smiley:

When I now hit edit on the previous post it recognises it as Norwegian – so at least my Norwegian cannot be that bad.

No I didn’t, that was a bit strange. It updated the translation and now also the code is translated.

Norwegian isn’t translated for me either, and I definitely didn’t check that I understand it.

Sure it would be trivial to simply filter out the portion of the text between backticks from the translation, no prompt engineering needed for that.

When I click the edit button it does recognise the language as Norwegian.

But interesting to know – and good to experiment with that a bit. So I can now hide secret messages by writing Norwegian. Supert! (ah in supert I can not hide much)

That would make sense, wouldn’t it!? That’s not how the translation plugin works, unfortunately. It was actually originally directed to translate comments… which seems fraught. I’ve removed that and instead asked it to preserve the original code exactly. I’m going to re-run the translator on the above posts and we’ll see how things change.

Now it worked. But this comment I’m replying to is also showing up as translated! And if I click to show the original, a see that the difference is that the LLM inserted an em-dash! That’s downright offensive.

It also changes the grammar a bit. So I can translate my own post there as well. Maybe I do not speak my own bad English after all?

So that now translates from “Ronnys bad English” to English? :smiley:

Or with the dashes maybe also from English to Claudish?

(edit: The post that is translated is recognised as Norwegian actually, so the translation shown is from “Norwegian” to English, changing English grammar and emdashes)

And for the Norwegian: I see, maybe it just takes bit of time until the translation is available.

What was your sequence here? Did you originally write this in Norwegian, then edit it within 5 minutes to make the original English (but then I suppose it preserved the originally-detected no-bk)?

No. I wrote only the very first atop in Norwegian. The post you quote was exactly that one and always in English.

So it actually translates there English to English, since it somehow recognised it as Norwegian/Bokmål (no-bk), no clue why it did that.