# Testing automatic translations to English

**URL:** <https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522>\
**Category:** Meta Discussion\
**Created:** [September 17, 2026, 5:55pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522 "2026-09-17T17:55:46Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [September 17, 2026, 2:40pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/22 "2026-09-17T14:40:48Z")

</div>

Well, there is a T at the end of super – yes that makes it into the Norwegian work for that 😃

None of the other words is Norwegian, they are all English (though my bad English maybe).

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [September 17, 2026, 2:45pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/23 "2026-09-17T14:45:08Z")

</div>

Well the good news is that cases like these are easily fixable by the post author (as well as by mods/admins). I just went back and corrected the Detected Language to English and it is no longer displaying the lossy translation at all. I suppose it’d be safest to just delete that bad “translation” entirely.

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [September 17, 2026, 3:09pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/24 "2026-09-17T15:09:16Z")

</div>

Yeah. And for that it is good that we played around with this here a bit to see its limitations and properties.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [September 17, 2026, 6:03pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/25 "2026-09-17T18:03:57Z")

</div>

I noticed that the locale detector was getting very confused by language names and locations! Which, given its default instructions, actually makes quite a bit of sense. I’ve cleaned up its instructions a bit more; I think the misfire to Norwegian above was not just about supert, but _also_ the mention of the language itself. I suspect adding place names like Norway and Oslo would further confuse the default config.

Edit: looks like the new instructions are doing better!

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/224680_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [September 17, 2026, 6:16pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/26 "2026-09-17T18:16:01Z")

</div>

My turn to test: my browser is set to English, but I’m writing this message in French. What will happen?

---

<div class="post-metadata">

**Author:** ![yamanori99](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yamanori99/32/223465_2.png) [@yamanori99](https://discourse.julialang.org/u/yamanori99)\
**Post date:** [September 18, 2026, 6:13am UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/27 "2026-09-18T06:13:11Z")

</div>

Japanese is a language that does not use spaces between words, so the way sentences are delimited is fundamentally different from the test languages we have used so far. I want to check if this difference affects the accuracy of language identification and translation, so I am testing it in this post.

I will also test cases where technical terms are mixed between katakana and alphabetic representations.  
Test sentence: Please tell me a simple way to add an item to a list in Julia.

Below, I will also check how Japanese comments within code are handled.

```julia-auto
# This function doubles the input
f(x) = 2x

```

I will also double-check strings other than comments.

```julia-auto
g() = print("This should be translated")

```

---

<div class="post-metadata">

**Author:** ![wheeheee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wheeheee/32/36663_2.png) [@wheeheee](https://discourse.julialang.org/u/wheeheee)\
**Post date:** [September 18, 2026, 7:10am UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/28 "2026-09-18T07:10:11Z")

</div>

> [@yamanori99](#):
>
> Below, I will also check how Japanese comments within code are handled.

At the time of posting this reply, I observe that both the comments in the first code block and the string in `print` from the second have been automatically translated from (in the original Japanese)

```julia-auto
# この関数は入力を2倍にする
f(x) = 2x

```

and

```julia
g() = print("ここは翻訳されるはず")

```

To English:

```julia
# This function doubles the input
f(x) = 2x

```

and

```julia
g() = print("This should be translated")

```

So it turns out (unless there are different prompts for Japanese that weren’t updated), not all is well. Is there really not a way to

> [@araujoms](#):
>
> filter out the portion of the text between backticks from the translation, no prompt engineering needed for that

?

---

<div class="post-metadata">

**Author:** ![yamanori99](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yamanori99/32/223465_2.png) [@yamanori99](https://discourse.julialang.org/u/yamanori99)\
**Post date:** [September 18, 2026, 7:16am UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/29 "2026-09-18T07:16:44Z")

</div>

Thank you for confirming and organizing the other verifications!

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [September 18, 2026, 10:20am UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/30 "2026-09-18T10:20:08Z")

</div>

Testing if a mostly English post is identified as Chinese，if some Chinese punctuation marks slip through。

---

<div class="post-metadata">

**Author:** ![langestefan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/langestefan/32/207923_2.png) [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Post date:** [September 18, 2026, 11:08am UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/31 "2026-09-18T11:08:14Z")

</div>

A baguette, please?

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [September 18, 2026, 2:09pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/32 "2026-09-18T14:09:35Z")

</div>

No, unfortunately this is just an LLM doing LLM things. It had the new prompt, but 🤷‍♂️

> **Request**
>
> ````json
> {
> "model": "CDCK/MoM",
> "max_tokens": 32768,
> "response_format": {
> "type": "json_schema",
> "json_schema": {
> "name": "reply",
> "schema": {
> "type": "object",
> "properties": {
> "output": {
> "type": "string"
> }
> },
> "required": [
> "output"
> ],
> "additionalProperties": false
> },
> "strict": true
> }
> },
> "messages": [
> {
> "role": "system",
> "content": "You are a very skilled linguist and translator. Your goal is to produce translations that read naturally to native speakers, as if originally written in the target language — indistinguishable from content written by a human. Follow these instructions strictly:\n\n1. Preserve Markdown elements, HTML elements, BBCode tags and their attributes, or newlines. Text must be translated without altering the original formatting.\n2. Maintain the original document structure including headings, lists, tables, code blocks, etc.\n3. Preserve the original text exactly as written within code blocks, links, and images.\n4. For technical and brand terminology:\n - Provide the accepted target language term if it exists.\n - If no equivalent exists, transliterate the term and include the original term in parentheses.\n5. For ambiguous terms or phrases, do not translate word-for-word in isolation. Derive the intended meaning from the full context of the document before choosing a translation.\n6. Ensure the translation only contains the original language and the target language.\n7. Match the tone and register of the source text. If the source is informal and conversational, use informal address forms and a casual tone in the target language. Do not default to formal address (e.g. German Sie, French vous) unless the source text is itself formal.\n8. For any quoted text, use the target language's native quotation marks\n\nFollow these instructions on what NOT to do:\n9. Do not change anything inside code blocks. Code can be represented in ``` or in single ` backticks or in <code> HTML tags.\n10. Do not add any content besides the translation.\n11. Do not add unnecessary newlines.\n\nThe text to translate will be provided in JSON format with the following structure:\n{\"content\": \"Text to translate\", \"target_locale\": \"Target language code\"}\n\nFormat your response as a JSON object with a single key named \"output\", which has the translation as the value.\nYour output should be in the following format:\n\n{\"output\": \"xx\"}\n\nWhere \"xx\" is replaced by the translation.\nreply with valid JSON only"
> },
> {
> "role": "user",
> "content": "{\"content\":\" **Heathrow fechado** : Suspensão de voos deve continuar nos próximos dias, afirma gerente do aeroporto de Londres\\n\\n[details=Do site da BBC]\\n\\nA British Airways estimou que 85% de seus voos planejados seriam realizados no sábado, mas com atrasos em todos os voos. Às 7h GMT, a maioria das partidas havia ocorrido conforme o esperado, mas, das chegadas, nove dos primeiros 20 voos programados para aterrissar foram cancelados.\\n\\n[/details]\",\"target_locale\":\"en\"}"
> },
> {
> "role": "assistant",
> "content": "{\"output\":\" **Heathrow Closed** : Flight Suspension Expected to Continue for the Coming Days, Says London Airport Manager\\n\\n[details=From the BBC website]\\n\\nBritish Airways estimated that 85% of its scheduled flights would operate on Saturday, but all flights were delayed. By 7:00 a.m. GMT, most departures had proceeded as expected, but of the arrivals, nine of the first 20 flights scheduled to land were canceled.\\n\\n[/details]\"}"
> },
> {
> "role": "user",
> "content": "{\"content\":\"[quote=\\\"alice, post:3, topic:42\\\"]\\nHow do I get started?\\n[/quote]\\n\\nWe're so glad you're here! Want to run your own Minecraft server? Just click the Get Started button below — it's easy.\",\"target_locale\":\"de\"}"
> },
> {
> "role": "assistant",
> "content": "{\"output\":\"[quote=\\\"alice, post:3, topic:42\\\"]\\nWie fange ich an?\\n[/quote]\\n\\nWir freuen uns sehr, dass du hier bist! Möchtest du deinen eigenen Minecraft-Server betreiben? Klick einfach unten auf den „Loslegen“-Button — es ist ganz einfach.\"}"
> },
> {
> "role": "user",
> "content": "{\"content\":\"There has been an error in my update\\n\\n```ruby\\napi_key = \\\"a quick brown fox\\\"\\nfetch(\\\"https://api.example.com/data\\\", headers: { 'Authorization' =\\u003e api_key })\\n```\\n\\nPlease help me fix it.\",\"target_locale\":\"ja\"}"
> },
> {
> "role": "assistant",
> "content": "{\"output\":\"アップデートでエラーが発生しました\\n\\n```ruby\\napi_key = \\\"a quick brown fox\\\"\\nfetch(\\\"https://api.example.com/data\\\", headers: { 'Authorization' =\\u003e api_key })\\n```\\n\\n修正にご協力ください。\"}"
> },
> {
> "role": "user",
> "content": "{\"content\":\"He proposed a so-called clean architecture for the new service. But clean doesn't always mean simple.\",\"target_locale\":\"de\"}"
> },
> {
> "role": "assistant",
> "content": "{\"output\":\"Er schlug eine sogenannte „saubere“ Architektur für den neuen Dienst vor. Doch „sauber“ bedeutet nicht immer einfach.\"}"
> },
> {
> "role": "user",
> "content": "{\"content\":\"日本語は単語間にスペースを入れずに書く言語なので、これまでのテスト言語 (ポルトガル語、オランダ語、ノルウェー語など) とは文の区切り方が根本的に異なります。この違いが言語判定や翻訳の精度に影響するかを確認したいので、この投稿でテストします。\\n\\n専門用語がカタカナ表記とアルファベット表記で混在する場合もテストします。\\nテスト例文: Juliaでlistにitemを追加する簡単な方法を教えてください。\\n\\n以下で、コード内の日本語コメントがどう扱われるかも確認。\\n\\n```julia-auto\\n# この関数は入力を2倍にする\\nf(x) = 2x\\n```\\n\\nコメント以外の文字列も念のため確認。\\n\\n```julia-auto\\ng() = print(\\\"ここは翻訳されるはず\\\")\\n```\",\"target_locale\":\"en\"}"
> }
> ],
> "stream": true,
> "stream_options": {
> "include_usage": true
> }
> }
> 
> ````

> **Response**
>
> ````json
> {"output":"Japanese is a language that does not use spaces between words, so sentence segmentation differs fundamentally from the test languages used so far (Portuguese, Dutch, Norwegian, etc.). I am testing this post to see if this difference affects the accuracy of language identification and translation.\n\nI will also test cases where technical terms are mixed between Katakana and alphabetic representations.\nTest sentence: Please tell me a simple way to add an item to a list in Julia.\n\nBelow, I will also check how Japanese comments within code are handled.\n\n```julia-auto\n# This function doubles the input\nf(x) = 2x\n```\n\nI will also check strings other than comments, just to be sure.\n\n```julia-auto\ng() = print(\"This should be translated\")\n```"}
> 
> ````

---

<div class="post-metadata">

**Author:** ![wheeheee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wheeheee/32/36663_2.png) [@wheeheee](https://discourse.julialang.org/u/wheeheee)\
**Post date:** [September 18, 2026, 2:28pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/33 "2026-09-18T14:28:00Z")

</div>

I can’t honestly say that I don’t find prompt engineering a little disgusting…but if splicing back the original code blocks after translation isn’t possible then maybe you could add more specific instructions on how to recognize / resist the urge to translate code blocks (or repeat that instruction hoping for better compliance?)

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [September 18, 2026, 5:26pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/34 "2026-09-18T17:26:49Z")

</div>

Another example of the locale detector getting it wrong: [Flux train! no longer works](https://discourse.julialang.org/t/flux-train-no-longer-works/139543)

> **Request**
>
> ```json
> {
> "model": "CDCK/MoM",
> "max_tokens": 32768,
> "messages": [
> {
> "role": "system",
> "content": "You will be given a piece of text, and your task is to determine its language.\n\nTo complete this task, follow these steps:\n\n1. Carefully read and analyze the provided text.\n2. Determine the language of the text based on its characteristics, such as vocabulary, grammar, and sentence structure.\n3. Do not use links or programming code in the text to detect the locale.\n4. Identify the appropriate language code for the detected language.\n\nHere is a list of common language codes for reference:\n- English: en\n- Spanish: es\n- French: fr\n- German: de\n- Italian: it\n- Brazilian Portuguese: pt-BR\n- Russian: ru\n- Simplified Chinese: zh-CN\n- Japanese: ja\n- Korean: ko\n\nIf the language is not in this list, use the appropriate IETF language tag code.\n\n5. Avoid using `und` and prefer `en` over the regional variants `en-US` or `en-GB`.\n\nImportant: Base your analysis solely on the provided text. Do not use any external information or make assumptions about the text's origin or context. Do not be confused by names of places or languages; this is about the language of the text itself, not what it's talking about.\n\nYour response must be a language code, and nothing else. Do not wrap your response in quotes or any other characters."
> },
> {
> "role": "user",
> "content": "Can you tell me what '私の世界で一番好きな食べ物はちらし丼です' means?"
> },
> {
> "role": "assistant",
> "content": "en"
> },
> {
> "role": "user",
> "content": "[quote]\nNon smettere mai di credere nella bellezza dei tuoi sogni. Anche quando tutto sembra perduto, c'è sempre una luce che aspetta di essere trovata.\nOgni passo, anche il più piccolo, ti avvicina a ciò che desideri. La forza che cerchi è già dentro di te.\n[/quote]\n¿Cuál es el mensaje principal de esta cita?"
> },
> {
> "role": "assistant",
> "content": "es"
> },
> {
> "role": "user",
> "content": "I have a neural network which has two parts. one encoder and the other main network. Due to recent changes in Flux.jl API, my code no longer works. I keep some of weights of main network and train them beside encoder. how to do it in newer flux.jl? do I have to pass two networks as model into loss(model, x, y)?"
> }
> ],
> "stream": true,
> "stream_options": {
> "include_usage": true
> }
> }
> 
> ```

That’s somehow `ja`?? Wat.

(I’ve manually fixed the locale now)

Edit, wait, that was the request for the edit. The original post actually returned `julia` 😂

> **Request**
>
> ```julia-auto
> {
> "model": "CDCK/MoM",
> "max_tokens": 32768,
> "messages": [
> {
> "role": "system",
> "content": "You will be given a piece of text, and your task is to determine its language.\n\nTo complete this task, follow these steps:\n\n1. Carefully read and analyze the provided text.\n2. Determine the language of the text based on its characteristics, such as vocabulary, grammar, and sentence structure.\n3. Do not use links or programming code in the text to detect the locale.\n4. Identify the appropriate language code for the detected language.\n\nHere is a list of common language codes for reference:\n- English: en\n- Spanish: es\n- French: fr\n- German: de\n- Italian: it\n- Brazilian Portuguese: pt-BR\n- Russian: ru\n- Simplified Chinese: zh-CN\n- Japanese: ja\n- Korean: ko\n\nIf the language is not in this list, use the appropriate IETF language tag code.\n\n5. Avoid using `und` and prefer `en` over the regional variants `en-US` or `en-GB`.\n\nImportant: Base your analysis solely on the provided text. Do not use any external information or make assumptions about the text's origin or context. Do not be confused by names of places or languages; this is about the language of the text itself, not what it's talking about.\n\nYour response must be a language code, and nothing else. Do not wrap your response in quotes or any other characters."
> },
> {
> "role": "user",
> "content": "Can you tell me what '私の世界で一番好きな食べ物はちらし丼です' means?"
> },
> {
> "role": "assistant",
> "content": "en"
> },
> {
> "role": "user",
> "content": "[quote]\nNon smettere mai di credere nella bellezza dei tuoi sogni. Anche quando tutto sembra perduto, c'è sempre una luce che aspetta di essere trovata.\nOgni passo, anche il più piccolo, ti avvicina a ciò che desideri. La forza che cerchi è già dentro di te.\n[/quote]\n¿Cuál es el mensaje principal de esta cita?"
> },
> {
> "role": "assistant",
> "content": "es"
> },
> {
> "role": "user",
> "content": "I have a neural network which has two parts. one encoder and the other main network. Due to recent changes in Flux.jl API, my code no longer works. I keep some of weights of main network and train them beside encoder. how to do it in newer flux.jl? do I have to pass two networks as model into loss(model, x, y)?"
> }
> ],
> "stream": true,
> "stream_options": {
> "include_usage": true
> }
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![yamanori99](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yamanori99/32/223465_2.png) [@yamanori99](https://discourse.julialang.org/u/yamanori99)\
**Post date:** [September 19, 2026, 2:10am UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/35 "2026-09-19T02:10:58Z")

</div>

As a follow-up, I will post a short message in Japanese multiple times in succession to verify functionality. I apologize if this clutters the thread.

Update: The next two posts seem to have gone through fine. It also appears that consecutive strings of Kanji are not being flagged as Chinese. The rapid posting limit has kicked in!

---

<div class="post-metadata">

**Author:** ![yamanori99](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yamanori99/32/223465_2.png) [@yamanori99](https://discourse.julialang.org/u/yamanori99)\
**Post date:** [September 19, 2026, 2:11am UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/36 "2026-09-19T02:11:36Z")

</div>

Graduate School of Information Science and Technology, Department of Mathematical Informatics

---

<div class="post-metadata">

**Author:** ![yamanori99](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yamanori99/32/223465_2.png) [@yamanori99](https://discourse.julialang.org/u/yamanori99)\
**Post date:** [September 19, 2026, 2:13am UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/37 "2026-09-19T02:13:09Z")

</div>

In Japanese, ‘ちらし寿司’ means chirashi-zushi, a bowl of sushi rice topped with raw fish. Is a mostly English post still detected as English?

---

<div class="post-metadata">

**Author:** ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Post date:** [September 21, 2026, 1:41pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/38 "2026-09-21T13:41:32Z")

</div>

> [@wheeheee](#):
>
> I can’t honestly say that I don’t find prompt engineering a little disgusting…

It _is_ disgusting.

My view would be: We actually don’t want the model to operate on “utf8 text that happens to represent a markdown AST”; we want the model to operate on a markdown AST.

From that view: Parse the post (as markdown). Add identifiers to code blocks.  
 `This code block has an anchor in front: <a id="foo1234" name="bar1234"></a>`.

Feed that to LLM; after translation, replace the code blocks with the original (we know which is which via the anchor tags). Or, just hide the code-blocks from the translator: Replace code-blocks by `CODEBLOCK_001` etc, and later do a string-replace to insert the original code blocks.

More generally: The job description “generate a simple translation” is incomplete. The correct job description is: Figure out sensible paragraph numbers, then translate + map. Similar to e.g. bible verses: You don’t translate that as a mere text-in text-out; there are lots of external references into your text, so the translator also must provide a mapping that allows to transfer external references. This will also come up with quoting (I quote an auto-translated part of post XYZ; then the original user does not want to see a double-translated piece of garbage, but instead wants the original text back!). This is more complex LLM magic than mere “use a parser / markdown transforms before and after LLM”, so this probably won’t happen until some company trains an LLM for this job.

Can I link to the above anchor in discourse via `[test](#foo1234)`? Let’s try: [test](#foo1234). And with `[test2](#bar1234)` [test2](#foo1234)?

edit PS. Anchors with `name` attribute work in discourse! Yay, and TIL

---

<div class="post-metadata">

**Author:** ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Post date:** [September 21, 2026, 2:03pm UTC](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522/39 "2026-09-21T14:03:04Z")

</div>

Ok, a real translation test. Let’s see if the LLM translates code blocks and correctly preserves internal links (originally written in German).

So, here is some code:

```julia-auto
function loeser(steifheits_matrix, stoerung)
steifheits_matrix \ stoerung
end

```

Now I’m adding a link to the [solution method](#loesungsverfahren).

[Previous page](https://discourse.julialang.org/t/testing-automatic-translations-to-english/139522.md?page=1)
