From 56511dc871d4f0c8c7f0ffbd2dfb816f5635d949 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Thu, 1 Oct 2020 10:30:09 -0400 Subject: [PATCH] Handle CRLF in locale files. Previously, LF was expected, so CR (if present) would be in every message. --- core/locale.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/locale.lua b/core/locale.lua index e691f21c2..48701116f 100644 --- a/core/locale.lua +++ b/core/locale.lua @@ -24,7 +24,7 @@ for line in f:lines() do -- Any line that starts with a non-word character except '[' is considered a -- comment. if not line:find('^%s*[^%w_%[]') then - local id, str = line:match('^(.-)%s*=%s*(.+)$') + local id, str = line:match('^(.-)%s*=%s*(.-)\r?$') if id and str and assert(not M[id], 'duplicate locale key "%s"', id) then M[id] = not CURSES and str or str:gsub('_', '') end