From 7b621578ea62322083d3131053fd85faf71a2331 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 27 Apr 2025 08:23:17 +0200 Subject: [PATCH] Fix the I18N key collection to handle multiple quotes in content --- app/Build/Commands/CollectI18NKeysCommand.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Build/Commands/CollectI18NKeysCommand.cs b/app/Build/Commands/CollectI18NKeysCommand.cs index 896c606c..f7a533f9 100644 --- a/app/Build/Commands/CollectI18NKeysCommand.cs +++ b/app/Build/Commands/CollectI18NKeysCommand.cs @@ -146,14 +146,23 @@ public sealed partial class CollectI18NKeysCommand var content = fileContent; while (startIdx > -1) { + // + // In some cases, after the initial " there follow more " characters. + // We need to skip them: + // content = content[(startIdx + START_TAG.Length)..]; + while(content[0] == '"') + content = content[1..]; + var endIdx = content.IndexOf(END_TAG); if (endIdx == -1) break; var match = content[..endIdx]; - matches.Add(match.ToString()); + while (match[^1] == '"') + match = match[..^1]; + matches.Add(match.ToString()); startIdx = content.IndexOf(START_TAG); }