Commit Graph
64 Commits
Author SHA1 Message Date
Henrik Rydgård 6ef95ebff7 langtool: New command remove-ampersands 2026-08-31 11:31:35 +02:00
Henrik RydgårdandClaude Opus 5 c9ff8f55fe langtool: Mark strings that are deliberately the same as the English one
Plenty of strings are legitimately identical in the target language - "Vsync",
"Status", "Ad Hoc multiplayer" - but the only test we had for "is this
translated" is "does it differ from English", so those got sent to the AI again
on every single run of finish-language-with-ai, costing tokens and giving it
another chance to translate something that shouldn't be.

They now get a "# same as English" comment and are skipped. finish-language-with-ai
writes it when the AI hands the English string back unchanged (which the
validation added earlier was throwing away as an error), and import-single writes
it when a language's line matches the en_US one. Deleting the comment puts the
key back in play.

Also stop comparing values with their comments still attached while working out
what's untranslated, which was leaking "# AI translated" into the context block
of the prompt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0164UKoXpz9r155TRfQsoc3H
2026-08-23 16:18:07 +02:00
Henrik RydgårdandClaude Opus 5 a1d205539c langtool: Let import-single create the key in en_US.ini too
It skipped the reference file, so adding a new string meant running
add-new-key-value first just to get the key into en_US.ini (and, as a side
effect, the English text into all 46 other files whether they were about to be
translated or not). Now an en_US line in the imported file is treated like any
other language, minus the "AI translated" comment, since that one is the string
the others were translated from rather than a translation.

So the workflow is one command plus validate. Languages left out of the import
simply don't get the key, and fall back to the English string at runtime -
copy-missing-lines is still there if you want the placeholder written out.

Instructions in AGENTS.md and the /add-string command updated to match.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0164UKoXpz9r155TRfQsoc3H
2026-08-23 16:18:07 +02:00
Henrik RydgårdandClaude Opus 5 47ab1daac2 langtool: Fix losing translations when two keys share an English string
finish-language-with-ai maps the English string the AI translated back to the
key it belongs to, but the map was keyed on the English string, so when two keys
in a section share one - [Graphics] "Texture Filter" and "Texture Filtering",
[Error] "Error reading file" and "The file is not a valid zip file" - only the
last one survived and the other silently never got its translation.

Map to a list of keys instead and update all of them, and stop sending the same
line to the AI twice while we're at it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0164UKoXpz9r155TRfQsoc3H
2026-08-23 16:18:07 +02:00
Henrik RydgårdandClaude Opus 5 398d8238bd langtool: Validate translated strings, and check AI output before writing it
Placeholders like %1 and %d have to survive translation intact, and they don't
always: the new "validate" command finds 37 strings across four language files
where one got dropped, localized into another script, or split with a space.
It also catches empty translations, line breaks and stray quotes, and exits
non-zero so it can be used as a check in a script.

The same checks now run on everything the AI returns, before it's written to a
file - plus a check that it didn't just echo the English string back at us. A
language that fails is skipped instead of aborting the whole run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0164UKoXpz9r155TRfQsoc3H
2026-08-23 16:18:07 +02:00
Henrik RydgårdandClaude Opus 5 9398629ddf langtool: cargo fmt
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0164UKoXpz9r155TRfQsoc3H
2026-08-23 16:18:07 +02:00
Henrik RydgårdandClaude Opus 5 77e356961d langtool: Add Claude as an alternative to OpenAI for AI translation
New claude.rs talks to the Anthropic Messages API, and ai.rs picks between the
two providers. The provider is chosen with --provider, or guessed from the model
name, or from whichever of ANTHROPIC_API_KEY/OPENAI_API_KEY is set.

Also update the dependencies (and bump the clap requirement to 4.6).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0164UKoXpz9r155TRfQsoc3H
2026-08-23 16:18:07 +02:00
Henrik Rydgård cfc5d74602 Some progress with server status UI 2026-03-30 11:34:19 -06:00
Henrik Rydgård 86dc349c1b Lang fixes 2026-03-07 10:19:17 +01:00
Henrik Rydgård 0791f542ea Fix bug in langtool 2026-03-07 10:03:43 +01:00
Henrik Rydgård 57dffcb571 Refactor langtool a bit 2026-02-20 09:42:58 +01:00
Henrik Rydgård e8927ddf3e langtool: Add new feature to split keys with descriptions into separate key/value 2026-02-19 00:15:49 +01:00
Henrik Rydgård 48d50fe712 Add strings for the two gesture zones 2026-02-04 15:01:06 +01:00
Henrik Rydgård efc920c948 langtool: Clippy fixes, add ability to avoid overwriting already-translated strings with AI 2026-02-04 10:42:41 +01:00
Henrik Rydgård 28bc558619 Langtool: Bump deps 2026-02-04 00:30:01 +01:00
Henrik Rydgård 68ca54bca2 langtool regex: make the replacement parameter optional (default to empty) 2026-01-29 21:53:22 +01:00
Henrik Rydgård 21da9d6900 Langtool: Add regex command. 2026-01-29 21:53:21 +01:00
Henrik Rydgård c232867fba Correct functionality of the display rotation control rotation.
Fixes #19775

A future step might be to also rotate the touch screen inputs..
2026-01-23 01:18:58 +01:00
Henrik Rydgård cd1c89d4cb New hint string for packet relay, auto translated to start with 2026-01-21 01:41:34 +01:00
Henrik Rydgård 6a9b2e1e87 RetroAchievements: Improve completion messages (subset, differentiate hardcore mode) 2026-01-20 18:25:48 +01:00
Henrik Rydgård 481d0fd18c Switch TouchInputFlags to enum class, fix some minor UI issues
Scroll views now only wheel-scroll if the mouse is hovering over them.
2025-12-19 11:38:56 +01:00
Henrik Rydgård 7b05ccafd4 Remove unnecessary linebreaks 2025-11-10 15:34:53 +01:00
Henrik Rydgård 3895bab1dc Fix more translation issues 2025-08-29 22:52:17 +02:00
Henrik Rydgård d4c9e631a9 Fix more translation issues 2025-08-29 01:07:51 +02:00
Henrik Rydgård 23314d1d1a Add shortcut to access the remote debugger from the built-in devmenu 2025-08-24 11:17:18 +02:00
Henrik Rydgård bf62db1846 Prompt tweak 2025-08-22 15:43:40 +02:00
Henrik Rydgård de6d589334 More work on using aliasing 2025-08-22 14:26:59 +02:00
Henrik Rydgård e02d6c531f Tweak the block translation 2025-08-22 14:18:21 +02:00
Henrik Rydgård ed940a9d38 Introduce alias maps built from the reference translation 2025-08-22 14:04:34 +02:00
Henrik Rydgård d62f89618a Work on AI-assisted bulk translations 2025-08-22 13:31:30 +02:00
Henrik Rydgård 4a73560dbd Work on langtool from another branch 2025-08-22 12:28:00 +02:00
Henrik Rydgård 474a5a1329 Warn the user if the desktop display refresh rate is set too low.
Thanks to Arethien on Discord for highlighting this problem.
2025-08-21 10:47:24 +02:00
Henrik Rydgård 9c82e1ebee langtool: Add basic AI translation support 2025-08-21 01:01:17 +02:00
Henrik Rydgård 48e414fd0e Update langtool to latest Rust edition, run clippy fix 2025-07-20 10:25:40 +02:00
Henrik Rydgård 53718cdb21 Add option to allow speed control while connected
It's pretty easy to cheat this anyway by using an old PPSSPP, and some
people seem to want this for PSO.

I put it at the bottom of network settings and added "(not recommended)"
to emphasize that it's, well, not recommended.
2025-06-11 10:36:24 +02:00
Henrik Rydgård e59a9c3248 langtool: Add support to import a single string translated to all languages in a bulk form. 2025-05-25 11:22:05 +02:00
Henrik Rydgård 0351eab366 langtool: Add new command "get-new-keys", to find keys in translated languages that are not in en_US.ini, verbose flag 2025-03-03 15:19:20 +01:00
Henrik Rydgård 05b2d2b19d Make a new error message for invalid zip files. Re-use the old translation 2024-12-02 09:45:35 +01:00
Henrik Rydgård fb075608c3 Langtool: Replace outdated structopt dependency with clap. Gets rid of a github security warning 2024-04-03 08:53:27 +02:00
Henrik Rydgård 21d5257fbf Translation keys etc: Address feedback from TotalCaesar659 2024-01-23 19:23:23 +01:00
Henrik Rydgård 5bf6625740 Translation string 2024-01-20 23:11:30 +01:00
Henrik Rydgård 75a59d100a langtool: When renaming the key of untranslated strings, also change the value. 2023-11-30 17:43:33 +01:00
Henrik Rydgård b76d519682 Minor langtool update 2023-11-26 11:43:40 +01:00
Henrik Rydgård 9f11784c7b Add more missing strings 2023-08-01 13:16:59 +02:00
Henrik Rydgård a1d9dd47eb Add missing strings 2023-04-12 22:55:35 +02:00
Henrik Rydgård ddab8fc0db langtool: Update, fix clippy warnings, just because 2023-03-12 12:26:26 +01:00
Henrik Rydgård cdca958781 Change "Customize tilt..." to "Tilt control setup" 2023-02-02 11:05:33 +01:00
Henrik Rydgård 4802e7810b langtool: improve insertion of missing sections (logging, empty line) 2022-12-12 10:23:27 +01:00
Henrik Rydgård 3ba37f4e77 Langtool: Add --dry-run support 2022-11-29 09:57:18 +01:00
Henrik Rydgård dbd799bce3 Add new translation key "Aspect Ratio" 2022-11-27 19:44:45 +01:00