From 753232b2eba4d3d1cbfddaec7b35623c89acccb6 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 12 Jun 2013 11:48:51 -0400 Subject: Removed `_L._EXISTS()`; core/locale.lua --- core/locale.lua | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'core') 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}) -- cgit v1.2.3