Add Plugin-Shared library + AmericanToBritish & BritishToAmerican plugins#272
Merged
Conversation
Plugin-Shared is a small Avalonia 11 / .NET 8 library that future SE5 plugins can reference instead of copy-pasting boilerplate: - PluginContract.cs - request/response/subtitle DTOs (was inlined in Haxor and TypewriterEffect). - PluginApp - Application base that reads request.theme and sets RequestedThemeVariant so plugins match SE's Dark/Light theme. - PluginBootstrap.Run<TApp>(args) - parses the request JSON from the first command-line argument, starts Avalonia, writes the response on exit, returns 0. - SubRipParser - lifted out of TypewriterEffect. - WindowExtensions.BringToForeground() - the Topmost-toggle pattern used to force the plugin window in front of SE on macOS. AmericanToBritish is the first plugin to use it: ports the SE4 converter (regex word list with case variants + the colour-in-font-tag revert), bundles the ~1000-pair WordList.xml as an embedded resource, and shows a checkable preview list of every proposed change before applying. Apply only the checked ones; Cancel does nothing. UI uses the shared Plugin-Shared boot + theme. Workflow .github/workflows/american-to-british.yml mirrors typewriter.yml: matrix self-contained publish for the six supported RIDs, plugin.json rewritten with per-OS executables block per zip, and a GitHub release on manual dispatch with a tag. se5-plugins.json updated to advertise AmericanToBritish via the per-platform downloads map pointing at the planned se5-american-to-british-v1.0 release tag. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Plugin-Shared changes: - Move WordList.xml and the converter (now EnglishVariantConverter with a Direction enum) into Plugin-Shared so both directions reuse one word list. Embedded as a resource of the shared library. - Word list fix: "anticlockwise" / "counterclockwise" was reversed (anticlockwise is the British form). Swapped. - Word list growth: +225 entries, taking it from 1013 to 1238 pairs. Adds the ~50 most common -ize/-ise verbs missing from the list (memorize, scrutinize, finalize, modernize, summarize, specialize, sympathize, moisturize, prioritize, normalize, legalize, visualize, terrorize, traumatize, hospitalize, humanize, stabilize, mobilize, neutralize, etc.) with all four conjugations each (base, -d, -s, -ing), plus math/maths, fetus/foetus (and fetal, fetuses), and a handful of unambiguous vocab pairs (truck/lorry, elevator/lift, apartment/flat, sidewalk/pavement, flashlight/torch, gasoline/petrol, eggplant/aubergine, zucchini/courgette, diaper/nappy). BritishToAmerican plugin: mirror of AmericanToBritish using the same shared converter with Direction = BrToUs. Same preview UI (checkbox per change, line number, before/after, select all/none, accent Apply, "Not supported on this platform" empty state). AmericanToBritish: - Drop local WordList.xml and the converter, switch MainWindow to use EnglishVariantConverter with Direction = UsToBr. Workflow .github/workflows/british-to-american.yml mirrors the AmTBr one; se5-plugins.json gets a BritishToAmerican entry pointing at the planned se5-british-to-american-v1.0 release. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
`se5/Plugin-Shared/` (new library)
Small Avalonia 11 / .NET 8 class library that SE5 plugins reference instead of copy-pasting boilerplate.
Word-list review + growth
`se5/AmericanToBritish/` (new plugin)
Faithful port of the SE4 American to British converter (regex word list with lowercase / UPPERCASE / Titlecase variants + the `color`-in-``-tag revert). UI is a clean Avalonia preview window:
`se5/BritishToAmerican/` (new plugin)
Mirror of AmericanToBritish using `Direction = BrToUs`. Same UI shell, same shared converter, same word list.
Build + index
Out of scope (next PR)
Test plan
🤖 Generated with Claude Code