diff --git a/se5/BritishToAmerican/README.md b/se5/BritishToAmerican/README.md index 3c4aee7..59944dd 100644 --- a/se5/BritishToAmerican/README.md +++ b/se5/BritishToAmerican/README.md @@ -5,6 +5,11 @@ opposite direction. Reuses the bundled word list (~1850 pairs) and the shared `EnglishVariantConverter` from [`Plugin-Shared`](../Plugin-Shared/) with `Direction = BrToUs`. +Word list pairs marked `only="UsToBr"` are skipped in this direction: their +British-side word is also standard American English (car, film, flat, lift, +torch...), so "converting" it would rewrite text that is already correct +American (issue [#14374](https://github.com/SubtitleEdit/subtitleedit/issues/14374)). + ## Build See `.github/workflows/british-to-american.yml`. diff --git a/se5/Plugin-Shared/EnglishVariantConverter.cs b/se5/Plugin-Shared/EnglishVariantConverter.cs index f02a468..b13e1c2 100644 --- a/se5/Plugin-Shared/EnglishVariantConverter.cs +++ b/se5/Plugin-Shared/EnglishVariantConverter.cs @@ -81,6 +81,15 @@ private void LoadBuiltInWordList() continue; } + // only="UsToBr" / only="BrToUs" restricts a pair to one direction. Used for + // vocabulary pairs whose "source" word is also standard in the target dialect + // (car, film, flat, lift...) - converting those would corrupt correct text. + var only = element.Attribute("only")?.Value; + if (only != null && !only.Equals(_direction.ToString(), StringComparison.OrdinalIgnoreCase)) + { + continue; + } + var (from, to) = _direction == EnglishVariantDirection.UsToBr ? (us, br) : (br, us); AddRule(from, to); diff --git a/se5/Plugin-Shared/WordList.xml b/se5/Plugin-Shared/WordList.xml index b469cd6..f347487 100644 --- a/se5/Plugin-Shared/WordList.xml +++ b/se5/Plugin-Shared/WordList.xml @@ -14,7 +14,7 @@ - + @@ -61,8 +61,8 @@ - - + + @@ -246,8 +246,8 @@ - - + + @@ -401,7 +401,7 @@ - + @@ -548,7 +548,6 @@ - @@ -621,12 +620,12 @@ - + - - + + @@ -688,7 +687,7 @@ - + @@ -757,9 +756,8 @@ - + - @@ -878,8 +876,8 @@ - - + + @@ -1231,14 +1229,14 @@ - - - - - - - - + + + + + + + +