News for hackers. Stuff that matters.
Re:Show HN: Localize React apps without rewriting code by lukol on Tuesday June 03, 2025 @02:53PM (#44173330)
How do you deal with specific wording that needs to be used in certain languages (often required for legal topics) or specific brand-related messages that need to be in place without any modifications? Does a developer still have the ability to manually translate certain strings?
Re:Show HN: Localize React apps without rewriting code by maxpr on Tuesday June 03, 2025 @03:08PM (#44173489)
Hey lukol, that's an exciting problem to solve.

The best solution right now is prompt engineering: turns out, AI can be tuned to provide top quality results with the correct system prompt/few shot setup, and custom prompts can be provided in the compiler config.

Longer term, I want this to never be an issue, and I feel we'll get there together with the help from the open source community!

Re:Show HN: Localize React apps without rewriting code by grncdr on Tuesday June 03, 2025 @04:20PM (#44174262)
One simple idea* would be an option to exclude certain React elements from auto translation. That would allow users to handle these specific cases “manually” while still reaping the benefits of the automated system the other 99% of the time.

* worth exactly what you paid for it ;)

Re:Show HN: Localize React apps without rewriting code by MangoToupe on Tuesday June 03, 2025 @04:22PM (#44174291)
...or having an "override" file that allows manual specification regardless about what the LLM spits out.
Re:Show HN: Localize React apps without rewriting code by maxpr on Tuesday June 03, 2025 @04:31PM (#44174393)
we've added support for both these cases actually! :)

1. `data-lingo-skip` - excludes a jsx node from i18n 2. `data-lingo-override-<locale code>` - overrides version in <locale code> language with a custom value 3. also `data-lingo-context`

(docs, perhaps, aren't yet the best, but here they are: https://lingo.dev/compiler/configuration/advanced)

Re:Show HN: Localize React apps without rewriting code by grncdr on Wednesday June 04, 2025 @01:28AM (#44177497)
Ah that’s great. I simply hadn’t read the docs that far