aboutsummaryrefslogtreecommitdiff
path: root/core/locale.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/locale.lua')
-rw-r--r--core/locale.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/locale.lua b/core/locale.lua
index 449f4dee..68a8266c 100644
--- a/core/locale.lua
+++ b/core/locale.lua
@@ -5,12 +5,15 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Table of all messages used by Textadept for localization.
+-- If the table does not contain the localized version of a given message, it
+-- returns a string indicating so via a metamethod.
module('_L')]]
local none = 'No Localization: '
---
-- Returns whether or not a localized message exists for the given message.
+-- This function is necessary since `_L[message]` never returns `nil`.
-- @param message The message to localize.
-- @return `true` if a localization exists, `false` otherwise.
function M._EXISTS(message) return M[message] ~= none..message end