Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions .github/workflows/american-to-british.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Build AmericanToBritish (SE5)

on:
push:
branches: [main]
paths:
- 'se5/AmericanToBritish/**'
- 'se5/Plugin-Shared/**'
- '.github/workflows/american-to-british.yml'
pull_request:
paths:
- 'se5/AmericanToBritish/**'
- 'se5/Plugin-Shared/**'
- '.github/workflows/american-to-british.yml'
workflow_dispatch:
inputs:
tag:
description: 'Release tag to publish the zips under (e.g. se5-american-to-british-v1.0). Leave empty to build artifacts only.'
required: false
type: string

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- rid: win-x64
os: windows
exe: AmericanToBritish.exe
- rid: win-arm64
os: windows
exe: AmericanToBritish.exe
- rid: linux-x64
os: linux
exe: AmericanToBritish
- rid: linux-arm64
os: linux
exe: AmericanToBritish
- rid: osx-x64
os: macos
exe: AmericanToBritish
- rid: osx-arm64
os: macos
exe: AmericanToBritish

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Publish self-contained (${{ matrix.rid }})
working-directory: se5/AmericanToBritish
run: |
dotnet publish AmericanToBritish.csproj \
-c Release \
-r ${{ matrix.rid }} \
--self-contained true \
-p:DebugType=None \
-p:DebugSymbols=false \
-o staging/AmericanToBritish

- name: Rewrite plugin.json for ${{ matrix.os }}
working-directory: se5/AmericanToBritish
run: |
jq '
del(.runtime, .entry) |
.executables = { "${{ matrix.os }}": "${{ matrix.exe }}" }
' plugin.json > staging/AmericanToBritish/plugin.json

- name: Package zip
working-directory: se5/AmericanToBritish/staging
run: zip -r "$GITHUB_WORKSPACE/AmericanToBritish-${{ matrix.rid }}.zip" AmericanToBritish

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: AmericanToBritish-${{ matrix.rid }}
path: AmericanToBritish-${{ matrix.rid }}.zip

release:
name: Publish GitHub Release
needs: build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all zips
uses: actions/download-artifact@v4
with:
path: dist
pattern: AmericanToBritish-*
merge-multiple: true

- name: Create release and upload zips
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.event.inputs.tag }}" dist/AmericanToBritish-*.zip \
--repo "${{ github.repository }}" \
--target "${{ github.sha }}" \
--title "AmericanToBritish ${{ github.event.inputs.tag }}" \
--notes "Self-contained AmericanToBritish plugin builds for win/linux/osx (x64 + arm64)."
109 changes: 109 additions & 0 deletions .github/workflows/british-to-american.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Build BritishToAmerican (SE5)

on:
push:
branches: [main]
paths:
- 'se5/BritishToAmerican/**'
- 'se5/Plugin-Shared/**'
- '.github/workflows/british-to-american.yml'
pull_request:
paths:
- 'se5/BritishToAmerican/**'
- 'se5/Plugin-Shared/**'
- '.github/workflows/british-to-american.yml'
workflow_dispatch:
inputs:
tag:
description: 'Release tag to publish the zips under (e.g. se5-british-to-american-v1.0). Leave empty to build artifacts only.'
required: false
type: string

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- rid: win-x64
os: windows
exe: BritishToAmerican.exe
- rid: win-arm64
os: windows
exe: BritishToAmerican.exe
- rid: linux-x64
os: linux
exe: BritishToAmerican
- rid: linux-arm64
os: linux
exe: BritishToAmerican
- rid: osx-x64
os: macos
exe: BritishToAmerican
- rid: osx-arm64
os: macos
exe: BritishToAmerican

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Publish self-contained (${{ matrix.rid }})
working-directory: se5/BritishToAmerican
run: |
dotnet publish BritishToAmerican.csproj \
-c Release \
-r ${{ matrix.rid }} \
--self-contained true \
-p:DebugType=None \
-p:DebugSymbols=false \
-o staging/BritishToAmerican

- name: Rewrite plugin.json for ${{ matrix.os }}
working-directory: se5/BritishToAmerican
run: |
jq '
del(.runtime, .entry) |
.executables = { "${{ matrix.os }}": "${{ matrix.exe }}" }
' plugin.json > staging/BritishToAmerican/plugin.json

- name: Package zip
working-directory: se5/BritishToAmerican/staging
run: zip -r "$GITHUB_WORKSPACE/BritishToAmerican-${{ matrix.rid }}.zip" BritishToAmerican

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: BritishToAmerican-${{ matrix.rid }}
path: BritishToAmerican-${{ matrix.rid }}.zip

release:
name: Publish GitHub Release
needs: build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all zips
uses: actions/download-artifact@v4
with:
path: dist
pattern: BritishToAmerican-*
merge-multiple: true

- name: Create release and upload zips
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.event.inputs.tag }}" dist/BritishToAmerican-*.zip \
--repo "${{ github.repository }}" \
--target "${{ github.sha }}" \
--title "BritishToAmerican ${{ github.event.inputs.tag }}" \
--notes "Self-contained BritishToAmerican plugin builds for win/linux/osx (x64 + arm64)."
34 changes: 34 additions & 0 deletions se5-plugins.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
{
"plugins": [
{
"name": "British to American",
"description": "Converts British English spellings to American English in the subtitle. Shows a checkable preview of every proposed change.",
"version": "1.0.0",
"author": "Subtitle Edit",
"url": "https://github.com/SubtitleEdit/plugins/tree/main/se5/BritishToAmerican",
"date": "2026-05-17",
"minSeVersion": "5.0.0",
"downloads": {
"win-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-british-to-american-v1.0/BritishToAmerican-win-x64.zip",
"win-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-british-to-american-v1.0/BritishToAmerican-win-arm64.zip",
"linux-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-british-to-american-v1.0/BritishToAmerican-linux-x64.zip",
"linux-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-british-to-american-v1.0/BritishToAmerican-linux-arm64.zip",
"osx-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-british-to-american-v1.0/BritishToAmerican-osx-x64.zip",
"osx-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-british-to-american-v1.0/BritishToAmerican-osx-arm64.zip"
}
},
{
"name": "American to British",
"description": "Converts American English spellings to British English in the subtitle. Shows a checkable preview of every proposed change.",
"version": "1.0.0",
"author": "Subtitle Edit",
"url": "https://github.com/SubtitleEdit/plugins/tree/main/se5/AmericanToBritish",
"date": "2026-05-17",
"minSeVersion": "5.0.0",
"downloads": {
"win-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-american-to-british-v1.0/AmericanToBritish-win-x64.zip",
"win-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-american-to-british-v1.0/AmericanToBritish-win-arm64.zip",
"linux-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-american-to-british-v1.0/AmericanToBritish-linux-x64.zip",
"linux-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-american-to-british-v1.0/AmericanToBritish-linux-arm64.zip",
"osx-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-american-to-british-v1.0/AmericanToBritish-osx-x64.zip",
"osx-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-american-to-british-v1.0/AmericanToBritish-osx-arm64.zip"
}
},
{
"name": "Typewriter effect",
"description": "Splits each subtitle line into short timed parts that progressively reveal the text, character by character.",
Expand Down
18 changes: 18 additions & 0 deletions se5/AmericanToBritish/AmericanToBritish.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>AmericanToBritish</AssemblyName>
<RootNamespace>SubtitleEdit.Plugins.AmericanToBritish</RootNamespace>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Plugin-Shared\Plugin-Shared.csproj" />
</ItemGroup>

</Project>
8 changes: 8 additions & 0 deletions se5/AmericanToBritish/App.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SubtitleEdit.Plugins.AmericanToBritish.App"
RequestedThemeVariant="Default">
<Application.Styles>
<FluentTheme />
</Application.Styles>
</Application>
13 changes: 13 additions & 0 deletions se5/AmericanToBritish/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using SubtitleEdit.Plugins.Shared;

namespace SubtitleEdit.Plugins.AmericanToBritish;

public partial class App : PluginApp
{
public override void Initialize() => AvaloniaXamlLoader.Load(this);

protected override Window CreateMainWindow(PluginRequest request) => new MainWindow(request);
}
20 changes: 20 additions & 0 deletions se5/AmericanToBritish/ChangeProposal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using CommunityToolkit.Mvvm.ComponentModel;

namespace SubtitleEdit.Plugins.AmericanToBritish;

public partial class ChangeProposal : ObservableObject
{
[ObservableProperty] private bool _include = true;

public int LineIndex { get; }
public string LineNumber => (LineIndex + 1).ToString();
public string OriginalText { get; }
public string ConvertedText { get; }

public ChangeProposal(int lineIndex, string originalText, string convertedText)
{
LineIndex = lineIndex;
OriginalText = originalText;
ConvertedText = convertedText;
}
}
Loading
Loading