Skip to content

Commit

Permalink
Merge pull request #61 from Ashampoo/develop
Browse files Browse the repository at this point in the history
Prerelease
  • Loading branch information
tjorvenK authored Feb 21, 2024
2 parents 9e41f7c + ab430a6 commit 783e5eb
Show file tree
Hide file tree
Showing 173 changed files with 2,272 additions and 5,229 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ on:
- "**.json"

env:
DOTNET_VERSION: "7.0.x" # The .NET SDK version to use
DOTNET_VERSION: "8.x" # The .NET SDK version to use

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand Down
41 changes: 2 additions & 39 deletions .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,48 +27,11 @@ jobs:
run: |
TAG=${{ needs.generate-version.outputs.version }}
echo ::set-output name=version::${TAG#v}
create-release-branch:
needs: generate-version
if: ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0
- name: Create Release Branch
run: git checkout -b release/${{ needs.generate-version.outputs.version }}
- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email [email protected]
- name: Push new branch
run: git push origin release/${{ needs.generate-version.outputs.version}}
set-matrix:
needs: [ generate-version ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: set-matrix
id: set-matrix
run: echo "::set-output name=matrix::$(ls src/Ashampoo.Translation.Systems.*/src/Ashampoo.Translation.Systems.*.csproj | sed -r 's/.*\/(.*).csproj$/\1/' | jq -R -s -c 'split("\n")[:-1]'))"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

publish-nuget-packages:
needs: [ generate-version, remove-prefix-from-version ,set-matrix ]
strategy:
matrix:
project_name: ${{ fromJson(needs.set-matrix.outputs.matrix) }}
needs: [ generate-version, remove-prefix-from-version ]
uses: ./.github/workflows/reuse-publish-nuget-package.yml
with:
project_name: ${{ matrix.project_name }}
project_name: "Ashampoo.Translation.Systems.Formats"
version: ${{ needs.remove-prefix-from-version.outputs.version }}
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
version: ${{ steps.PrereleaseVersion.outputs.version || steps.ReleaseVersion.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/reuse-publish-nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
type: string

env:
DOTNET_VERSION: "7.0.x" # The .NET SDK version to use
DOTNET_VERSION: "8.x" # The .NET SDK version to use

jobs:
publish-nuget-package:
Expand All @@ -23,11 +23,11 @@ jobs:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand Down
24 changes: 12 additions & 12 deletions Ashampoo-Translation-Systems.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ashampoo.Translation.System
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ashampoo.Translation.Systems.Formats.TsProj.Tests", "src\Ashampoo.Translation.Systems.Formats.TsProj\tests\Ashampoo.Translation.Systems.Formats.TsProj.Tests.csproj", "{4DDC2740-501A-4760-8384-21B9D2F994DD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ashampoo.Translation.Systems.Components", "src\Ashampoo.Translation.Systems.Components\src\Ashampoo.Translation.Systems.Components.csproj", "{D8C6BB19-A1D1-4CEC-A605-31B8A2C58FDC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ashampoo.Translation.Systems.Formats.Abstractions.Tests", "src\Ashampoo.Translation.Systems.Formats.Abstractions\tests\Ashampoo.Translation.Systems.Formats.Abstractions.Tests.csproj", "{5C56057B-2927-4CB0-B9E2-13154699CD8E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ashampoo.Translation.Systems.TestBase", "src\tests\Ashampoo.Translation.Systems.TestBase\Ashampoo.Translation.Systems.TestBase.csproj", "{44657DFF-FC50-40E9-82E8-8FC9E4EDE1B4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ashampoo.Translation.Systems.Formats.ResX.Tests", "src\Ashampoo.Translation.Systems.Formats.ResX\tests\Ashampoo.Translation.Systems.Formats.ResX.Tests.csproj", "{E0532127-BDF8-4E7A-9A4E-A41C17B6B27E}"
Expand All @@ -38,6 +34,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ashampoo.Translation.System
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ashampoo.Translation.Systems.Formats", "src\Ashampoo.Translation.Systems.Formats\src\Ashampoo.Translation.Systems.Formats.csproj", "{53389A5D-6790-4E38-A2C5-1B0D74B76DCF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ashampoo.Translation.Systems.Formats.JavaProperties", "Ashampoo.Translation.Systems.Formats.JavaProperties\Ashampoo.Translation.Systems.Formats.JavaProperties.csproj", "{4481C61F-6BF8-4FE4-8576-1FFEA0B67BF8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ashampoo.Translation.Systems.Formats.JavaProperties.Test", "Ashampoo.Translation.Systems.Formats.JavaProperties.Test\Ashampoo.Translation.Systems.Formats.JavaProperties.Test.csproj", "{B31DF60F-D7D6-4D9A-BE2A-3A7089E27118}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -88,14 +88,6 @@ Global
{4DDC2740-501A-4760-8384-21B9D2F994DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4DDC2740-501A-4760-8384-21B9D2F994DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4DDC2740-501A-4760-8384-21B9D2F994DD}.Release|Any CPU.Build.0 = Release|Any CPU
{D8C6BB19-A1D1-4CEC-A605-31B8A2C58FDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D8C6BB19-A1D1-4CEC-A605-31B8A2C58FDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D8C6BB19-A1D1-4CEC-A605-31B8A2C58FDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D8C6BB19-A1D1-4CEC-A605-31B8A2C58FDC}.Release|Any CPU.Build.0 = Release|Any CPU
{5C56057B-2927-4CB0-B9E2-13154699CD8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C56057B-2927-4CB0-B9E2-13154699CD8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C56057B-2927-4CB0-B9E2-13154699CD8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C56057B-2927-4CB0-B9E2-13154699CD8E}.Release|Any CPU.Build.0 = Release|Any CPU
{44657DFF-FC50-40E9-82E8-8FC9E4EDE1B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44657DFF-FC50-40E9-82E8-8FC9E4EDE1B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44657DFF-FC50-40E9-82E8-8FC9E4EDE1B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -124,5 +116,13 @@ Global
{3D6B80E7-4C45-4400-A973-C468C6BB1EE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D6B80E7-4C45-4400-A973-C468C6BB1EE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D6B80E7-4C45-4400-A973-C468C6BB1EE6}.Release|Any CPU.Build.0 = Release|Any CPU
{4481C61F-6BF8-4FE4-8576-1FFEA0B67BF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4481C61F-6BF8-4FE4-8576-1FFEA0B67BF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4481C61F-6BF8-4FE4-8576-1FFEA0B67BF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4481C61F-6BF8-4FE4-8576-1FFEA0B67BF8}.Release|Any CPU.Build.0 = Release|Any CPU
{B31DF60F-D7D6-4D9A-BE2A-3A7089E27118}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B31DF60F-D7D6-4D9A-BE2A-3A7089E27118}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B31DF60F-D7D6-4D9A-BE2A-3A7089E27118}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B31DF60F-D7D6-4D9A-BE2A-3A7089E27118}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="coverlet.collector" Version="6.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Ashampoo.Translation.Systems.Formats.JavaProperties\Ashampoo.Translation.Systems.Formats.JavaProperties.csproj" />
<ProjectReference Include="..\src\Ashampoo.Translation.Systems.Formats.Abstractions\src\Ashampoo.Translation.Systems.Formats.Abstractions.csproj" />
<ProjectReference Include="..\src\tests\Ashampoo.Translation.Systems.TestBase\Ashampoo.Translation.Systems.TestBase.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="_TestFiles_\messages.properties">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="_TestFiles_\messages_de.properties">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using Ashampoo.Translation.Systems.Formats.Abstractions;
using Ashampoo.Translation.Systems.Formats.Abstractions.Models;
using Ashampoo.Translation.Systems.Formats.Abstractions.Translation;
using Ashampoo.Translation.Systems.TestBase;
using FluentAssertions;

namespace Ashampoo.Translation.Systems.Formats.JavaProperties.Test;

public class FormatTest : FormatTestBase<JavaPropertiesFormat>
{
[Fact]
public void NewFormat()
{
IFormat format = CreateFormat();

format.Should().NotBeNull();
format.TranslationUnits.Should().BeEmpty();
format.Header.SourceLanguage.Should().BeNull();
format.Header.TargetLanguage.Value.Should().BeEmpty();
}

[Fact]
public void ReadFromFile()
{
IFormat format =
CreateAndReadFromFile("messages_de.properties", new FormatReadOptions() { TargetLanguage = new Language("de-DE") });
const string id = "aboutTheApp";

foreach (var unit in format.TranslationUnits)
{
unit.Translations.Should().ContainSingle();
}

format.TranslationUnits.Count.Should().Be(186);

var foundById = format.TranslationUnits.GetTranslationUnit(id);
foundById.Should().NotBeNull();
var translationString = foundById.Translations.GetTranslation(new Language("de-DE"));
translationString.Should().NotBeNull();
translationString!.Value.Should().Be("Über Photos");
translationString.Comment.Should().BeNull();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Xunit;
Loading

0 comments on commit 783e5eb

Please sign in to comment.