Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
bc3f1f6
Update build.sh
NeoCoderMatrix86 May 27, 2025
249524a
Update Readme.md
NeoCoderMatrix86 May 27, 2025
6bdef29
removed images
NeoCoderMatrix86 May 27, 2025
7ec5e5a
Update build.sh
NeoCoderMatrix86 May 27, 2025
295bafb
Update build.sh
NeoCoderMatrix86 May 27, 2025
1521a4e
Update build.sh
NeoCoderMatrix86 May 27, 2025
f4142e1
added build pipeline
NeoCoderMatrix86 Jun 2, 2025
6855f5c
Delete build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
d1a913b
Create build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
33e6414
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
dea7a92
Delete build.sh
NeoCoderMatrix86 Jun 2, 2025
c64597e
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
a4a32d9
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
f942dca
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
6bc1172
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
884c60f
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
030d8ba
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
87f9b66
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
75f1e39
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
0d7eab8
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
ff06c98
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
953b98d
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
284419a
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
e86851c
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
e2f2098
Update run_tests.yml
NeoCoderMatrix86 Jun 2, 2025
1420d06
Merge branch '440-change-language-not-working-on-linux' of https://gi…
NeoCoderMatrix86 Jun 2, 2025
6c87622
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
8f346c9
Update Readme.md
NeoCoderMatrix86 Jun 2, 2025
c91f6f8
added test for language switch
NeoCoderMatrix86 Jun 2, 2025
87c9b6a
fixed switching language
NeoCoderMatrix86 Jun 2, 2025
94964a9
Update build_pipeline.yml
NeoCoderMatrix86 Jun 2, 2025
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
59 changes: 59 additions & 0 deletions .github/workflows/build_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build & Deploy

on:
push:
branches:
- development
- master
workflow_dispatch:

jobs:
run-tests:
uses: ./.github/workflows/run_tests.yml
build:
needs: run-tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# version can be found here https://dotnet.microsoft.com/en-us/download/dotnet/9.0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Install wasm-tools
run: dotnet workload install wasm-tools

- name: Build release
run: dotnet publish AudioCuesheetEditor --configuration Release --output release

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: AudioCuesheetEditor-Release
path: ./release

deploy:
needs: build
runs-on: ubuntu-latest
environment: |-
${{
github.ref_name == 'master' && 'Production'
|| 'Preview'
}}
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: AudioCuesheetEditor-Release
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v3
with:
publish-dir: './wwwroot'
production-deploy: true
fails-without-credentials: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ vars.NETLIFY_SITE_ID }}
3 changes: 2 additions & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Run tests
name: Run Tests

on:
workflow_call:
pull_request:

jobs:
Expand Down
6 changes: 3 additions & 3 deletions AudioCuesheetEditor.End2EndTests/Pages/AboutTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace AudioCuesheetEditor.End2EndTests.Pages
public class AboutTest : PageTest
{
[TestInitialize]
public async Task TestInitialize()
public async Task TestInitializeAsync()
{
await Context.Tracing.StartAsync(new()
{
Expand All @@ -19,7 +19,7 @@ await Context.Tracing.StartAsync(new()
}

[TestCleanup]
public async Task TestCleanup()
public async Task TestCleanupAsync()
{
var failed = new[] { UnitTestOutcome.Failed, UnitTestOutcome.Error, UnitTestOutcome.Timeout, UnitTestOutcome.Aborted }.Contains(TestContext.CurrentTestOutcome);

Expand All @@ -34,7 +34,7 @@ await Context.Tracing.StopAsync(new()
}

[TestMethod]
public async Task HasTitle()
public async Task HasTitleAsync()
{
await Page.GotoAsync("http://localhost:5132/about");
await Expect(Page).ToHaveTitleAsync("AudioCuesheetEditor");
Expand Down
25 changes: 19 additions & 6 deletions AudioCuesheetEditor.End2EndTests/Pages/IndexTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace AudioCuesheetEditor.End2EndTests.Pages
public class IndexTest : PageTest
{
[TestInitialize]
public async Task TestInitialize()
public async Task TestInitializeAsync()
{
await Context.Tracing.StartAsync(new()
{
Expand All @@ -20,7 +20,7 @@ await Context.Tracing.StartAsync(new()
}

[TestCleanup]
public async Task TestCleanup()
public async Task TestCleanupAsync()
{
var failed = new[] { UnitTestOutcome.Failed, UnitTestOutcome.Error, UnitTestOutcome.Timeout, UnitTestOutcome.Aborted }.Contains(TestContext.CurrentTestOutcome);

Expand All @@ -35,15 +35,15 @@ await Context.Tracing.StopAsync(new()
}

[TestMethod]
public async Task HasTitle()
public async Task HasTitleAsync()
{
await Page.GotoAsync("http://localhost:5132/");
await Expect(Page).ToHaveTitleAsync("AudioCuesheetEditor");
await Expect(Page.GetByRole(AriaRole.Button, new() { Name = "AudioCuesheetEditor" })).ToBeVisibleAsync();
}

[TestMethod]
public async Task CheckSettings()
public async Task CheckSettingsAsync()
{
await Page.GotoAsync("http://localhost:5132/");
await Page.GetByRole(AriaRole.Toolbar).GetByRole(AriaRole.Button).Filter(new() { HasTextRegex = new Regex("^$") }).Nth(3).ClickAsync();
Expand All @@ -52,7 +52,7 @@ public async Task CheckSettings()
}

[TestMethod]
public async Task Record()
public async Task RecordAsync()
{
await Page.GotoAsync("http://localhost:5132/");
await Page.GetByText("Record view").ClickAsync();
Expand All @@ -76,7 +76,7 @@ public async Task Record()
}

[TestMethod]
public async Task Import()
public async Task ImportAsync()
{
await Page.GotoAsync("http://localhost:5132/");
await Page.GetByText("Import view").ClickAsync();
Expand All @@ -88,5 +88,18 @@ public async Task Import()
await Page.GetByRole(AriaRole.Textbox, new() { Name = "Cuesheet title" }).ClickAsync();
await Expect(Page.GetByRole(AriaRole.Group).Filter(new() { HasText = "AudiofileAudiofile Search" }).Locator("input[type=\"file\"]")).ToBeEmptyAsync();
}

[TestMethod]
public async Task ChangeLanguageAsync()
{
await Page.GotoAsync("http://localhost:5132/");
await Page.GetByRole(AriaRole.Button, new() { Name = "Change language" }).ClickAsync();
await Page.GetByText("German (Germany)").ClickAsync();
await Expect(Page.GetByRole(AriaRole.Heading, new() { Name = "Abschnitte" })).ToBeVisibleAsync();
await Expect(Page.GetByRole(AriaRole.Heading, new() { Name = "Allgemeine Informationen" })).ToBeVisibleAsync();
await Expect(Page.GetByText("Aufnahmeansicht")).ToBeVisibleAsync();
await Expect(Page.GetByRole(AriaRole.Heading, new() { Name = "Titel" })).ToBeVisibleAsync();
await Expect(Page.GetByRole(AriaRole.Heading, new() { Name = "Wiedergabe" })).ToBeVisibleAsync();
}
}
}
23 changes: 23 additions & 0 deletions AudioCuesheetEditor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services;
using System.Globalization;
using System.Reflection;
using Toolbelt.Blazor.Extensions.DependencyInjection;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
Expand Down Expand Up @@ -64,6 +66,27 @@

builder.Services.AddHotKeys2();

// TODO: Remove this when https://github.com/dotnet/aspnetcore/issues/56824 is fixed

// Get current localization culture
var currentCulture = CultureInfo.DefaultThreadCurrentCulture;

// Get WASM culture provider via reflection
var type = Assembly.GetAssembly(typeof(WebAssemblyHost))!.GetType("Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyCultureProvider");
var instance = type
!.GetProperty("Instance", BindingFlags.Public | BindingFlags.Static)
?.GetValue(null);

// Swap out the "current culture" for the UI (localization) culture
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("de-DE");
// Load the satellite assemblies
await (ValueTask)instance!
.GetType()
.GetMethod("LoadCurrentCultureResourcesAsync", BindingFlags.Public | BindingFlags.Instance)!
.Invoke(instance, [])!;
// Swap the culture back
CultureInfo.DefaultThreadCurrentCulture = currentCulture;

var host = builder.Build();

await host.SetCultureFromConfigurationAsync();
Expand Down
9 changes: 4 additions & 5 deletions AudioCuesheetEditor/Services/UI/LocalizationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static IReadOnlyCollection<CultureInfo> AvailableCultures

public event EventHandler? LocalizationChanged;

public CultureInfo SelectedCulture { get; private set; } = CultureInfo.DefaultThreadCurrentUICulture ?? CultureInfo.CurrentUICulture;
public CultureInfo SelectedCulture => CultureInfo.DefaultThreadCurrentUICulture ?? CultureInfo.CurrentUICulture;

public async Task SetCultureFromConfigurationAsync()
{
Expand All @@ -58,14 +58,13 @@ public async Task ChangeLanguageAsync(string name)
}
}

private Boolean ChangeLanguage(string name)
private static Boolean ChangeLanguage(string name)
{
var newCulture = AvailableCultures.SingleOrDefault(c => c.Name == name);
if (newCulture != null)
{
SelectedCulture = newCulture;
CultureInfo.DefaultThreadCurrentUICulture = SelectedCulture;
CultureInfo.CurrentUICulture = SelectedCulture;
CultureInfo.DefaultThreadCurrentUICulture = newCulture;
CultureInfo.CurrentUICulture = newCulture;
}
return newCulture != null;
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed AudioCuesheetEditor/wwwroot/images/Export1_de.png
Binary file not shown.
Binary file removed AudioCuesheetEditor/wwwroot/images/Export1_en.png
Binary file not shown.
Binary file removed AudioCuesheetEditor/wwwroot/images/Export2_de.png
Binary file not shown.
Binary file removed AudioCuesheetEditor/wwwroot/images/Export2_en.png
Binary file not shown.
Binary file removed AudioCuesheetEditor/wwwroot/images/Export3_de.png
Binary file not shown.
Binary file removed AudioCuesheetEditor/wwwroot/images/Export3_en.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed AudioCuesheetEditor/wwwroot/images/Options1_en.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed AudioCuesheetEditor/wwwroot/images/RecordMode2.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed AudioCuesheetEditor/wwwroot/images/Sections1_de.png
Diff not rendered.
Binary file removed AudioCuesheetEditor/wwwroot/images/Sections1_en.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ Simply open the link https://audiocuesheeteditor.netlify.app/ on any browser

### Production

[![Build & Deploy](https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/actions/workflows/build_pipeline.yml/badge.svg?branch=master)](https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/actions/workflows/build_pipeline.yml)

The current stable version can be found here: https://audiocuesheeteditor.netlify.app/

### Preview

[![Build & Deploy](https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/actions/workflows/build_pipeline.yml/badge.svg?branch=development)](https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/actions/workflows/build_pipeline.yml)

The next release candidate version can be found here: https://preview-audiocuesheeteditor.netlify.app/

## Contributing
Expand Down
18 changes: 0 additions & 18 deletions netlify/build.sh

This file was deleted.