search and ai stabilization work, localization stablized.

This commit is contained in:
master
2026-02-24 23:29:36 +02:00
parent 4f947a8b61
commit b07d27772e
766 changed files with 55299 additions and 3221 deletions

View File

@@ -3,6 +3,7 @@ using System.Text;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;
using static StellaOps.Localization.T;
namespace StellaOps.Canonicalization.Json;
@@ -41,6 +42,6 @@ public static class CanonicalJsonSerializer
public static T Deserialize<T>(string json)
{
return JsonSerializer.Deserialize<T>(json, _options)
?? throw new InvalidOperationException($"Failed to deserialize {typeof(T).Name}");
?? throw new InvalidOperationException(_t("common.canonicalization.deserialize_failed", typeof(T).Name));
}
}

View File

@@ -1,6 +1,7 @@
using System.Globalization;
using System.Text.Json;
using System.Text.Json.Serialization;
using static StellaOps.Localization.T;
namespace StellaOps.Canonicalization.Json;
@@ -11,7 +12,7 @@ public sealed class Iso8601DateTimeConverter : JsonConverter<DateTimeOffset>
{
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
=> DateTimeOffset.Parse(
reader.GetString() ?? throw new JsonException("DateTimeOffset value is null."),
reader.GetString() ?? throw new JsonException(_t("common.canonicalization.datetime_value_null")),
CultureInfo.InvariantCulture,
DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal);

View File

@@ -1,6 +1,7 @@
using System.Globalization;
using System.Text.Json;
using System.Text.Json.Serialization;
using static StellaOps.Localization.T;
namespace StellaOps.Canonicalization.Json;
@@ -48,7 +49,7 @@ public sealed class StableDictionaryConverter<TKey, TValue> : JsonConverter<IDic
{
if (key is null)
{
throw new ArgumentException("Dictionary key cannot be null.", nameof(key));
throw new ArgumentException(_t("common.canonicalization.dict_key_null"), nameof(key));
}
return key switch

View File

@@ -7,4 +7,8 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\StellaOps.Localization\StellaOps.Localization.csproj" />
</ItemGroup>
</Project>