Skip to content

Commit

Permalink
Merge pull request #67 from Ashampoo/develop
Browse files Browse the repository at this point in the history
release
  • Loading branch information
tjorvenK authored Feb 28, 2024
2 parents 21ef44f + 03b1d02 commit 4128e5d
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StronglyTypedId" Version="1.0.0-beta07" />
<PackageReference Include="Strongly" Version="1.5.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface IFormatProvider<out T> where T : class, IFormat
/// <summary>
/// Returns the supported file extensions of the format provider.
/// </summary>
string[] SupportedFileExtensions { get; }
IEnumerable<string> SupportedFileExtensions { get; }

/// <summary>
/// Creates a new instance of the format builder.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using StronglyTypedIds;
using Strongly;

namespace Ashampoo.Translation.Systems.Formats.Abstractions.Models;

/// <summary>
/// Represents a strongly typed identifier for a language.
/// </summary>
[StronglyTypedId(Template.String)]
[Strongly(StronglyType.String, StronglyConverter.SystemTextJson, StronglyImplementations.IEquatable |StronglyImplementations.Parsable)]
public readonly partial struct Language;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Ashampoo.Translation.Systems.Formats.AshLang;
public sealed class AshLangFormatProvider : IFormatProvider<AshLangFormat>
{
/// <inheritdoc />
public string Id { get; } = "ashlang";
public string Id => "ashlang";

/// <inheritdoc />
public AshLangFormat Create() => new();
Expand All @@ -20,7 +20,7 @@ public bool SupportsFileName(string fileName)
}

/// <inheritdoc />
public string[] SupportedFileExtensions => [".ashlang"];
public IEnumerable<string> SupportedFileExtensions => [".ashlang"];

/// <inheritdoc />
public IFormatBuilder<AshLangFormat> GetFormatBuilder() => new AshLangFormatBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Ashampoo.Translation.Systems.Formats.Gengo;
public sealed class GengoFormatProvider : IFormatProvider<GengoFormat>
{
/// <inheritdoc />
public string Id { get; } = "gengo";
public string Id => "gengo";

/// <inheritdoc />
public GengoFormat Create() => new();
Expand All @@ -20,7 +20,7 @@ public bool SupportsFileName(string fileName)
}

/// <inheritdoc />
public string[] SupportedFileExtensions { get; } = [".xlsx", ".xls"];
public IEnumerable<string> SupportedFileExtensions { get; } = [".xlsx", ".xls"];

/// <inheritdoc />
public IFormatBuilder<GengoFormat> GetFormatBuilder() => new GengoFormatBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private async Task<bool> ConfigureOptionsAsync(FormatReadOptions? options)
}
else
{
Header.TargetLanguage = (Language)options.TargetLanguage!;
Header.TargetLanguage = options.TargetLanguage!;
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ namespace Ashampoo.Translation.Systems.Formats.JavaProperties;
public sealed class JavaPropertiesFormatProvider : IFormatProvider<JavaPropertiesFormat>
{
/// <inheritdoc />
public string Id { get; } = "javaProperties";
public string Id => "javaProperties";

/// <inheritdoc />
public JavaPropertiesFormat Create() => new();

Expand All @@ -19,7 +20,7 @@ public bool SupportsFileName(string fileName)
}

/// <inheritdoc />
public string[] SupportedFileExtensions { get; } = [".properties"];
public IEnumerable<string> SupportedFileExtensions { get; } = [".properties"];
/// <inheritdoc />
public IFormatBuilder<JavaPropertiesFormat> GetFormatBuilder() => new JavaPropertiesFormatBuilder();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Ashampoo.Translation.Systems.Formats.Json;
public sealed class JsonFormatProvider : IFormatProvider<JsonFormat>
{
/// <inheritdoc />
public string Id { get; } = "json";
public string Id => "json";

/// <inheritdoc />
public JsonFormat Create() => new();
Expand All @@ -20,7 +20,7 @@ public bool SupportsFileName(string fileName)
}

/// <inheritdoc />
public string[] SupportedFileExtensions { get; } = [".json"];
public IEnumerable<string> SupportedFileExtensions { get; } = [".json"];

/// <inheritdoc />
public IFormatBuilder<JsonFormat> GetFormatBuilder() => new JsonFormatBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace Ashampoo.Translation.Systems.Formats.NLang;

/// <summary>
/// Implementation of <see cref="IFormatProvider"/> for the NLang format.
/// Implementation of <see cref="IFormatProvider{T}"/> for the NLang format.
/// </summary>
public sealed class NLangFormatProvider : IFormatProvider<NLangFormat>
{
/// <inheritdoc />
public string Id { get; } = "nlang";
public string Id => "nlang";

/// <inheritdoc />
public NLangFormat Create() => new();
Expand All @@ -20,7 +20,7 @@ public bool SupportsFileName(string fileName)
}

/// <inheritdoc />
public string[] SupportedFileExtensions { get; } = [".nlang3"];
public IEnumerable<string> SupportedFileExtensions { get; } = [".nlang3"];

/// <inheritdoc />
public IFormatBuilder<NLangFormat> GetFormatBuilder() => new NLangFormatBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Ashampoo.Translation.Systems.Formats.PO;
public sealed class POFormatProvider : IFormatProvider<POFormat>
{
/// <inheritdoc />
public string Id { get; } = "po";
public string Id => "po";

/// <inheritdoc />
public POFormat Create() => new();
Expand All @@ -21,7 +21,7 @@ public bool SupportsFileName(string fileName)
}

/// <inheritdoc />
public string[] SupportedFileExtensions { get; } = [".po"];
public IEnumerable<string> SupportedFileExtensions { get; } = [".po"];

/// <inheritdoc />
public IFormatBuilder<POFormat> GetFormatBuilder() => new POFormatBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace Ashampoo.Translation.Systems.Formats.ResX;

/// <summary>
/// Implementation of <see cref="IFormatProvider"/> interface for the ResX format.
/// Implementation of <see cref="IFormatProvider{T}"/> interface for the ResX format.
/// </summary>
public sealed class ResXFormatProvider : IFormatProvider<ResXFormat>
{
/// <inheritdoc />
public string Id { get; } = "resx";
public string Id => "resx";

/// <inheritdoc />
public ResXFormat Create() => new();
Expand All @@ -20,7 +20,7 @@ public bool SupportsFileName(string fileName)
}

/// <inheritdoc />
public string[] SupportedFileExtensions { get; } = [".resx"];
public IEnumerable<string> SupportedFileExtensions { get; } = [".resx"];

/// <inheritdoc />
public IFormatBuilder<ResXFormat> GetFormatBuilder() => new ResXFormatBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Ashampoo.Translation.Systems.Formats.TsProj;
public sealed class TsProjFormatProvider : IFormatProvider<TsProjFormat>
{
/// <inheritdoc />
public string Id { get; } = "tsproj";
public string Id => "tsproj";

/// <inheritdoc />
public TsProjFormat Create() => new();
Expand All @@ -18,7 +18,7 @@ public bool SupportsFileName(string fileName)
}

/// <inheritdoc />
public string[] SupportedFileExtensions { get; } = [".tsproj"];
public IEnumerable<string> SupportedFileExtensions { get; } = [".tsproj"];

/// <inheritdoc />
public IFormatBuilder<TsProjFormat> GetFormatBuilder() => new TsProjFormatBuilder();
Expand Down

0 comments on commit 4128e5d

Please sign in to comment.