From a83a1d95ebbdfc62f848f813089002a274806e2f Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 15 Jun 2016 08:50:42 -0400 Subject: Be more liberal about comments in locale files and use '#' by default. --- core/locale.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/locale.lua') diff --git a/core/locale.lua b/core/locale.lua index 204304ca..f5ba07b6 100644 --- a/core/locale.lua +++ b/core/locale.lua @@ -17,7 +17,9 @@ end if not f then f = io.open(_HOME..'/core/locale.conf', 'rb') end assert(f, '"core/locale.conf" not found.') for line in f:lines() do - if not line:find('^%s*%%') then + -- 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*(.+)$') if id and str then M[id] = not CURSES and str or str:gsub('_', '') end end -- cgit v1.2.3