From 2e88e82cae4b2e7e58fa5944565e0d82b6b9f8c7 Mon Sep 17 00:00:00 2001 From: agrajaghh Date: Fri, 30 Sep 2016 10:04:11 +0200 Subject: [PATCH] count the lines from the beginning not from the end --- BuildTools/LocalizationTool2/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildTools/LocalizationTool2/Program.cs b/BuildTools/LocalizationTool2/Program.cs index 7030b7317..9fd7d69bd 100644 --- a/BuildTools/LocalizationTool2/Program.cs +++ b/BuildTools/LocalizationTool2/Program.cs @@ -49,7 +49,7 @@ namespace LocalizationTool2 var txt = File.ReadAllText(f); foreach (Match match in re.Matches(txt)) { - var linepos = txt.Substring(match.Index).Count(x => x == '\n'); + var linepos = txt.Substring(0, match.Index).Count(x => x == '\n') + 1; var str = match.Groups["sourcestring"].Value.Replace("\n", "\\n").Replace("\r", "\\r"); LocalizationEntry le; if (!map.TryGetValue(str, out le))