aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/._M.luadoc7
-rw-r--r--core/init.lua6
-rw-r--r--core/locale.lua21
3 files changed, 25 insertions, 9 deletions
diff --git a/core/._M.luadoc b/core/._M.luadoc
index 0cfd032a..04d2e938 100644
--- a/core/._M.luadoc
+++ b/core/._M.luadoc
@@ -2,9 +2,10 @@
-- This is a DUMMY FILE used for making LuaDoc for built-in functions in the
-- global _M table.
+--[[ This comment is for LuaDoc.
---
-- A table of loaded modules.
-module('_M')
+module('_M')]]
-- Markdown:
-- ## Overview
@@ -93,4 +94,6 @@ module('_M')
---
-- This module contains no functions.
-function no_functions() end no_functions = nil
+-- @class function
+-- @name no_functions
+local no_functions
diff --git a/core/init.lua b/core/init.lua
index b2ec28ea..71440ca8 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -82,12 +82,6 @@ local _BUFFERS
-- @usage _VIEWS[view] returns the index of the current view in _VIEWS.
local _VIEWS
----
--- Contains all messages used by Textadept for localization.
--- @class table
--- @name _L
-local _L
-
-- The functions below are Lua C functions.
---
diff --git a/core/locale.lua b/core/locale.lua
index ec7263c8..b59141f5 100644
--- a/core/locale.lua
+++ b/core/locale.lua
@@ -2,6 +2,19 @@
local M = {}
+--[[ This comment is for LuaDoc.
+---
+-- Table of all messages used by Textadept for localization.
+module('_L')]]
+
+-- Markdown:
+-- # Settings
+--
+-- * `_NIL` [string]: String returned when no localization for a given message
+-- exists.
+
+M._NIL = 'No Localization'
+
local f = io.open(_USERHOME..'/locale.conf', 'rb')
if not f then f = io.open(_HOME..'/core/locale.conf', 'rb') end
if not f then error('"core/locale.conf" not found.') end
@@ -13,4 +26,10 @@ for line in f:lines() do
end
f:close()
-return setmetatable(M, { __index = function() return 'No Localization' end })
+---
+-- This table contains no functions.
+-- @class function
+-- @name no_functions
+local no_functions
+
+return setmetatable(M, { __index = function() return M._NIL end })