Skip to content

Translation failing with: Unsupported translate direction: 'es' → 'en' #46147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 of 6 tasks
quinncomendant opened this issue May 17, 2025 · 0 comments
Open
3 of 6 tasks

Comments

@quinncomendant
Copy link

Description

I use translation from Spanish to English frequently on Brave, but today it stopped working. Brave translation is intermittently failing with the following response:

LNX-ERROR:
{"code":"INVALID_LANG_CODE","message":"Unsupported translate direction: 'es' → 'en'"}

This is wrong because esen is certainly a supported translate direction.

Steps to reproduce

  1. Open a product on Amazon Mexico, e.g., this one
  2. Invoke Brave's translation to English (right-click → Translate to English)
  3. Note some requests to translate.brave.com fail in the Dev Tools → Network panel, but not all of them:
Image

In fact, when I repeat the request that generated the error above by copying the cURL command the pasting it in the terminal, it succeeds:

curl 'https://translate.brave.com/translate_a/t?anno=3&client=te_lib&format=html&v=1.0&key=qztbjzBqJueQZLFkwTTJrieu8Vw3789u&logld=vTE_20220615&sl=es&tl=en&tc=11&sr=1&tk=761523.825890&mode=1' \
  -H 'accept: */*' \
  -H 'accept-language: en-US,en;q=0.8' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -H 'origin: https://www.amazon.com.mx' \
  -H 'priority: u=1, i' \
  -H 'referer: https://www.amazon.com.mx/' \
  -H 'sec-ch-ua: "Chromium";v="136", "Brave";v="136", "Not.A/Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'sec-gpc: 1' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36' \
  --data-raw 'q=%3Ca%20i%3D0%3E%2425.98%3C%2Fa%3E%3Ca%20i%3D1%3E%20(2%25)%3C%2Fa%3E&q=%20Pagos%20y%20Seguridad%20&q=%2030%20d%C3%ADas%20de%20devoluci%C3%B3n%20sin%20costo%20&q=%20Enviado%20por%20Amazon%20&q=Est%C3%A1s%20viendo%20el%20modelo%20m%C3%A1s%20nuevo%20de%20este%20producto%20%E2%80%94%20mira%20la%20novedad&q=%3Ca%20i%3D0%3EBocinas%20inteligentes%20Echo%3C%2Fa%3E%3Ca%20i%3D1%3EVer%20las%20diferencias%3C%2Fa%3E&q=Previous%20page&q=Echo%20Dot&q=Gran%20sonido%2C%20tama%C3%B1o%20compacto&q=41%2C654&q=%3Ca%20i%3D0%3EDesde%3A%3C%2Fa%3E%3Ca%20i%3D1%3E%241%2C273.02%3C%2Fa%3E&q=Echo%20Spot&q=Sonido%20vibrante&q=23%2C398&q=%3Ca%20i%3D0%3EDesde%3A%3C%2Fa%3E%3Ca%20i%3D1%3E%241%2C518.02%3C%2Fa%3E&q=Echo%20Pop&q=Sonido%20definido%20y%20colores%20geniales&q=18%2C203&q=%3Ca%20i%3D0%3EDesde%3A%3C%2Fa%3E%3Ca%20i%3D1%3E%24979.02%3C%2Fa%3E&q=Next%20page&q=%3Ca%20i%3D0%3E%20Color%3A%20%3C%2Fa%3E%3Ca%20i%3D1%3E%20Negro%20%3C%2Fa%3E&q=%3Ca%20i%3D0%3E%20Configuraci%C3%B3n%3A%0A%20%20%20%20%3C%2Fa%3E%3Ca%20i%3D1%3E%20Solo%20dispositivo%20%3C%2Fa%3E&q=Paquetes%20con%20este%20producto&q=con%20Foco%20inteligente&q=%3Ca%20i%3D0%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-5%25%20%3C%2Fa%3E%3Ca%20i%3D1%3E%20%241%2C524.36%20%3C%2Fa%3E&q=%3Ca%20i%3D0%3ELista%3A%3C%2Fa%3E%3Ca%20i%3D1%3E%241%2C598.00%3C%2Fa%3E&q=Explora%20paquetes%20con%20opciones%20similares'

Actual result

Requests to translate.brave.com are failing with this error message:

LNX-ERROR:
{"code":"INVALID_LANG_CODE","message":"Unsupported translate direction: 'es' → 'en'"}

Expected result

All requests to translate.brave.com should respond with a collection of translated strings, e.g.:

["\u003ca i=\"0\"\u003e$25.98\u003c/a\u003e\u003ca i=\"1\"\u003e (2%)\u003c/a\u003e","Payments and Security ","30 days of return at no cost ","Sent by Amazon ","You are seeing the newest model of this product — look at the novelty","\u003ca i=\"0\"\u003eEcho smart speakers\u003c/a\u003e\u003ca i=\"1\"\u003eSee the differences\u003c/a\u003e","Previous page","Echo Dot","Great sound, compact size","41,654","\u003ca i=\"0\"\u003eFrom:\u003c/a\u003e\u003ca i=\"1\"\u003e$1,273.02\u003c/a\u003e","Echo Spot","Vibrating sound","23,398","\u003ca i=\"0\"\u003eFrom:\u003c/a\u003e\u003ca i=\"1\"\u003e$1,518.02\u003c/a\u003e","Echo Pop","Defined sound and great colors","18,203","\u003ca i=\"0\"\u003eFrom:\u003c/a\u003e\u003ca i=\"1\"\u003e$979.02\u003c/a\u003e","Next page","\u003ca i=\"0\"\u003e Color: \u003c/a\u003e\u003ca i=\"1\"\u003e Black \u003c/a\u003e","\u003ca i=\"0\"\u003e Configuration:\n    \u003c/a\u003e\u003ca i=\"1\"\u003e Device only \u003c/a\u003e","Packages with this product","with smart Focus","\u003ca i=\"0\"\u003e\n                    -5% \u003c/a\u003e\u003ca i=\"1\"\u003e $1,524.36 \u003c/a\u003e","\u003ca i=\"0\"\u003eList:\u003c/a\u003e\u003ca i=\"1\"\u003e$1,598.00\u003c/a\u003e","Explore packages with similar options"]

Reproduces how often

Intermittent issue

Brave version (brave://version info)

  • Brave: 1.78.102 Chromium: 136.0.7103.113 (Official Build) (arm64)
  • Revision: 9161158db1676f5fb4a6e048cc98d776dcbf9bad
  • OS: macOS Version 15.5 (Build 24F74)

Channel information

  • release (stable)
  • beta
  • nightly

Reproducibility

  • with Brave Shields disabled
  • with Brave Rewards disabled
  • in the latest version of Chrome

Miscellaneous information

It's not easy to troubleshoot this because it seems to be an intermittent failure. Hopefully there is some telemetry of these errors recorded in the server logs to narrow it down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant