diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2016-06-15 08:50:42 -0400 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2016-06-15 08:50:42 -0400 |
commit | a83a1d95ebbdfc62f848f813089002a274806e2f (patch) | |
tree | eeba4a9910cf324d0be4014ed94807249ea3b0c9 /core/locale.lua | |
parent | 465cf8345a38fdb078672c34dbd25c4e89c3dcf6 (diff) |
Be more liberal about comments in locale files and use '#' by default.
Diffstat (limited to 'core/locale.lua')
-rw-r--r-- | core/locale.lua | 4 |
1 files changed, 3 insertions, 1 deletions
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 |