From 186e538a42a7ec660386e9d5626631966cc402c9 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 20:57:17 +0000 Subject: [PATCH] fix(tools): i18n check verifies admin plural() keys Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC --- src/Titano.Tools/Commands/I18nCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Titano.Tools/Commands/I18nCommand.cs b/src/Titano.Tools/Commands/I18nCommand.cs index 6c677eea..1fab1d74 100644 --- a/src/Titano.Tools/Commands/I18nCommand.cs +++ b/src/Titano.Tools/Commands/I18nCommand.cs @@ -246,7 +246,7 @@ internal sealed partial class I18nCommand : ICommand /// /// Keys referenced from C# (L("…"), Plural("…"), Loc.Get("…"), and any string literal shaped /// Area.Group.Name whose area has a catalog, since reason and warning keys travel as data), XAML - /// ({l:Loc …}) and admin JS (t("…")). + /// ({l:Loc …}) and admin JS (t("…"), plural("…")). /// private static IEnumerable<(string File, string Key)> UsedKeys(string root, IReadOnlySet areas) { @@ -286,7 +286,7 @@ internal sealed partial class I18nCommand : ICommand [GeneratedRegex(@"\{(?:l|loc):Loc\s+(?:Key=)?([A-Z][A-Za-z0-9]*\.[A-Za-z0-9_.]+)")] private static partial Regex XamlKeyRegex(); - [GeneratedRegex(@"(?:\bt\(\s*['""]|data-i18n(?:-[a-z]+)?=['""])([A-Z][A-Za-z0-9]*\.[A-Za-z0-9_.]+)")] + [GeneratedRegex(@"(?:\b(?:t|plural)\(\s*['""]|data-i18n(?:-[a-z]+)?=['""])([A-Z][A-Za-z0-9]*\.[A-Za-z0-9_.]+)")] private static partial Regex JsKeyRegex(); [GeneratedRegex(@"^(one|few|many|other)$")]