-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from Ashampoo/develop
Prerelease
- Loading branch information
Showing
173 changed files
with
2,272 additions
and
5,229 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |
This file contains 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
This file contains 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
This file contains 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
38 changes: 38 additions & 0 deletions
38
...rmats.JavaProperties.Test/Ashampoo.Translation.Systems.Formats.JavaProperties.Test.csproj
This file contains 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
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> |
43 changes: 43 additions & 0 deletions
43
Ashampoo.Translation.Systems.Formats.JavaProperties.Test/FormatTest.cs
This file contains 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
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(); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
Ashampoo.Translation.Systems.Formats.JavaProperties.Test/GlobalUsings.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
global using Xunit; |
Oops, something went wrong.