diff options
author | 2010-10-15 16:52:12 -0400 | |
---|---|---|
committer | 2010-10-15 16:52:12 -0400 | |
commit | 6d11c044ec0059405c9e2813e39e9b618e7068c8 (patch) | |
tree | bd2d28c04d63d633817cc1f29c74608e36c7c3cb /core/gui.lua | |
parent | 32602279973cef2783399c08709b3567f8369371 (diff) | |
download | textadept-6d11c044ec0059405c9e2813e39e9b618e7068c8.tar.gz textadept-6d11c044ec0059405c9e2813e39e9b618e7068c8.zip |
Changed locale implementation.
Diffstat (limited to 'core/gui.lua')
-rw-r--r-- | core/gui.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/gui.lua b/core/gui.lua index b18b7afd..ef9892cc 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -1,13 +1,14 @@ -- Copyright 2007-2010 Mitchell mitchell<att>caladbolg.net. See LICENSE. +local L = _G.locale.localize local gui = _G.gui -- LuaDoc is in core/.gui.lua. function gui.check_focused_buffer(buffer) if type(buffer) ~= 'table' or not buffer.doc_pointer then - error(locale.ERR_BUFFER_EXPECTED, 2) + error(L('Buffer argument expected.'), 2) elseif gui.focused_doc_pointer ~= buffer.doc_pointer then - error(locale.ERR_BUFFER_NOT_FOCUSED, 2) + error(L('The indexed buffer is not the focused one.'), 2) end end @@ -48,19 +49,19 @@ function gui._print(buffer_type, ...) end -- LuaDoc is in core/.gui.lua. -function gui.print(...) gui._print(locale.MESSAGE_BUFFER, ...) end +function gui.print(...) gui._print(L('[Message Buffer]'), ...) end -- LuaDoc is in core/.gui.lua. function gui.switch_buffer() local items = {} for _, buffer in ipairs(_BUFFERS) do - local filename = buffer.filename or buffer._type or locale.UNTITLED + local filename = buffer.filename or buffer._type or L('Untitled') local dirty = buffer.dirty and '*' or '' items[#items + 1] = dirty..filename:match('[^/\\]+$') items[#items + 1] = filename end local response = gui.dialog('filteredlist', - '--title', locale.SWITCH_BUFFERS, + '--title', L('Switch Buffers'), '--button1', 'gtk-ok', '--button2', 'gtk-cancel', '--no-newline', |