aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/locale.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2013-06-12 11:48:51 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2013-06-12 11:48:51 -0400
commit753232b2eba4d3d1cbfddaec7b35623c89acccb6 (patch)
tree78d3446acd66999f5e15defab963b721b0e03568 /core/locale.lua
parent723ad530fa92f155a2c95af7d3ca104f8f25071d (diff)
Removed `_L._EXISTS()`; core/locale.lua
Diffstat (limited to 'core/locale.lua')
-rw-r--r--core/locale.lua15
1 files changed, 3 insertions, 12 deletions
diff --git a/core/locale.lua b/core/locale.lua
index a42b15f7..f77ecf05 100644
--- a/core/locale.lua
+++ b/core/locale.lua
@@ -6,19 +6,9 @@ local M = {}
---
-- Map of all messages used by Textadept to their localized form.
-- If the table does not contain the localized version of a given message, it
--- returns a string indicating so via a metamethod.
+-- returns a string that starts with "No Localization:" via a metamethod.
module('_L')]]
-local none = 'No Localization: '
-
----
--- Returns whether or not *message* is localized.
--- This function is necessary since `_L[message]` never returns `nil`.
--- @param message The message to localize.
--- @return `true` if a localization exists, `false` otherwise.
--- @name _EXISTS
-function M._EXISTS(message) return M[message] ~= none..message end
-
local f = io.open(_USERHOME..'/locale.conf', 'rb')
if not f then
local lang = (os.getenv('LANG') or ''):match('^[^_.@]+')
@@ -34,4 +24,5 @@ for line in f:lines() do
end
f:close()
-return setmetatable(M, {__index = function(t, k) return none..k end})
+return setmetatable(M,
+ {__index = function(t, k) return 'No Localization:'..k end})