aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/.textadept.lua9
-rw-r--r--core/events.lua41
-rw-r--r--core/ext/find.lua15
-rw-r--r--core/ext/keys.lua7
-rw-r--r--core/ext/menu.lua711
-rw-r--r--core/ext/pm.lua5
-rw-r--r--core/ext/pm/buffer_browser.lua26
-rw-r--r--core/ext/pm/ctags_browser.lua12
-rw-r--r--core/ext/pm/file_browser.lua33
-rw-r--r--core/ext/pm/find_browser.lua2
-rw-r--r--core/ext/pm/macro_browser.lua9
-rw-r--r--core/ext/pm/modules_browser.lua49
-rw-r--r--core/ext/pm/project_browser.lua115
-rw-r--r--core/file_io.lua14
-rw-r--r--core/init.lua6
-rw-r--r--core/locale.lua591
16 files changed, 1256 insertions, 389 deletions
diff --git a/core/.textadept.lua b/core/.textadept.lua
index 41846c7a..2a73c374 100644
--- a/core/.textadept.lua
+++ b/core/.textadept.lua
@@ -59,13 +59,14 @@ function get_split_table() end
---
-- Creates a GTK menu, returning the userdata.
--- @param menu_table A table defining the menu. It is an ordered list of strings
--- that are handled as follows:
+-- @param menu_table A table defining the menu. It is an ordered list of tables
+-- with a string menu item and integer menu ID.
+-- The string menu item is handled as follows:
-- 'gtk-*' - a stock menu item is created based on the GTK stock-id.
-- 'separator' - a menu separator item is created.
-- Otherwise a regular menu item with a mnemonic is created.
--- An additional 'title' key can be used to define the menu's title text (if it
--- is a submenu).
+-- Submenus are just nested menu-structure tables. Their title text is defined
+-- with a 'title' key.
-- @see popupmenu
function gtkmenu(menu_table) end
diff --git a/core/events.lua b/core/events.lua
index 8a7ac0f8..f8c94cc4 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -63,8 +63,9 @@ module('textadept.events', package.seeall)
-- shift: flag indicating whether or not shift is pressed.
-- control: flag indicating whether or not control is pressed.
-- alt: flag indicating whether or not alt is pressed.
--- menu_clicked(menu_item)
+-- menu_clicked(menu_item, menu_id)
-- menu_item: text of the menu item clicked.
+-- menu_id: the numeric ID of the menu item.
local events = textadept.events
@@ -136,7 +137,8 @@ function keypress(code, shift, control, alt)
return handle('keypress', code, shift, control, alt)
end
function menu_clicked(menu_item)
- return handle('menu_clicked', menu_item)
+ local text, menu_id = menu_item:match('^(.+)|(%d+)$')
+ return handle( 'menu_clicked', text, tonumber(menu_id) )
end
-- Scintilla notifications.
@@ -366,8 +368,8 @@ add_handler('char_added',
-- filename.
-- @param buffer The currently focused buffer.
local function set_title(buffer)
- local buffer = buffer
- local filename = buffer.filename or 'Untitled'
+ local buffer, textadept = buffer, textadept
+ local filename = buffer.filename or textadept.locale.UNTITLED
local d = buffer.dirty and ' * ' or ' - '
textadept.title = filename:match('[^/\\]+$')..d..'Textadept ('..filename..')'
end
@@ -467,20 +469,24 @@ add_handler('update_ui',
if not match_brace(buffer.current_pos) then buffer:brace_bad_light(-1) end
end)
-local docstatusbar_text =
- "Line: %d/%d Col: %d Lexer: %s %s %s %s"
+local EOLs = {
+ textadept.locale.STATUS_CRLF,
+ textadept.locale.STATUS_CR,
+ textadept.locale.STATUS_LF
+}
add_handler('update_ui',
function() -- sets docstatusbar text
- local buffer = buffer
+ local buffer, locale = buffer, textadept.locale
local pos = buffer.current_pos
local line, max = buffer:line_from_position(pos) + 1, buffer.line_count
local col = buffer.column[pos] + 1
local lexer = buffer:get_lexer_language()
- local mode = buffer.overtype and 'OVR' or 'INS'
- local eol = ( { 'CRLF', 'CR', 'LF' } )[buffer.eol_mode + 1]
- local tabs = (buffer.use_tabs and 'Tabs:' or 'Spaces:')..buffer.indent
+ local mode = buffer.overtype and locale.STATUS_OVR or locale.STATUS_INS
+ local eol = EOLs[buffer.eol_mode + 1]
+ local tabs = (buffer.use_tabs and locale.STATUS_TABS or
+ locale.STATUS_SPACES)..buffer.indent
textadept.docstatusbar_text =
- docstatusbar_text:format(line, max, col, lexer, mode, eol, tabs)
+ locale.DOCSTATUSBAR_TEXT:format(line, max, col, lexer, mode, eol, tabs)
end)
add_handler('margin_click',
@@ -514,20 +520,21 @@ add_handler('view_switch',
add_handler('quit',
function() -- prompts for confirmation if any buffers are dirty; saves session
+ local locale = textadept.locale
local any = false
- local list = { 'The following buffers are unsaved:\n' }
+ local list = {}
for _, buffer in ipairs(textadept.buffers) do
if buffer.dirty then
- list[#list + 1] = buffer.filename or 'Untitled'
+ list[#list + 1] = buffer.filename or locale.UNTITLED
any = true
end
end
if any then
- list[#list + 1] = '\nYou will have to save changes manually.\n'
if cocoa_dialog( 'yesno-msgbox', {
- title = 'Save?',
- text = 'Save changes before quitting?',
- ['informative-text'] = table.concat(list, '\n'),
+ title = locale.EVENTS_QUIT_TITLE,
+ text = locale.EVENTS_QUIT_TEXT,
+ ['informative-text'] =
+ string.format( locale.EVENTS_QUIT_MSG, table.concat(list, '\n') ),
['no-newline'] = true
} ) ~= '2' then return false end
end
diff --git a/core/ext/find.lua b/core/ext/find.lua
index ca3c28f0..94371689 100644
--- a/core/ext/find.lua
+++ b/core/ext/find.lua
@@ -25,7 +25,7 @@ local escapes = {
-- for displaying useful statusbar information. This flag is used and set
-- internally, and should not be set otherwise.
function find.find(text, next, flags, nowrap, wrapped)
- local buffer = buffer
+ local buffer, textadept = buffer, textadept
local increment, result
text = text:gsub('\\[abfnrtv\\]', escapes)
find.captures = nil
@@ -68,10 +68,10 @@ function find.find(text, next, flags, nowrap, wrapped)
else
buffer:goto_pos(buffer.length)
end
- textadept.statusbar_text = 'Search wrapped'
+ textadept.statusbar_text = textadept.locale.FIND_SEARCH_WRAPPED
result = find.find(text, next, flags, true, true)
if not result then
- textadept.statusbar_text = 'No results found'
+ textadept.statusbar_text = textadept.locale.FIND_NO_RESULTS
buffer:goto_pos(anchor)
end
return result
@@ -103,11 +103,12 @@ function find.replace(rtext)
end
local ret, rtext = pcall( rtext.gsub, rtext, '%%(%b())',
function(code)
+ local locale = textadept.locale
local ret, val = pcall( loadstring('return '..code) )
if not ret then
cocoa_dialog( 'msgbox', {
- title = 'Error',
- text = 'An error occured:',
+ title = locale.FIND_ERROR_DIALOG_TITLE,
+ text = locale.FIND_ERROR_DIALOG_TEXT,
['informative-text'] = val:gsub('"', '\\"')
} )
error()
@@ -134,11 +135,13 @@ end
-- @param flags The number mask identical to the one in 'find'.
-- @see find.find
function find.replace_all(ftext, rtext, flags)
+ local textadept = textadept
buffer:goto_pos(0)
local count = 0
while( find.find(ftext, true, flags, true) ) do
find.replace(rtext)
count = count + 1
end
- textadept.statusbar_text = tostring(count)..' replacement(s) made'
+ textadept.statusbar_text = tostring(count)..' '..
+ textadept.locale.FIND_REPLACEMENTS_MADE
end
diff --git a/core/ext/keys.lua b/core/ext/keys.lua
index fd460233..b9c17ab3 100644
--- a/core/ext/keys.lua
+++ b/core/ext/keys.lua
@@ -183,7 +183,7 @@ local function keypress(code, shift, control, alt)
local size = #keychain - 1
clear_key_sequence()
if size > 0 then -- previously in a chain
- textadept.statusbar_text = 'Invalid Sequence'
+ textadept.statusbar_text = textadept.locale.KEYS_INVALID
return true
end
else return true end
@@ -217,9 +217,10 @@ end
-- of -1. This way, pcall will return false and -1, where the -1 can easily and
-- efficiently be checked rather than using a string error message.
try_get_cmd = function(active_table)
+ local locale = textadept.locale
for _, key_seq in ipairs(keychain) do active_table = active_table[key_seq] end
if #active_table == 0 and next(active_table) then
- textadept.statusbar_text = 'Keychain: '..table.concat(keychain, ' ')
+ textadept.statusbar_text = locale.KEYCHAIN..table.concat(keychain, ' ')
error(-1, 0)
else
local func = active_table[1]
@@ -233,7 +234,7 @@ try_get_cmd = function(active_table)
return view[func], { view, unpack(active_table, 3) }
end
else
- error( 'Unknown command: '..tostring(func) )
+ error( locale.KEYS_UNKNOWN_COMMAND..tostring(func) )
end
end
end
diff --git a/core/ext/menu.lua b/core/ext/menu.lua
index 2fecc91e..db089ed0 100644
--- a/core/ext/menu.lua
+++ b/core/ext/menu.lua
@@ -5,165 +5,396 @@
-- This module, like ext/key_commands, should be 'require'ed last.
module('textadept.menu', package.seeall)
-local t, gtkmenu = textadept, textadept.gtkmenu
+local t, gtkmenu, l = textadept, textadept.gtkmenu, textadept.locale
+
+local SEPARATOR = 'separator'
+local ID = {
+ SEPARATOR = 0,
+ -- File
+ NEW = 101,
+ OPEN = 102,
+ RELOAD = 103,
+ SAVE = 104,
+ SAVEAS = 105,
+ CLOSE = 106,
+ CLOSE_ALL = 107,
+ LOAD_SESSION = 108,
+ SAVE_SESSION = 109,
+ QUIT = 110,
+ -- Edit
+ UNDO = 201,
+ REDO = 202,
+ CUT = 203,
+ COPY = 204,
+ PASTE = 205,
+ DELETE = 206,
+ SELECT_ALL = 207,
+ MATCH_BRACE = 208,
+ SELECT_TO_BRACE = 209,
+ COMPLETE_WORD = 210,
+ DELETE_WORD = 211,
+ TRANSPOSE_CHARACTERS = 212,
+ SQUEEZE = 213,
+ JOIN_LINES = 245,
+ MOVE_LINE_UP = 214,
+ MOVE_LINE_DOWN = 215,
+ CONVERT_INDENTATION = 216,
+ CUT_TO_LINE_END = 217,
+ COPY_TO_LINE_END = 218,
+ PASTE_FROM_RING = 219,
+ PASTE_NEXT_FROM_RING = 220,
+ PASTE_PREV_FROM_RING = 221,
+ EXECUTE_AS_RUBY = 222,
+ EXECUTE_AS_LUA = 223,
+ ENCLOSE_IN_HTML_TAGS = 224,
+ ENCLOSE_IN_HTML_SINGLE_TAG = 225,
+ ENCLOSE_IN_DOUBLE_QUOTES = 226,
+ ENCLOSE_IN_SINGLE_QUOTES = 227,
+ ENCLOSE_IN_PARENTHESES = 228,
+ ENCLOSE_IN_BRACKETS = 229,
+ ENCLOSE_IN_BRACES = 230,
+ ENCLOSE_IN_CHARACTER_SEQUENCE = 231,
+ GROW_SELECTION = 232,
+ SELECT_IN_STRUCTURE = 233,
+ SELECT_IN_HTML_TAG = 234,
+ SELECT_IN_DOUBLE_QUOTE = 235,
+ SELECT_IN_SINGLE_QUOTE = 236,
+ SELECT_IN_PARENTHESIS = 237,
+ SELECT_IN_BRACKET = 238,
+ SELECT_IN_BRACE = 239,
+ SELECT_IN_WORD = 240,
+ SELECT_IN_LINE = 241,
+ SELECT_IN_PARAGRAPH = 242,
+ SELECT_IN_INDENTED_BLOCK = 243,
+ SELECT_IN_SCOPE = 244,
+ -- Search
+ FIND = 301,
+ FIND_NEXT = 302,
+ FIND_PREV = 303,
+ FIND_AND_REPLACE = 304,
+ REPLACE = 305,
+ REPLACE_ALL = 306,
+ GOTO_LINE = 307,
+ -- Tools
+ FOCUS_COMMAND_ENTRY = 401,
+ INSERT_SNIPPET = 402,
+ PREVIOUS_SNIPPET_PLACEHOLDER = 403,
+ CANCEL_SNIPPET = 404,
+ LIST_SNIPPETS = 405,
+ SHOW_SCOPE = 406,
+ ADD_MULTIPLE_LINE = 407,
+ ADD_MULTIPLE_LINES = 408,
+ REMOVE_MULTIPLE_LINE = 409,
+ REMOVE_MULTIPLE_LINES = 410,
+ UPDATE_MULTIPLE_LINES = 411,
+ FINISH_MULTIPLE_LINES = 412,
+ START_RECORDING_MACRO = 413,
+ STOP_RECORDING_MACRO = 414,
+ PLAY_MACRO = 415,
+ -- Buffers
+ NEXT_BUFFER = 501,
+ PREV_BUFFER = 502,
+ TOGGLE_VIEW_EOL = 503,
+ TOGGLE_WRAP_MODE = 504,
+ TOGGLE_SHOW_INDENT_GUIDES = 505,
+ TOGGLE_USE_TABS = 506,
+ TOGGLE_VIEW_WHITESPACE = 507,
+ REFRESH_SYNTAX_HIGHLIGHTING = 508,
+ -- Views
+ NEXT_VIEW = 601,
+ PREV_VIEW = 602,
+ SPLIT_VIEW_VERTICAL = 603,
+ SPLIT_VIEW_HORIZONTAL = 604,
+ UNSPLIT_VIEW = 605,
+ UNSPLIT_ALL_VIEWS = 606,
+ GROW_VIEW = 607,
+ SHRINK_VIEW = 608,
+ -- Project Manager
+ TOGGLE_PM_VISIBLE = 701,
+ FOCUS_PM = 702,
+ SHOW_PM_PROJECT = 703,
+ SHOW_PM_CTAGS = 704,
+ SHOW_PM_BUFFERS = 705,
+ SHOW_PM_FILES = 706,
+ SHOW_PM_MACROS = 707,
+ SHOW_PM_MODULES = 708,
+ -- Lexers
+ LEXER_ACTIONSCRIPT = 801,
+ LEXER_ADA = 802,
+ LEXER_ANTLR = 803,
+ LEXER_APDL = 804,
+ LEXER_APPLESCRIPT = 805,
+ LEXER_ASP = 806,
+ LEXER_AWK = 807,
+ LEXER_BATCH = 808,
+ LEXER_BOO = 809,
+ LEXER_CONTAINER = 810,
+ LEXER_CPP = 811,
+ LEXER_CSHARP = 812,
+ LEXER_CSS = 813,
+ LEXER_D = 814,
+ LEXER_DIFF = 815,
+ LEXER_DJANGO = 816,
+ LEXER_EIFFEL = 817,
+ LEXER_ERLANG = 818,
+ LEXER_ERRORLIST = 819,
+ LEXER_FORTH = 820,
+ LEXER_FORTRAN = 821,
+ LEXER_GAP = 822,
+ LEXER_GETTEXT = 823,
+ LEXER_GNUPLOT = 824,
+ LEXER_GROOVY = 825,
+ LEXER_HASKELL = 826,
+ LEXER_HTML = 827,
+ LEXER_IDL = 828,
+ LEXER_INI = 829,
+ LEXER_IO = 830,
+ LEXER_JAVA = 831,
+ LEXER_JAVASCRIPT = 832,
+ LEXER_LATEX = 833,
+ LEXER_LISP = 834,
+ LEXER_LUA = 835,
+ LEXER_MAKEFILE = 836,
+ LEXER_MYSQL = 837,
+ LEXER_OBJECTIVEC = 838,
+ LEXER_OCAML = 839,
+ LEXER_PASCAL = 840,
+ LEXER_PERL = 841,
+ LEXER_PHP = 842,
+ LEXER_PIKE = 843,
+ LEXER_POSTSCRIPT = 844,
+ LEXER_PROPS = 845,
+ LEXER_PYTHON = 846,
+ LEXER_R = 847,
+ LEXER_RAGEL = 848,
+ LEXER_REBOL = 849,
+ LEXER_REXX = 850,
+ LEXER_RHTML = 851,
+ LEXER_RUBY = 852,
+ LEXER_SCHEME = 853,
+ LEXER_SHELLSCRIPT = 854,
+ LEXER_SMALLTALK = 855,
+ LEXER_TCL = 856,
+ LEXER_VALA = 857,
+ LEXER_VERILOG = 858,
+ LEXER_VHDL = 859,
+ LEXER_VISUALBASIC = 860,
+ LEXER_XML = 861
+}
+
t.menubar = {
gtkmenu {
- title = '_File',
- 'gtk-new',
- 'gtk-open',
- '_Reload',
- 'gtk-save',
- 'gtk-save-as',
- 'gtk-close',
- 'Close A_ll',
- 'separator',
- '_Load Session...',
- 'Sa_ve Session...',
- 'separator',
- 'gtk-quit',
+ title = l.MENU_FILE_TITLE,
+ { l.MENU_FILE_NEW, ID.NEW },
+ { l.MENU_FILE_OPEN, ID.OPEN },
+ { l.MENU_FILE_RELOAD, ID.RELOAD },
+ { l.MENU_FILE_SAVE, ID.SAVE },
+ { l.MENU_FILE_SAVEAS, ID.SAVEAS },
+ { SEPARATOR, ID.SEPARATOR },
+ { l.MENU_FILE_CLOSE, ID.CLOSE },
+ { l.MENU_FILE_CLOSE_ALL, ID.CLOSE_ALL },
+ { SEPARATOR, ID.SEPARATOR },
+ { l.MENU_FILE_LOAD_SESSION, ID.LOAD_SESSION },
+ { l.MENU_FILE_SAVE_SESSION, ID.SAVE_SESSION },
+ { SEPARATOR, ID.SEPARATOR },
+ { l.MENU_FILE_QUIT, ID.QUIT },
},
gtkmenu {
- title = '_Edit',
- 'gtk-undo',
- 'gtk-redo',
- 'separator',
- 'gtk-cut',
- 'gtk-copy',
- 'gtk-paste',
- 'gtk-delete',
- 'gtk-select-all',
- 'separator',
- 'Match _Brace',
- 'Select t_o Brace',
- 'Complete _Word',
- 'De_lete Word',
- 'Tran_spose Characters',
- 'S_queeze',
- '_Move line up',
- 'Mo_ve line down',
- 'Convert _Indentation',
- { title = '_Kill Ring',
- '_Cut to line end',
- 'C_opy to line end',
- '_Paste from ring',
- 'Paste _next from ring',
- 'Paste pre_v from ring',
+ title = l.MENU_EDIT_TITLE,
+ { l.MENU_EDIT_UNDO, ID.UNDO },
+ { l.MENU_EDIT_REDO, ID.REDO },
+ { SEPARATOR, ID.SEPARATOR },
+ { l.MENU_EDIT_CUT, ID.CUT },
+ { l.MENU_EDIT_COPY, ID.COPY },
+ { l.MENU_EDIT_PASTE, ID.PASTE },
+ { l.MENU_EDIT_DELETE, ID.DELETE },
+ { l.MENU_EDIT_SELECT_ALL, ID.SELECT_ALL },
+ { SEPARATOR, ID.SEPARATOR },
+ { l.MENU_EDIT_MATCH_BRACE, ID.MATCH_BRACE },
+ { l.MENU_EDIT_SELECT_TO_BRACE, ID.SELECT_TO_BRACE },
+ { l.MENU_EDIT_COMPLETE_WORD, ID.COMPLETE_WORD },
+ { l.MENU_EDIT_DELETE_WORD, ID.DELETE_WORD },
+ { l.MENU_EDIT_TRANSPOSE_CHARACTERS, ID.TRANSPOSE_CHARACTERS },
+ { l.MENU_EDIT_SQUEEZE, ID.SQUEEZE },
+ { l.MENU_EDIT_JOIN_LINES, ID.JOIN_LINES },
+ { l.MENU_EDIT_MOVE_LINE_UP, ID.MOVE_LINE_UP },
+ { l.MENU_EDIT_MOVE_LINE_DOWN, ID.MOVE_LINE_DOWN },
+ { l.MENU_EDIT_CONVERT_INDENTATION, ID.CONVERT_INDENTATION },
+ { title = l.MENU_EDIT_KR_TITLE,
+ { l.MENU_EDIT_KR_CUT_TO_LINE_END, ID.CUT_TO_LINE_END },
+ { l.MENU_EDIT_KR_COPY_TO_LINE_END, ID.COPY_TO_LINE_END },
+ { l.MENU_EDIT_KR_PASTE_FROM, ID.PASTE_FROM_RING },
+ { l.MENU_EDIT_KR_PASTE_NEXT_FROM, ID.PASTE_NEXT_FROM_RING },
+ { l.MENU_EDIT_KR_PASTE_PREV_FROM, ID.PASTE_PREV_FROM_RING },
},
- { title = 'S_election',
- { title = 'E_xecute as...',
- '_Ruby',
- '_Lua',
+ { title = l.MENU_EDIT_SEL_TITLE,
+ { title = l.MENU_EDIT_SEL_EXEC_TITLE,
+ { l.MENU_EDIT_SEL_EXEC_AS_RUBY, ID.EXECUTE_AS_RUBY },
+ { l.MENU_EDIT_SEL_EXEC_AS_LUA, ID.EXECUTE_AS_LUA },
},
- { title = '_Enclose in...',
- '_HTML Tags',
- 'HTML Single _Tag',
- '_Double Quotes',
- '_Single Quotes',
- '_Parentheses',
- '_Brackets',
- 'B_races',
- '_Character Sequence',
+ { title = l.MENU_EDIT_SEL_ENC_TITLE,
+ { l.MENU_EDIT_SEL_ENC_HTML_TAGS, ID.ENCLOSE_IN_HTML_TAGS },
+ { l.MENU_EDIT_SEL_ENC_HTML_SINGLE_TAG, ID.ENCLOSE_IN_HTML_SINGLE_TAG },
+ { l.MENU_EDIT_SEL_ENC_DOUBLE_QUOTES, ID.ENCLOSE_IN_DOUBLE_QUOTES },
+ { l.MENU_EDIT_SEL_ENC_SINGLE_QUOTES, ID.ENCLOSE_IN_SINGLE_QUOTES },
+ { l.MENU_EDIT_SEL_ENC_PARENTHESES, ID.ENCLOSE_IN_PARENTHESES },
+ { l.MENU_EDIT_SEL_ENC_BRACKETS, ID.ENCLOSE_IN_BRACKETS },
+ { l.MENU_EDIT_SEL_ENC_BRACES, ID.ENCLOSE_IN_BRACES },
+ { l.MENU_EDIT_SEL_ENC_CHAR_SEQ, ID.ENCLOSE_IN_CHARACTER_SEQUENCE },
},
- '_Grow',
+ { l.MENU_EDIT_SEL_GROW, ID.GROW_SELECTION },
},
- { title = 'Select i_n...',
- 'S_tructure',
- '_HTML Tag',
- '_Double Quote',
- '_Single Quote',
- '_Parenthesis',
- '_Bracket',
- 'B_race',
- '_Word',
- '_Line',
- 'Para_graph',
- '_Indented Block',
- 'S_cope',
+ { title = l.MENU_EDIT_SEL_IN_TITLE,
+ { l.MENU_EDIT_SEL_IN_STRUCTURE, ID.SELECT_IN_STRUCTURE },
+ { l.MENU_EDIT_SEL_IN_HTML_TAG, ID.SELECT_IN_HTML_TAG },
+ { l.MENU_EDIT_SEL_IN_DOUBLE_QUOTE, ID.SELECT_IN_DOUBLE_QUOTE },
+ { l.MENU_EDIT_SEL_IN_SINGLE_QUOTE, ID.SELECT_IN_SINGLE_QUOTE },
+ { l.MENU_EDIT_SEL_IN_PARENTHESIS, ID.SELECT_IN_PARENTHESIS },
+ { l.MENU_EDIT_SEL_IN_BRACKET, ID.SELECT_IN_BRACKET },
+ { l.MENU_EDIT_SEL_IN_BRACE, ID.SELECT_IN_BRACE },
+ { l.MENU_EDIT_SEL_IN_WORD, ID.SELECT_IN_WORD },
+ { l.MENU_EDIT_SEL_IN_LINE, ID.SELECT_IN_LINE },
+ { l.MENU_EDIT_SEL_IN_PARAGRAPH, ID.SELECT_IN_PARAGRAPH },
+ { l.MENU_EDIT_SEL_IN_INDENTED_BLOCK, ID.SELECT_IN_INDENTED_BLOCK },
+ { l.MENU_EDIT_SEL_IN_SCOPE, ID.SELECT_IN_SCOPE },
},
},
gtkmenu {
- title = '_Search',
- 'gtk-find',
- 'Find _Next',
- 'Find _Prev',
- 'gtk-find-and-replace',
- 'Replace',
- 'Replace _All',
- 'separator',
- 'gtk-jump-to',
+ title = l.MENU_SEARCH_TITLE,
+ { l.MENU_SEARCH_FIND, ID.FIND },
+ { l.MENU_SEARCH_FIND_NEXT, ID.FIND_NEXT },
+ { l.MENU_SEARCH_FIND_PREV, ID.FIND_PREV },
+ { l.MENU_SEARCH_FIND_AND_REPLACE, ID.FIND_AND_REPLACE },
+ { l.MENU_SEARCH_REPLACE, ID.REPLACE },
+ { l.MENU_SEARCH_REPLACE_ALL, ID.REPLACE_ALL },
+ { SEPARATOR, ID.SEPARATOR },
+ { l.MENU_SEARCH_GOTO_LINE, ID.GOTO_LINE },
},
gtkmenu {
- title = '_Tools',
- 'Focus _Command Entry',
- { title = '_Snippets',
- '_Insert Snippet',
- '_Previous Placeholder',
- '_Cancel Snippet',
- '_List Snippets',
- '_Show Scope',
+ title = l.MENU_TOOLS_TITLE,
+ { l.MENU_TOOLS_FOCUS_COMMAND_ENTRY, ID.FOCUS_COMMAND_ENTRY },
+ { title = l.MENU_TOOLS_SNIPPETS_TITLE,
+ { l.MENU_TOOLS_SNIPPETS_INSERT, ID.INSERT_SNIPPET },
+ { l.MENU_TOOLS_SNIPPETS_PREV_PLACE, ID.PREVIOUS_SNIPPET_PLACEHOLDER },
+ { l.MENU_TOOLS_SNIPPETS_CANCEL, ID.CANCEL_SNIPPET },
+ { l.MENU_TOOLS_SNIPPETS_LIST, ID.LIST_SNIPPETS },
+ { l.MENU_TOOLS_SNIPPETS_SHOW_SCOPE, ID.SHOW_SCOPE },
},
- { title = '_Multiple Line Editing',
- '_Add Line',
- 'Add _Multiple Lines',
- '_Remove Line',
- 'R_emove Multiple Lines',
- '_Update Multiple Lines',
- '_Finished Editing',
+ { title = l.MENU_TOOLS_ML_TITLE,
+ { l.MENU_TOOLS_ML_ADD, ID.ADD_MULTIPLE_LINE },
+ { l.MENU_TOOLS_ML_ADD_MULTIPLE, ID.ADD_MULTIPLE_LINES },
+ { l.MENU_TOOLS_ML_REMOVE, ID.REMOVE_MULTIPLE_LINE },
+ { l.MENU_TOOLS_ML_REMOVE_MULTIPLE, ID.REMOVE_MULTIPLE_LINES },
+ { l.MENU_TOOLS_ML_UPDATE, ID.UPDATE_MULTIPLE_LINES },
+ { l.MENU_TOOLS_ML_FINISH, ID.FINISH_MULTIPLE_LINES },
},
- { title = 'M_acros',
- '_Start Recording',
- 'S_top Recording',
- '_Play Macro'
+ { title = l.MENU_TOOLS_MACROS_TITLE,
+ { l.MENU_TOOLS_MACROS_START, ID.START_RECORDING_MACRO },
+ { l.MENU_TOOLS_MACROS_STOP, ID.STOP_RECORDING_MACRO },
+ { l.MENU_TOOLS_MACROS_PLAY, ID.PLAY_MACRO },
},
},
gtkmenu {
- title = '_Buffers',
- '_Next Buffer',
- '_Prev Buffer',
- 'separator',
- 'Toggle View _EOL',
- 'Toggle _Wrap Mode',
- 'Toggle Show _Indentation Guides',
- 'Toggle Use _Tabs',
- 'Toggle View White_space',
- 'separator',
- '_Refresh Syntax Highlighting',
+ title = l.MENU_BUF_TITLE,
+ { l.MENU_BUF_NEXT, ID.NEXT_BUFFER },
+ { l.MENU_BUF_PREV, ID.PREV_BUFFER },
+ { SEPARATOR, ID.SEPARATOR },
+ { l.MENU_BUF_TOGGLE_VIEW_EOL, ID.TOGGLE_VIEW_EOL },
+ { l.MENU_BUF_TOGGLE_WRAP, ID.TOGGLE_WRAP_MODE },
+ { l.MENU_BUF_TOGGLE_INDENT_GUIDES, ID.TOGGLE_SHOW_INDENT_GUIDES },
+ { l.MENU_BUF_TOGGLE_TABS, ID.TOGGLE_USE_TABS },
+ { l.MENU_BUF_TOGGLE_VIEW_WHITESPACE, ID.TOGGLE_VIEW_WHITESPACE },
+ { SEPARATOR, ID.SEPARATOR },
+ { l.MENU_BUF_REFRESH, ID.REFRESH_SYNTAX_HIGHLIGHTING },
},
gtkmenu {
- title = '_Views',
- '_Next View',
- '_Prev View',
- 'separator',
- 'Split _Vertical',
- 'Split _Horizontal',
- '_Unsplit',
- 'Unsplit _All',
- 'separator',
- '_Grow View',
- '_Shrink View',
+ title = l.MENU_VIEW_TITLE,
+ { l.MENU_VIEW_NEXT, ID.NEXT_VIEW },
+ { l.MENU_VIEW_PREV, ID.PREV_VIEW },
+ { SEPARATOR, ID.SEPARATOR },
+ { l.MENU_VIEW_SPLIT_VERTICAL, ID.SPLIT_VIEW_VERTICAL },
+ { l.MENU_VIEW_SPLIT_HORIZONTAL, ID.SPLIT_VIEW_HORIZONTAL },
+ { l.MENU_VIEW_UNSPLIT, ID.UNSPLIT_VIEW },
+ { l.MENU_VIEW_UNSPLIT_ALL, ID.UNSPLIT_ALL_VIEWS },
+ { SEPARATOR, ID.SEPARATOR },
+ { l.MENU_VIEW_GROW, ID.GROW_VIEW },
+ { l.MENU_VIEW_SHRINK, ID.SHRINK_VIEW },
},
gtkmenu {
- title = '_Project Manager',
- '_Toggle PM Visible',
- '_Focus PM',
- 'Show PM _Project',
- 'Show PM _Ctags',
- 'Show PM _Buffers',
- 'Show PM _Files',
- 'Show PM _Macros',
- 'Show PM Mo_dules',
+ title = l.MENU_PM_TITLE,
+ { l.MENU_PM_TOGGLE_VISIBLE, ID.TOGGLE_PM_VISIBLE },
+ { l.MENU_PM_FOCUS, ID.FOCUS_PM },
+ { l.MENU_PM_BUFFERS, ID.SHOW_PM_BUFFERS },
+ { l.MENU_PM_PROJECT, ID.SHOW_PM_PROJECT },
+ { l.MENU_PM_FILES, ID.SHOW_PM_FILES },
+ { l.MENU_PM_CTAGS, ID.SHOW_PM_CTAGS },
+ { l.MENU_PM_MACROS, ID.SHOW_PM_MACROS },
+ { l.MENU_PM_MODULES, ID.SHOW_PM_MODULES },
},
gtkmenu {
- title = '_Lexers',
- 'actionscript', 'ada', 'antlr', 'apdl', 'applescript', 'asp', 'awk',
- 'batch', 'boo', 'container', 'cpp', 'csharp', 'css', 'd', 'diff', 'django',
- 'eiffel', 'erlang', 'errorlist', 'forth', 'fortran', 'gap', 'gettext',
- 'gnuplot', 'groovy', 'haskell', 'html', 'idl', 'ini', 'io', 'java',
- 'javascript', 'latex', 'lisp', 'lua', 'makefile', 'mysql', 'objective__c',
- 'ocaml', 'pascal', 'perl', 'php', 'pike', 'postscript', 'props', 'python',
- 'r', 'ragel', 'rebol', 'rexx', 'rhtml', 'ruby', 'scheme', 'shellscript',
- 'smalltalk', 'tcl', 'vala', 'verilog', 'vhdl', 'visualbasic', 'xml',
+ title = l.MENU_LEX_TITLE,
+ { 'actionscript', ID.LEXER_ACTIONSCRIPT },
+ { 'ada', ID.LEXER_ADA },
+ { 'antlr', ID.LEXER_ANTLR },
+ { 'apdl', ID.LEXER_APDL },
+ { 'applescript', ID.LEXER_APPLESCRIPT },
+ { 'asp', ID.LEXER_ASP },
+ { 'awk', ID.LEXER_AWK },
+ { 'batch', ID.LEXER_BATCH },
+ { 'boo', ID.LEXER_BOO },
+ { 'container', ID.LEXER_CONTAINER },
+ { 'cpp', ID.LEXER_CPP },
+ { 'csharp', ID.LEXER_CSHARP },
+ { 'css', ID.LEXER_CSS },
+ { 'd', ID.LEXER_D },
+ { 'diff', ID.LEXER_DIFF },
+ { 'django', ID.LEXER_DJANGO },
+ { 'eiffel', ID.LEXER_EIFFEL },
+ { 'erlang', ID.LEXER_ERLANG },
+ { 'errorlist', ID.LEXER_ERRORLIST },
+ { 'forth', ID.LEXER_FORTH },
+ { 'fortran', ID.LEXER_FORTRAN },
+ { 'gap', ID.LEXER_GAP },
+ { 'gettext', ID.LEXER_GETTEXT },
+ { 'gnuplot', ID.LEXER_GNUPLOT },
+ { 'groovy', ID.LEXER_GROOVY },
+ { 'haskell', ID.LEXER_HASKELL },
+ { 'html', ID.LEXER_HTML },
+ { 'idl', ID.LEXER_IDL },
+ { 'ini', ID.LEXER_INI },
+ { 'io', ID.LEXER_IO },
+ { 'java', ID.LEXER_JAVA },
+ { 'javascript', ID.LEXER_JAVASCRIPT },
+ { 'latex', ID.LEXER_LATEX },
+ { 'lisp', ID.LEXER_LISP },
+ { 'lua', ID.LEXER_LUA },
+ { 'makefile', ID.LEXER_MAKEFILE },
+ { 'mysql', ID.LEXER_MYSQL },
+ { 'objective__c', ID.LEXER_OBJECTIVEC },
+ { 'ocaml', ID.LEXER_OCAML },
+ { 'pascal', ID.LEXER_PASCAL },
+ { 'perl', ID.LEXER_PERL },
+ { 'php', ID.LEXER_PHP },
+ { 'pike', ID.LEXER_PIKE },
+ { 'postscript', ID.LEXER_POSTSCRIPT },
+ { 'props', ID.LEXER_PROPS },
+ { 'python', ID.LEXER_PYTHON },
+ { 'r', ID.LEXER_R },
+ { 'ragel', ID.LEXER_RAGEL },
+ { 'rebol', ID.LEXER_REBOL },
+ { 'rexx', ID.LEXER_REXX },
+ { 'rhtml', ID.LEXER_RHTML },
+ { 'ruby', ID.LEXER_RUBY },
+ { 'scheme', ID.LEXER_SCHEME },
+ { 'shellscript', ID.LEXER_SHELLSCRIPT },
+ { 'smalltalk', ID.LEXER_SMALLTALK },
+ { 'tcl', ID.LEXER_TCL },
+ { 'vala', ID.LEXER_VALA },
+ { 'verilog', ID.LEXER_VERILOG },
+ { 'vhdl', ID.LEXER_VHDL },
+ { 'visualbasic', ID.LEXER_VISUALBASIC },
+ { 'xml', ID.LEXER_XML },
},
}
@@ -190,132 +421,134 @@ end
local actions = {
-- File
- New = { t.new_buffer },
- Open = { t.io.open },
- Reload = { 'reload', b },
- Save = { 'save', b },
- ['Save As'] = { 'save_as', b },
- Close = { 'close', b },
- ['Close All'] = { t.io.close_all },
- ['Load Session...'] = { t.io.load_session }, -- TODO: file open dialog prompt
- ['Save Session...'] = { t.io.save_session }, -- TODO: file save dialog prompt
- Quit = { t.quit },
+ [ID.NEW] = { t.new_buffer },
+ [ID.OPEN] = { t.io.open },
+ [ID.RELOAD] = { 'reload', b },
+ [ID.SAVE] = { 'save', b },
+ [ID.SAVEAS] = { 'save_as', b },
+ [ID.CLOSE] = { 'close', b },
+ [ID.CLOSE_ALL] = { t.io.close_all },
+ [ID.LOAD_SESSION] = { t.io.load_session }, -- TODO: file open dialog prompt
+ [ID.SAVE_SESSION] = { t.io.save_session }, -- TODO: file save dialog prompt
+ [ID.QUIT] = { t.quit },
-- Edit
- Undo = { 'undo', b },
- Redo = { 'redo', b },
- Cut = { 'cut', b },
- Copy = { 'copy', b },
- Paste = { 'paste', b },
- Delete = { 'clear', b },
- ['Select All'] = { 'select_all', b },
- ['Match Brace'] = { m_editing.match_brace },
- ['Select to Brace'] = { m_editing.match_brace, 'select' },
- ['Complete Word'] = { m_editing.autocomplete_word, '%w_' },
- ['Delete Word'] = { m_editing.current_word, 'delete' },
- ['Transpose Characters'] = { m_editing.transpose_chars },
- ['Squeeze'] = { m_editing.squeeze },
- ['Join Lines'] = { m_editing.join_lines },
- ['Move line up'] = { m_editing.move_line, 'up' },
- ['Move line down'] = { m_editing.move_line, 'down' },
- ['Convert Indentation'] = { m_editing.convert_indentation },
+ [ID.UNDO] = { 'undo', b },
+ [ID.REDO] = { 'redo', b },
+ [ID.CUT] = { 'cut', b },
+ [ID.COPY] = { 'copy', b },
+ [ID.PASTE] = { 'paste', b },
+ [ID.DELETE] = { 'clear', b },
+ [ID.SELECT_ALL] = { 'select_all', b },
+ [ID.MATCH_BRACE] = { m_editing.match_brace },
+ [ID.SELECT_TO_BRACE] = { m_editing.match_brace, 'select' },
+ [ID.COMPLETE_WORD] = { m_editing.autocomplete_word, '%w_' },
+ [ID.DELETE_WORD] = { m_editing.current_word, 'delete' },
+ [ID.TRANSPOSE_CHARACTERS] = { m_editing.transpose_chars },
+ [ID.SQUEEZE] = { m_editing.squeeze },
+ [ID.JOIN_LINES] = { m_editing.join_lines },
+ [ID.MOVE_LINE_UP] = { m_editing.move_line, 'up' },
+ [ID.MOVE_LINE_DOWN] = { m_editing.move_line, 'down' },
+ [ID.CONVERT_INDENTATION] = { m_editing.convert_indentation },
-- Edit -> Kill Ring
- ['Cut to line end'] = { m_editing.smart_cutcopy },
- ['Copy to line end'] = { m_editing.smart_cutcopy, 'copy' },
- ['Paste from ring'] = { m_editing.smart_paste },
- ['Paste next from ring'] = { m_editing.smart_paste, 'cycle' },
- ['Paste prev from ring'] = { m_editing.smart_paste, 'reverse' },
+ [ID.CUT_TO_LINE_END] = { m_editing.smart_cutcopy },
+ [ID.COPY_TO_LINE_END] = { m_editing.smart_cutcopy, 'copy' },
+ [ID.PASTE_FROM_RING] = { m_editing.smart_paste },
+ [ID.PASTE_NEXT_FROM_RING] = { m_editing.smart_paste, 'cycle' },
+ [ID.PASTE_PREV_FROM_RING] = { m_editing.smart_paste, 'reverse' },
-- Edit -> Selection -> Execute as...
- Ruby = { m_editing.ruby_exec },
- Lua = { m_editing.lua_exec },
+ [ID.EXECUTE_AS_RUBY] = { m_editing.ruby_exec },
+ [ID.EXECUTE_AS_LUA] = { m_editing.lua_exec },
-- Edit -> Selection -> Enclose in...
- ['HTML Tags'] = { m_editing.enclose, 'tag' },
- ['HTML Single Tag'] = { m_editing.enclose, 'single_tag' },
- ['Double Quotes'] = { m_editing.enclose, 'dbl_quotes' },
- ['Single Quotes'] = { m_editing.enclose, 'sng_quotes' },
- Parentheses = { m_editing.enclose, 'parens' },
- Brackets = { m_editing.enclose, 'brackets' },
- Braces = { m_editing.enclose, 'braces' },
- ['Character Sequence'] = { m_editing.enclose, 'chars' },
+ [ID.ENCLOSE_IN_HTML_TAGS] = { m_editing.enclose, 'tag' },
+ [ID.ENCLOSE_IN_HTML_SINGLE_TAG] = { m_editing.enclose, 'single_tag' },
+ [ID.ENCLOSE_IN_DOUBLE_QUOTES] = { m_editing.enclose, 'dbl_quotes' },
+ [ID.ENCLOSE_IN_SINGLE_QUOTES] = { m_editing.enclose, 'sng_quotes' },
+ [ID.ENCLOSE_IN_PARENTHESES] = { m_editing.enclose, 'parens' },
+ [ID.ENCLOSE_IN_BRACKETS] = { m_editing.enclose, 'brackets' },
+ [ID.ENCLOSE_IN_BRACES] = { m_editing.enclose, 'braces' },
+ [ID.ENCLOSE_IN_CHARACTER_SEQUENCE] = { m_editing.enclose, 'chars' },
-- Edit -> Selection
- Grow = { m_editing.grow_selection, 1 },
+ [ID.GROW_SELECTION] = { m_editing.grow_selection, 1 },
-- Edit -> Select In...
- Structure = { m_editing.select_enclosed },
- ['HTML Tag'] = { m_editing.select_enclosed, 'tags' },
- ['Double Quote'] = { m_editing.select_enclosed, 'dbl_quotes' },
- ['Single Quote'] = { m_editing.select_enclosed, 'sng_quotes' },
- Parenthesis = { m_editing.select_enclosed, 'parens' },
- Bracket = { m_editing.select_enclosed, 'brackets' },
- Brace = { m_editing.select_enclosed, 'braces' },
- Word = { m_editing.current_word, 'select' },
- Line = { m_editing.select_line },
- Paragraph = { m_editing.select_paragraph },
- ['Indented Block'] = { m_editing.select_indented_block },
- Scope = { m_editing.select_scope },
+ [ID.SELECT_IN_STRUCTURE] = { m_editing.select_enclosed },
+ [ID.SELECT_IN_HTML_TAG] = { m_editing.select_enclosed, 'tags' },
+ [ID.SELECT_IN_DOUBLE_QUOTE] = { m_editing.select_enclosed, 'dbl_quotes' },
+ [ID.SELECT_IN_SINGLE_QUOTE] = { m_editing.select_enclosed, 'sng_quotes' },
+ [ID.SELECT_IN_PARENTHESIS] = { m_editing.select_enclosed, 'parens' },
+ [ID.SELECT_IN_BRACKET] = { m_editing.select_enclosed, 'brackets' },
+ [ID.SELECT_IN_BRACE] = { m_editing.select_enclosed, 'braces' },
+ [ID.SELECT_IN_WORD] = { m_editing.current_word, 'select' },
+ [ID.SELECT_IN_LINE] = { m_editing.select_line },
+ [ID.SELECT_IN_PARAGRAPH] = { m_editing.select_paragraph },
+ [ID.SELECT_IN_INDENTED_BLOCK] = { m_editing.select_indented_block },
+ [ID.SELECT_IN_SCOPE] = { m_editing.select_scope },
-- Search
- Find = { t.find.focus },
- ['Find Next'] = { t.find.call_find_next },
- ['Find Prev'] = { t.find.call_find_prev },
- ['Find and Replace'] = { t.find.focus },
- Replace = { t.find.call_replace },
- ['Replace All'] = { t.find.call_replace_all },
- ['Jump to'] = { m_editing.goto_line },
+ [ID.FIND] = { t.find.focus },
+ [ID.FIND_NEXT] = { t.find.call_find_next },
+ [ID.FIND_PREV] = { t.find.call_find_prev },
+ [ID.FIND_AND_REPLACE] = { t.find.focus },
+ [ID.REPLACE] = { t.find.call_replace },
+ [ID.REPLACE_ALL] = { t.find.call_replace_all },
+ [ID.GOTO_LINE] = { m_editing.goto_line },
-- Tools
- ['Focus Command Entry'] = { t.command_entry.focus },
+ [ID.FOCUS_COMMAND_ENTRY] = { t.command_entry.focus },
-- Tools -> Snippets
- ['Insert Snippet'] = { m_snippets.insert },
- ['Previous Placeholder'] = { m_snippets.prev },
- ['Cancel Snippet'] = { m_snippets.cancel_current },
- ['List Snippets'] = { m_snippets.list },
- ['Show Scope'] = { m_snippets.show_style },
+ [ID.INSERT_SNIPPET] = { m_snippets.insert },
+ [ID.PREVIOUS_SNIPPET_PLACEHOLDER] = { m_snippets.prev },
+ [ID.CANCEL_SNIPPET] = { m_snippets.cancel_current },
+ [ID.LIST_SNIPPETS] = { m_snippets.list },
+ [ID.SHOW_SCOPE] = { m_snippets.show_style },
-- Tools -> Multiple Line Editing
- ['Add Line'] = { m_mlines.add },
- ['Add Multiple Lines'] = { m_mlines.add_multiple },
- ['Remove Line'] = { m_mlines.remove },
- ['Remove Multiple Lines'] = { m_mlines.remove_multiple },
- ['Update Multiple Lines'] = { m_mlines.update },
- ['Finished Editing'] = { m_mlines.clear },
+ [ID.ADD_MULTIPLE_LINE] = { m_mlines.add },
+ [ID.ADD_MULTIPLE_LINES] = { m_mlines.add_multiple },
+ [ID.REMOVE_MULTIPLE_LINE] = { m_mlines.remove },
+ [ID.REMOVE_MULTIPLE_LINES] = { m_mlines.remove_multiple },
+ [ID.UPDATE_MULTIPLE_LINES] = { m_mlines.update },
+ [ID.FINISH_MULTIPLE_LINES] = { m_mlines.clear },
-- Tools -> Macros
- ['Start Recording'] = { m_macros.start_recording },
- ['Stop Recording'] = { m_macros.stop_recording },
- ['Play Macro'] = { m_macros.play },
+ [ID.START_RECORDING_MACRO] = { m_macros.start_recording },
+ [ID.STOP_RECORDING_MACRO] = { m_macros.stop_recording },
+ [ID.PLAY_MACRO] = { m_macros.play },
-- Buffers
- ['Next Buffer'] = { 'goto_buffer', v, 1, false },
- ['Prev Buffer'] = { 'goto_buffer', v, -1, false },
- ['Toggle View EOL'] = { toggle_setting, 'view_eol' },
- ['Toggle Wrap Mode'] = { toggle_setting, 'wrap_mode' },
- ['Toggle Show Indentation Guides'] = { toggle_setting, 'indentation_guides' },
- ['Toggle Use Tabs'] = { toggle_setting, 'use_tabs' },
- ['Toggle View Whitespace'] = { toggle_setting, 'view_ws' },
- ['Refresh Syntax Highlighting'] = { 'colourise', b, 0, -1 },
+ [ID.NEXT_BUFFER] = { 'goto_buffer', v, 1, false },
+ [ID.PREV_BUFFER] = { 'goto_buffer', v, -1, false },
+ [ID.TOGGLE_VIEW_EOL] = { toggle_setting, 'view_eol' },
+ [ID.TOGGLE_WRAP_MODE] = { toggle_setting, 'wrap_mode' },
+ [ID.TOGGLE_SHOW_INDENT_GUIDES] = { toggle_setting, 'indentation_guides' },
+ [ID.TOGGLE_USE_TABS] = { toggle_setting, 'use_tabs' },
+ [ID.TOGGLE_VIEW_WHITESPACE] = { toggle_setting, 'view_ws' },
+ [ID.REFRESH_SYNTAX_HIGHLIGHTING] = { 'colourise', b, 0, -1 },
-- Views
- ['Next View'] = { t.goto_view, 1, false },
- ['Prev View'] = { t.goto_view, -1, false },
- ['Split Vertical'] = { 'split', v },
- ['Split Horizontal'] = { 'split', v, false },
- ['Unsplit'] = { function() view:unsplit() end },
- ['Unsplit All'] = { function() while view:unsplit() do end end },
- ['Grow View'] = {
+ [ID.NEXT_VIEW] = { t.goto_view, 1, false },
+ [ID.PREV_VIEW] = { t.goto_view, -1, false },
+ [ID.SPLIT_VIEW_VERTICAL] = { 'split', v },
+ [ID.SPLIT_VIEW_HORIZONTAL] = { 'split', v, false },
+ [ID.UNSPLIT_VIEW] = { function() view:unsplit() end },
+ [ID.UNSPLIT_ALL_VIEWS] = { function() while view:unsplit() do end end },
+ [ID.GROW_VIEW] = {
function() if view.size then view.size = view.size + 10 end end
},
- ['Shrink View'] = {
+ [ID.SHRINK_VIEW] = {
function() if view.size then view.size = view.size - 10 end end
},
-- Project Manager
- ['Toggle PM Visible'] = { t.pm.toggle_visible },
- ['Focus PM'] = { t.pm.focus },
- ['Show PM Project'] = { pm_activate, 'project' },
- ['Show PM Ctags'] = { pm_activate, 'ctags' },
- ['Show PM Buffers'] = { pm_activate, 'buffers' },
- ['Show PM Files'] = { pm_activate, not WIN32 and '/' or 'C:\\' },
- ['Show PM Macros'] = { pm_activate, 'macros' },
- ['Show PM Modules'] = { pm_activate, 'modules' },
+ [ID.TOGGLE_PM_VISIBLE] = { t.pm.toggle_visible },
+ [ID.FOCUS_PM] = { t.pm.focus },
+ [ID.SHOW_PM_PROJECT] = { pm_activate, 'project' },
+ [ID.SHOW_PM_CTAGS] = { pm_activate, 'ctags' },
+ [ID.SHOW_PM_BUFFERS] = { pm_activate, 'buffers' },
+ [ID.SHOW_PM_FILES] = { pm_activate, not WIN32 and '/' or 'C:\\' },
+ [ID.SHOW_PM_MACROS] = { pm_activate, 'macros' },
+ [ID.SHOW_PM_MODULES] = { pm_activate, 'modules' },
}
-- Most of this handling code comes from keys.lua.
t.events.add_handler('menu_clicked',
- function(menu_item)
- local active_table = actions[menu_item] or
- { set_lexer_language, menu_item } -- anything not in actions is a lexer
+ function(menu_item, menu_id)
+ local active_table = actions[menu_id]
+ if menu_id >= ID.LEXER_ACTIONSCRIPT and menu_id <= ID.LEXER_XML then
+ active_table = { set_lexer_language, menu_item }
+ end
local f, args
if active_table and #active_table > 0 then
local func = active_table[1]
@@ -333,7 +566,7 @@ t.events.add_handler('menu_clicked',
local ret, retval = pcall( f, unpack(args) )
if not ret then textadept.events.error(retval) end -- error
else
- error( 'Unknown command: '..tostring(func) )
+ error( l.MENU_UNKNOWN_COMMAND..tostring(func) )
end
end
end)
diff --git a/core/ext/pm.lua b/core/ext/pm.lua
index 05b0e16a..ed997c5d 100644
--- a/core/ext/pm.lua
+++ b/core/ext/pm.lua
@@ -119,12 +119,13 @@ end
-- Performs an action based on the selected menu item.
-- This function is called internally and shouldn't be called by a script.
-- @param menu_item The label text of the menu item selected.
+-- @param menu_id The numeric ID of the menu item.
-- @param selected_item Identical to 'full_path' in pm.get_contents_for.
-- @see pm.get_contents_for
-function pm.perform_menu_action(menu_item, selected_item)
+function pm.perform_menu_action(menu_item, menu_id, selected_item)
for _, browser in pairs(pm.browsers) do
if browser.matches( selected_item[1] ) then
- return browser.perform_menu_action(menu_item, selected_item)
+ return browser.perform_menu_action(menu_item, menu_id, selected_item)
end
end
end
diff --git a/core/ext/pm/buffer_browser.lua b/core/ext/pm/buffer_browser.lua
index c2a1b787..f4822226 100644
--- a/core/ext/pm/buffer_browser.lua
+++ b/core/ext/pm/buffer_browser.lua
@@ -15,7 +15,7 @@ function get_contents_for()
index = string.format("%02i", index)
contents[index] = {
pixbuf = buffer.dirty and 'gtk-edit' or 'gtk-file',
- text = (buffer.filename or 'Untitled'):match('[^/\\]+$')
+ text = (buffer.filename or textadept.locale.UNTITLED):match('[^/\\]+$')
}
end
return contents
@@ -27,22 +27,32 @@ function perform_action(selected_item)
if buffer then view:goto_buffer(index) view:focus() end
end
+local ID = { NEW = 1, OPEN = 2, SAVE = 3, SAVEAS = 4, CLOSE = 5 }
+
function get_context_menu(selected_item)
- return { '_New', '_Open', '_Save', 'Save _As...', 'separator', '_Close' }
+ local locale = textadept.locale
+ return {
+ { locale.PM_BROWSER_BUFFER_NEW, ID.NEW },
+ { locale.PM_BROWSER_BUFFER_OPEN, ID.OPEN },
+ { locale.PM_BROWSER_BUFFER_SAVE, ID.SAVE },
+ { locale.PM_BROWSER_BUFFER_SAVEAS, ID.SAVEAS },
+ { 'separator', 0 },
+ { locale.PM_BROWSER_BUFFER_CLOSE, ID.CLOSE },
+ }
end
-function perform_menu_action(menu_item, selected_item)
- if menu_item == 'New' then
+function perform_menu_action(menu_item, menu_id, selected_item)
+ if menu_id == ID.NEW then
textadept.new_buffer()
- elseif menu_item == 'Open' then
+ elseif menu_id == ID.OPEN then
textadept.io.open()
- elseif menu_item == 'Save' then
+ elseif menu_id == ID.SAVE then
view:goto_buffer( tonumber( selected_item[2] ) )
buffer:save()
- elseif menu_item == 'Save As...' then
+ elseif menu_id == ID.SAVEAS then
view:goto_buffer( tonumber( selected_item[2] ) )
buffer:save_as()
- elseif menu_item == 'Close' then
+ elseif menu_id == ID.CLOSE then
view:goto_buffer( tonumber( selected_item[2] ) )
buffer:close()
end
diff --git a/core/ext/pm/ctags_browser.lua b/core/ext/pm/ctags_browser.lua
index b5495008..196eba5c 100644
--- a/core/ext/pm/ctags_browser.lua
+++ b/core/ext/pm/ctags_browser.lua
@@ -106,6 +106,7 @@ end
-- of the parent being expanded.
function get_contents_for(full_path, expanding)
local ctags_file = full_path[1]:sub(7) -- ignore 'ctags:'
+ local locale = textadept.locale
local f
if #ctags_file == 0 then
tags = {}
@@ -187,9 +188,11 @@ function get_contents_for(full_path, expanding)
entry.line_num = line_num
if not entry.set then tags[name] = entry end
else
- print('Extension "'..file_ext..'" not recognized.')
+ print( string.format(locale.PM_BROWSER_CTAGS_BAD_EXT, file_ext) )
end
- else print('unmatched ctag: '..line) end
+ else
+ print( string.format(locale.PM_BROWSER_CTAGS_UNMATCHED, line) )
+ end
end
end
f:close()
@@ -213,7 +216,8 @@ function perform_action(selected_item)
buffer:ensure_visible_enforce_policy(line)
buffer:goto_line(line)
else
- error(item.text..' not found.')
+ error(
+ string.format(textadept.locale.PM_BROWSER_CTAGS_NOT_FOUND, item.text) )
end
elseif item.line_num then
textadept.io.open(item.filepath)
@@ -226,7 +230,7 @@ function get_context_menu(selected_item)
end
-function perform_menu_action(menu_item, selected_item)
+function perform_menu_action(menu_item, menu_id, selected_item)
end
diff --git a/core/ext/pm/file_browser.lua b/core/ext/pm/file_browser.lua
index 5878b067..17ae3be1 100644
--- a/core/ext/pm/file_browser.lua
+++ b/core/ext/pm/file_browser.lua
@@ -38,35 +38,36 @@ function perform_action(selected_item)
view:focus()
end
+local ID = { CHANGE_DIR = 1, FILE_INFO = 2 }
+
function get_context_menu(selected_item)
- return { '_Change Directory', 'File _Details' }
+ local locale = textadept.locale
+ return {
+ { 'separator', 0 }, -- make it harder to click 'Change Directory' by mistake
+ { locale.PM_BROWSER_FILE_CD, ID.CHANGE_DIR },
+ { locale.PM_BROWSER_FILE_INFO, ID.FILE_INFO },
+ }
end
-function perform_menu_action(menu_item, selected_item)
+function perform_menu_action(menu_item, menu_id, selected_item)
+ local locale = textadept.locale
local filepath = table.concat(selected_item, '/')
- if menu_item == 'Change Directory' then
+ if menu_id == ID.CHANGE_DIR then
textadept.pm.entry_text = filepath
textadept.pm.activate()
- elseif menu_item == 'File Details' then
+ elseif menu_id == ID.FILE_INFO then
local date_format = '%D %T'
local attr = lfs.attributes(filepath)
- local out = string.format( [[
- Mode: %s
- Size: %s
- UID: %s
- GID: %s
- Device: %s
- Accessed: %s
- Modified: %s
- Changed: %s
- ]], attr.mode, attr.size, attr.uid, attr.gid, attr.dev,
+ local out = string.format( locale.PM_BROWSER_FILE_DATA,
+ attr.mode, attr.size, attr.uid, attr.gid, attr.dev,
os.date(date_format, attr.access),
os.date(date_format, attr.modification),
os.date(date_format, attr.change) )
cocoa_dialog( 'textbox', {
- ['informative-text'] = 'File details for '..filepath,
+ ['informative-text'] =
+ string.format(locale.PM_BROWSER_FILE_INFO_TEXT, filepath),
text = out,
- button1 = 'OK',
+ button1 = locale.PM_BROWSER_FILE_INFO_OK,
editable = false
} )
end
diff --git a/core/ext/pm/find_browser.lua b/core/ext/pm/find_browser.lua
index 1c4df96a..f722664e 100644
--- a/core/ext/pm/find_browser.lua
+++ b/core/ext/pm/find_browser.lua
@@ -96,6 +96,6 @@ function get_context_menu(selected_item)
end
-function perform_menu_action(menu_item, selected_item)
+function perform_menu_action(menu_item, menu_id, selected_item)
end
diff --git a/core/ext/pm/macro_browser.lua b/core/ext/pm/macro_browser.lua
index 0dc58894..e1394e5c 100644
--- a/core/ext/pm/macro_browser.lua
+++ b/core/ext/pm/macro_browser.lua
@@ -23,13 +23,16 @@ function perform_action(selected_item)
view:focus()
end
+local ID = { DELETE = 1 }
+
function get_context_menu(selected_item)
- return { '_Delete' }
+ local locale = textadept.locale
+ return { { locale.PM_BROWSER_MACRO_DELETE, ID.DELETE } }
end
-function perform_menu_action(menu_item, selected_item)
+function perform_menu_action(menu_item, menu_id, selected_item)
local m_macros = _m.textadept.macros
- if menu_item == 'Delete' then
+ if menu_id == ID.DELETE then
m_macros.delete( selected_item[2] )
end
textadept.pm.activate()
diff --git a/core/ext/pm/modules_browser.lua b/core/ext/pm/modules_browser.lua
index fc8b79e2..95a5bd9f 100644
--- a/core/ext/pm/modules_browser.lua
+++ b/core/ext/pm/modules_browser.lua
@@ -104,24 +104,33 @@ function perform_action(selected_item)
view:focus()
end
+local ID = {
+ NEW = 1, DELETE = 2, CONF_MIME_TYPES = 3, CONF_KEY_COMMANDS = 4, RELOAD = 5
+}
+
function get_context_menu(selected_item)
+ local locale = textadept.locale
return {
- '_New Module', '_Delete Module', 'separator',
- 'Configure _MIME Types', 'Configure _Key Commands', 'separator',
- '_Reload Modules'
+ { locale.PM_BROWSER_MODULE_NEW, ID.NEW },
+ { locale.PM_BROWSER_MODULE_DELETE, ID.DELETE },
+ { locale.PM_BROWSER_MODULE_CONF_MIME_TYPES, ID.CONF_MIME_TYPES },
+ { locale.PM_BROWSER_MODULE_CONF_KEY_COMMANDS, ID.CONF_KEY_COMMANDS },
+ { 'separator', 0 },
+ { locale.PM_BROWSER_MODULE_RELOAD, ID.RELOAD },
}
end
-function perform_menu_action(menu_item, selected_item)
- if menu_item == 'New Module' then
+function perform_menu_action(menu_item, menu_id, selected_item)
+ local locale = textadept.locale
+ if menu_id == ID.NEW then
local status, module_name = cocoa_dialog( 'standard-inputbox', {
- ['title'] = 'Module Name',
- ['informative-text'] = 'Module name:'
+ ['title'] = locale.PM_BROWSER_MODULE_NEW_TITLE,
+ ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_INFO_TEXT
} ):match('^(%d)%s+([^\n]+)%s+$')
if status ~= '1' then return end
local status, lang_name = cocoa_dialog( 'standard-inputbox', {
- ['title'] = 'Language Name',
- ['informative-text'] = 'Language name:'
+ ['title'] = locale.PM_BROWSER_MODULE_NEW_LANG_TITLE,
+ ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_LANG_INFO_TEXT
} ):match('^(%d)%s+([^\n]+)%s+$')
if status ~= '1' then return end
local module_dir = _HOME..'/modules/'..module_name
@@ -142,19 +151,19 @@ function perform_menu_action(menu_item, selected_item)
f:write(out)
f:close()
else
- cocoa_dialog( 'msgbox', {
- ['text'] = 'Error',
- ['informative-text'] = 'A module by that name already exists or\n'..
- 'you do not have permission to create the module.'
+ cocoa_dialog( 'ok-msgbox', {
+ ['text'] = locale.PM_BROWSER_MODULE_NEW_ERROR,
+ ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_ERROR_TEXT,
+ ['no-cancel'] = true
} )
return
end
- elseif menu_item == 'Delete Module' then
+ elseif menu_id == ID.DELETE then
local module_name = selected_item[2]
if cocoa_dialog( 'yesno-msgbox', {
- ['text'] = 'Delete Module?',
- ['informative-text'] = 'Are you sure you want to permanently delete '..
- 'the "'..module_name..'" module?',
+ ['text'] = locale.PM_BROWSER_MODULE_DELETE_TITLE,
+ ['informative-text'] =
+ string.format( locale.PM_BROWSER_MODULE_DELETE_TEXT, module_name ),
['no-cancel'] = true,
['no-newline'] = true
} ) == '1' then
@@ -168,9 +177,9 @@ function perform_menu_action(menu_item, selected_item)
else
return
end
- elseif menu_item == 'Configure MIME Types' then
+ elseif menu_id == ID.CONF_MIME_TYPES then
textadept.io.open(_HOME..'/core/ext/mime_types.lua')
- elseif menu_item == 'Configure Key Commands' then
+ elseif menu_id == ID.CONF_KEY_COMMANDS then
local textadept = textadept
if textadept.key_commands then
textadept.io.open(_HOME..'/core/ext/key_commands.lua')
@@ -179,7 +188,7 @@ function perform_menu_action(menu_item, selected_item)
elseif textadept.key_commands_mac then
textadept.io.open(_HOME..'/core/ext/key_commands_mac.lua')
end
- elseif menu_item == 'Reload Modules' then
+ elseif menu_id == ID.RELOAD then
textadept.reset()
end
textadept.pm.activate()
diff --git a/core/ext/pm/project_browser.lua b/core/ext/pm/project_browser.lua
index 8d147369..2dab8deb 100644
--- a/core/ext/pm/project_browser.lua
+++ b/core/ext/pm/project_browser.lua
@@ -73,29 +73,36 @@ function perform_action(selected_item)
view:focus()
end
+local ID = {
+ NEW = 1, OPEN = 2, CLOSE = 3, NEW_FILE = 4, ADD_FILES = 5, NEW_DIR = 6,
+ ADD_DIR = 7, DELETE_FILE = 8, RENAME_FILE = 9
+}
+
--- Displays the project manager context menu.
function get_context_menu(selected_item)
+ local locale = textadept.locale
return {
- 'separator', -- make it harder to click 'New Project' by mistake
- '_New Project',
- '_Open Project',
- '_Close Project',
- 'separator',
- 'Add New File',
- 'Add Existing Files',
- 'Add New Directory',
- 'Add Existing Director_y',
- '_Delete',
- '_Rename',
+ { 'separator', 0 }, -- make it harder to click 'New Project' by mistake
+ { locale.PM_BROWSER_PROJECT_NEW, ID.NEW },
+ { locale.PM_BROWSER_PROJECT_OPEN, ID.OPEN },
+ { locale.PM_BROWSER_PROJECT_CLOSE, ID.CLOSE },
+ { 'separator', 0 },
+ { locale.PM_BROWSER_PROJECT_NEW_FILE, ID.NEW_FILE },
+ { locale.PM_BROWSER_PROJECT_ADD_FILES, ID.ADD_FILES },
+ { locale.PM_BROWSER_PROJECT_NEW_DIR, ID.NEW_DIR },
+ { locale.PM_BROWSER_PROJECT_ADD_DIR, ID.ADD_DIR },
+ { locale.PM_BROWSER_PROJECT_DELETE_FILE, ID.DELETE_FILE },
+ { locale.PM_BROWSER_PROJECT_RENAME_FILE, ID.RENAME_FILE },
}
end
-function perform_menu_action(menu_item, selected_item)
- if menu_item == 'New Project' then
+function perform_menu_action(menu_item, menu_id, selected_item)
+ local locale = textadept.locale
+ if menu_id == ID.NEW then
-- Close all open files and prompt the user to save a project file.
if textadept.io.close_all() then
local file = cocoa_dialog( 'filesave', {
- title = 'Save Project',
+ title = locale.PM_BROWSER_PROJECT_NEW_TITLE,
['with-directory'] = (buffer.filename or ''):match('.+[/\\]'),
['no-newline'] = true
} )
@@ -106,11 +113,11 @@ function perform_menu_action(menu_item, selected_item)
end
end
- elseif menu_item == 'Open Project' then
+ elseif menu_id == ID.OPEN then
-- Close all open files and prompt the user for a project file to open.
if textadept.io.close_all() then
local file = cocoa_dialog( 'fileselect', {
- title = 'Open Project',
+ title = locale.PM_BROWSER_PROJECT_OPEN_TITLE,
['with-directory'] = (buffer.filename or ''):match('.+[/\\]'),
['no-newline'] = true
} )
@@ -120,7 +127,7 @@ function perform_menu_action(menu_item, selected_item)
end
end
- elseif menu_item == 'Close Project' then
+ elseif menu_id == ID.CLOSE then
-- Close all open files and clear the project variables.
if textadept.io.close_all() then
project_file = nil
@@ -128,12 +135,12 @@ function perform_menu_action(menu_item, selected_item)
textadept.pm.clear()
end
- elseif menu_item == 'Add New File' then
+ elseif menu_id == ID.NEW_FILE then
-- If a project is open, prompts the user to save the new file.
if project_file then
local dir = get_live_parent_folder(selected_item)
local file = cocoa_dialog( 'filesave', {
- title = 'Save File',
+ title = locale.PM_BROWSER_PROJECT_NEW_FILE_TITLE,
['with-directory'] = dir or project_file:match('.+[/\\]'),
['no-newline'] = true
} )
@@ -156,10 +163,9 @@ function perform_menu_action(menu_item, selected_item)
-- project root instead.
if dir and file:match('^(.+)[/\\]') ~= dir then
local ret = cocoa_dialog( 'yesno-msgbox', {
- text = 'Add to Project Root Instead?',
- ['informative-text'] = 'You are adding a new file to a live '..
- 'folder which may not show up if the filepaths do not match.'..
- '\nAdd the file to the project root instead?',
+ text = locale.PM_BROWSER_PROJECT_NEW_FILE_LIVE_FOLDER_TITLE,
+ ['informative-text'] =
+ locale.PM_BROWSER_PROJECT_NEW_FILE_LIVE_FOLDER_TEXT,
['no-newline'] = true
} )
if ret == '1' then add_file_to(project_root) end
@@ -172,7 +178,7 @@ function perform_menu_action(menu_item, selected_item)
end
end
- elseif menu_item == 'Add Existing Files' then
+ elseif menu_id == ID.ADD_FILES then
-- If a project is open, prompts the user to add existing files.
-- If the directory the files are being added to is a live folder, the user
-- is asked to add the files to the project root instead of the live folder
@@ -181,8 +187,8 @@ function perform_menu_action(menu_item, selected_item)
-- not always apply when live folders are in a project.
if project_file then
local files = cocoa_dialog( 'fileselect', {
- title = 'Select Files',
- text = 'Select files to add to the project',
+ title = locale.PM_BROWSER_PROJECT_ADD_FILES_TITLE,
+ text = locale.PM_BROWSER_PROJECT_ADD_FILES_TEXT,
-- in Windows, dialog:get_filenames() is unavailable; only allow single
-- selection
['select-multiple'] = not WIN32 or nil,
@@ -205,17 +211,16 @@ function perform_menu_action(menu_item, selected_item)
add_files_to(project_folder)
else
if cocoa_dialog( 'yesno-msgbox', {
- text = 'Add to Project Root Instead?',
- ['informative-text'] = 'You are adding existing files to a live '..
- 'folder which is not possible.\nAdd them to the project root '..
- 'instead?',
+ text = locale.PM_BROWSER_PROJECT_ADD_FILES_LIVE_FOLDER_TITLE,
+ ['informative-text'] =
+ locale.PM_BROWSER_PROJECT_ADD_FILES_LIVE_FOLDER_TEXT,
['no-newline'] = true,
} ) == '1' then add_files_to(project_root) end
end
end
end
- elseif menu_item == 'Add New Directory' then
+ elseif menu_id == ID.NEW_DIR then
-- If a project is open, prompts the user for a directory name to add.
-- This only works if the directory the directory is being added to is not a
-- live directory.
@@ -223,7 +228,7 @@ function perform_menu_action(menu_item, selected_item)
-- does not always apply when live folders are in a project.
if project_file then
local ret, name = cocoa_dialog( 'standard-inputbox', {
- ['informative-text'] = 'Directory Name?',
+ ['informative-text'] = locale.PM_BROWSER_PROJECT_NEW_DIR_TITLE,
['no-newline'] = true
} ):match('^(%d)\n([^\n]+)$')
if ret == '1' and name and #name > 0 then
@@ -238,7 +243,7 @@ function perform_menu_action(menu_item, selected_item)
end
end
- elseif menu_item == 'Add Existing Directory' then
+ elseif menu_id == ID.ADD_DIR then
-- If a project is open, prompts the user for an existing directory to add.
-- If the directory the directory being added to is a live folder, the user
-- is asked to add the directory to the project root instead of the live
@@ -247,8 +252,8 @@ function perform_menu_action(menu_item, selected_item)
-- does not always apply when live folders are in a project.
if project_file then
local dir = cocoa_dialog( 'fileselect', {
- title = 'Select Directory',
- text = 'Select a directory to add to the project',
+ title = locale.PM_BROWSER_PROJECT_ADD_DIR_TITLE,
+ text = locale.PM_BROWSER_PROJECT_ADD_DIR_TEXT,
['select-only-directories'] = true,
['with-directory'] = (buffer.filename or ''):match('.+[/\\]'),
['no-newline'] = true
@@ -266,17 +271,16 @@ function perform_menu_action(menu_item, selected_item)
add_directory_to(project_folder)
else
if cocoa_dialog( 'yesno-msgbox', {
- text = 'Add to Project Root Instead?',
- ['informative-text'] = 'You are adding an existing directory to '..
- 'a live folder which is not possible.\nAdd it to the project '..
- 'root instead?',
+ text = locale.PM_BROWSER_PROJECT_ADD_DIR_LIVE_FOLDER_TITLE,
+ ['informative-text'] =
+ locale.PM_BROWSER_PROJECT_ADD_DIR_LIVE_FOLDER_TEXT,
['no-newline'] = true,
} ) == '1' then add_directory_to(project_root) end
end
end
end
- elseif menu_item == 'Delete' then
+ elseif menu_id == ID.DELETE_FILE then
-- If a project is open, deletes the file from the project unless it is
-- contained in a live folder.
if project_file then
@@ -291,10 +295,9 @@ function perform_menu_action(menu_item, selected_item)
for i, file in ipairs(project_folder) do
if file == item then
local ret = cocoa_dialog( 'yesno-msgbox', {
- text = 'Keep on Disk?',
- ['informative-text'] = 'This file will be removed from the '..
- 'project.\nLeave it on your computer? If not, it will be '..
- 'permanently deleted.',
+ text = locale.PM_BROWSER_PROJECT_DELETE_FILE_TITLE,
+ ['informative-text'] =
+ locale.PM_BROWSER_PROJECT_DELETE_FILE_TEXT,
['no-newline'] = true
} )
if ret == '2' then os.remove(file) end
@@ -319,10 +322,8 @@ function perform_menu_action(menu_item, selected_item)
local parent_folder = get_parent_folder(selected_item)
if item_is_dir and not parent_folder.is_live_folder then
local ret = cocoa_dialog( 'yesno-msgbox', {
- text = 'Keep on Disk?',
- ['informative-text'] = 'This directory will be removed from the '..
- 'project.\nLeave it on your computer? If not, it will be '..
- 'permanently deleted.',
+ text = locale.PM_BROWSER_PROJECT_DELETE_DIR_TITLE,
+ ['informative-text'] = locale.PM_BROWSER_PROJECT_DELETE_DIR_TEXT,
['no-newline'] = true
} )
if ret == '2' then remove_directory(item) end
@@ -330,15 +331,13 @@ function perform_menu_action(menu_item, selected_item)
parent_folder[item] = nil
else
if cocoa_dialog( 'msgbox', {
- text = 'Delete Permanently?',
- ['informative-text'] = 'You have selected a file from a live '..
- 'folder to delete.\nIt will be deleted permanently. Continue?\n'..
- '(To delete a live folder from the project, select the highest '..
- 'level live folder.)',
+ text = locale.PM_BROWSER_PROJECT_DELETE_LIVE_FILE_TITLE,
+ ['informative-text'] =
+ locale.PM_BROWSER_PROJECT_DELETE_LIVE_FILE_TEXT,
['no-newline'] = true,
- button1 = 'No',
- button2 = 'Yes',
- button3 = 'Cancel',
+ button1 = locale.PM_BROWSER_PROJECT_DELETE_LIVE_FILE_BUTTON1,
+ button2 = locale.PM_BROWSER_PROJECT_DELETE_LIVE_FILE_BUTTON2,
+ button3 = locale.PM_BROWSER_PROJECT_DELETE_LIVE_FILE_BUTTON3
} ) ~= '2' then return end
if item_is_dir then remove_directory(item) else os.remove(item) end
end
@@ -347,11 +346,11 @@ function perform_menu_action(menu_item, selected_item)
refresh_view()
end
- elseif menu_item == 'Rename' then
+ elseif menu_id == ID.RENAME_FILE then
-- If a project is open, prompts the user for a new file/directory name.
if project_file then
local ret, name = cocoa_dialog( 'standard-inputbox', {
- ['informative-text'] = 'New Name?',
+ ['informative-text'] = locale.PM_BROWSER_PROJECT_RENAME_FILE_TEXT,
['no-newline'] = true
} ):match('^(%d)\n([^\n]+)$')
if ret == '1' and name and #name > 0 then
diff --git a/core/file_io.lua b/core/file_io.lua
index 42766e7a..44fbe444 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -44,9 +44,10 @@ end
-- specified, the user is prompted to open files from a dialog.
-- @usage textadept.io.open(filename)
function open(filenames)
+ local locale = textadept.locale
filenames = filenames or cocoa_dialog( 'fileselect', {
- title = 'Open',
- text = 'Select a file(s) to open',
+ title = locale.IO_OPEN_TITLE,
+ text = locale.IO_OPEN_TEXT,
-- in Windows, dialog:get_filenames() is unavailable; only allow single
-- selection
['select-multiple'] = not WIN32 or nil,
@@ -103,7 +104,7 @@ function save_as(buffer, filename)
textadept.check_focused_buffer(buffer)
if not filename then
filename = cocoa_dialog( 'filesave', {
- title = 'Save',
+ title = textadept.locale.IO_SAVE_TITLE,
['with-directory'] = (buffer.filename or ''):match('.+[/\\]'),
['with-file'] = (buffer.filename or ''):match('[^/\\]+$'),
['no-newline'] = true
@@ -138,11 +139,12 @@ end
-- buffer.
-- @usage buffer:close()
function close(buffer)
+ local locale = textadept.locale
textadept.check_focused_buffer(buffer)
if buffer.dirty and cocoa_dialog( 'yesno-msgbox', {
- title = 'Save?',
- text = 'Save changes before closing?',
- ['informative-text'] = 'You will have to save changes manually.',
+ title = locale.IO_CLOSE_TITLE,
+ text = locale.IO_CLOSE_TEXT,
+ ['informative-text'] = locale.IO_CLOSE_MSG,
['no-newline'] = true
} ) ~= '2' then return false end
buffer:delete()
diff --git a/core/init.lua b/core/init.lua
index 7fc94052..57d06a3d 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -9,6 +9,7 @@ end
_THEME = ''
require 'iface'
+require 'locale'
require 'events'
require 'file_io'
if not MAC then
@@ -22,10 +23,11 @@ end
-- if the check fails.
-- @param buffer The buffer in question.
function textadept.check_focused_buffer(buffer)
+ local locale = textadept.locale
if type(buffer) ~= 'table' or not buffer.doc_pointer then
- error('Buffer argument expected.', 2)
+ error(locale.ERR_BUFFER_EXPECTED, 2)
elseif textadept.focused_doc_pointer ~= buffer.doc_pointer then
- error('The indexed buffer is not the focused one.', 2)
+ error(locale.ERR_BUFFER_NOT_FOCUSED, 2)
end
end
diff --git a/core/locale.lua b/core/locale.lua
new file mode 100644
index 00000000..00d10b50
--- /dev/null
+++ b/core/locale.lua
@@ -0,0 +1,591 @@
+-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+
+---
+-- This module contains all messages used by Textadept for localization.
+-- Lua strings can contain UTF-8 characters. If you use the \ddd representation
+-- though, it must be in DECIMAL format, not Octal as in some other programming
+-- languages.
+-- However, you must convert any UTF-16, UTF-32, etc. to UTF-8 manually as the
+-- \U+xxxx format cannot be represented in Lua.
+module('textadept.locale', package.seeall)
+
+-- init.lua
+
+-- core/events.lua
+
+-- Untitled
+UNTITLED = 'Untitled'
+-- OVR
+STATUS_OVR = 'OVR'
+-- INS
+STATUS_INS = 'INS'
+-- CRLF
+STATUS_CRLF = 'CRLF'
+-- CR
+STATUS_CR = 'CR'
+-- LF
+STATUS_LF = 'LF'
+-- "Tabs: "
+STATUS_TABS = 'Tabs: '
+-- "Spaces: "
+STATUS_SPACES = 'Spaces: '
+-- "Line: %d/%d Col: %d Lexer: %s %s %s %s"
+DOCSTATUSBAR_TEXT = "Line: %d/%d Col: %d Lexer: %s %s %s %s"
+-- Save?
+EVENTS_QUIT_TITLE = 'Save?'
+-- Save changes before quitting?
+EVENTS_QUIT_TEXT = 'Save changes before quitting?'
+-- The following buffers are unsaved:
+--
+-- %s
+--
+-- You will have to save changes manually
+EVENTS_QUIT_MSG = [[
+The following buffers are unsaved:
+
+%s
+
+You will have to save changes manually.
+]]
+
+-- core/file_io.lua
+
+-- Open
+IO_OPEN_TITLE = 'Open'
+-- Select a file(s) to open
+IO_OPEN_TEXT = 'Select a file(s) to open'
+-- Save
+IO_SAVE_TITLE = 'Save'
+-- Save?
+IO_CLOSE_TITLE = 'Save?'
+-- Save changes before closing?
+IO_CLOSE_TEXT = 'Save changes before closing?'
+-- You will have to save changes manually.
+IO_CLOSE_MSG = 'You will have to save changes manually.'
+
+-- core/iface.lua
+
+-- core/init.lua
+
+-- Buffer argument expected.
+ERR_BUFFER_EXPECTED = 'Buffer argument expected.'
+-- The indexed buffer is not the focused one.
+ERR_BUFFER_NOT_FOCUSED = 'The indexed buffer is not the focused one.'
+
+-- core/ext/command_entry.lua
+
+-- core/ext/find.lua
+
+-- Search wrapped
+FIND_SEARCH_WRAPPED = 'Search wrapped'
+-- No results found
+FIND_NO_RESULTS = 'No results found'
+-- Error
+FIND_ERROR_DIALOG_TITLE = 'Error'
+-- An error occured:
+FIND_ERROR_DIALOG_TEXT = 'An error occured'
+-- replacement(s) made
+FIND_REPLACEMENTS_MADE = 'replacement(s) made'
+
+-- core/ext/keys.lua
+
+-- "Keychain: "
+KEYCHAIN = 'Keychain: '
+-- Invalid sequence
+KEYS_INVALID = 'Invalid sequence'
+-- "Unknown command: "
+KEYS_UNKNOWN_COMMAND = 'Unknown command: '
+
+-- core/ext/menu.lua
+
+-- _File
+MENU_FILE_TITLE = '_File'
+-- gtk-new
+MENU_FILE_NEW = 'gtk-new'
+-- gtk-open
+MENU_FILE_OPEN = 'gtk-open'
+-- _Reload
+MENU_FILE_RELOAD = '_Reload'
+-- gtk-save
+MENU_FILE_SAVE = 'gtk-save'
+-- gtk-save-as
+MENU_FILE_SAVEAS = 'gtk-save-as'
+-- gtk-close
+MENU_FILE_CLOSE = 'gtk-close'
+-- Close A_ll
+MENU_FILE_CLOSE_ALL = 'Close A_ll'
+-- Loa_d Session...
+MENU_FILE_LOAD_SESSION = 'Loa_d Session...'
+-- Sa_ve Session...
+MENU_FILE_SAVE_SESSION = 'Sa_ve Session...'
+-- gtk-quit
+MENU_FILE_QUIT = 'gtk-quit'
+-- _Edit
+MENU_EDIT_TITLE = '_Edit'
+-- gtk-undo
+MENU_EDIT_UNDO = 'gtk-undo'
+-- gtk-redo
+MENU_EDIT_REDO = 'gtk-redo'
+-- gtk-cut
+MENU_EDIT_CUT = 'gtk-cut'
+-- gtk-copy
+MENU_EDIT_COPY = 'gtk-copy'
+-- gtk-paste
+MENU_EDIT_PASTE = 'gtk-paste'
+-- gtk-delete
+MENU_EDIT_DELETE = 'gtk-delete'
+-- gtk-select-all
+MENU_EDIT_SELECT_ALL = 'gtk-select-all'
+-- Match _Brace
+MENU_EDIT_MATCH_BRACE = 'Match _Brace'
+-- Select t_o Brace
+MENU_EDIT_SELECT_TO_BRACE = 'Select t_o Brace'
+-- Complete _Word
+MENU_EDIT_COMPLETE_WORD = 'Complete _Word'
+-- De_lete Word
+MENU_EDIT_DELETE_WORD = 'De_lete Word'
+-- Tran_spose Characters
+MENU_EDIT_TRANSPOSE_CHARACTERS = 'Tran_spose Characters'
+-- S_queeze
+MENU_EDIT_SQUEEZE = 'S_queeze'
+-- _Join Lines
+MENU_EDIT_JOIN_LINES = '_Join Lines'
+-- _Move Line Up
+MENU_EDIT_MOVE_LINE_UP = '_Move Line Up'
+-- Mo_ve Line Down
+MENU_EDIT_MOVE_LINE_DOWN = 'Mo_ve Line Down'
+-- Convert _Indentation
+MENU_EDIT_CONVERT_INDENTATION = 'Convert _Indentation'
+-- _Kill Ring
+MENU_EDIT_KR_TITLE = '_Kill Ring'
+-- _Cut to Line End
+MENU_EDIT_KR_CUT_TO_LINE_END = '_Cut to Line End'
+-- C_opy to Line End
+MENU_EDIT_KR_COPY_TO_LINE_END = 'C_opy to Line End'
+-- _Paste From
+MENU_EDIT_KR_PASTE_FROM = '_Paste From'
+-- Paste _Next From
+MENU_EDIT_KR_PASTE_NEXT_FROM = 'Paste _Next From'
+-- Paste _Previous From
+MENU_EDIT_KR_PASTE_PREV_FROM = 'Paste _Previous From'
+-- S_election
+MENU_EDIT_SEL_TITLE = 'S_election'
+-- E_xecute as...
+MENU_EDIT_SEL_EXEC_TITLE = 'E_xecute as...'
+-- _Ruby
+MENU_EDIT_SEL_EXEC_AS_RUBY = '_Ruby'
+-- _Lua
+MENU_EDIT_SEL_EXEC_AS_LUA = '_Lua'
+-- _Enclose in...
+MENU_EDIT_SEL_ENC_TITLE = '_Enclose in...'
+-- _HTML Tags
+MENU_EDIT_SEL_ENC_HTML_TAGS = '_HTML Tags'
+-- HTML Single _Tag
+MENU_EDIT_SEL_ENC_HTML_SINGLE_TAG = 'HTML Single _Tag'
+-- _Double Quotes
+MENU_EDIT_SEL_ENC_DOUBLE_QUOTES = '_Double Quotes'
+-- _Single Quotes
+MENU_EDIT_SEL_ENC_SINGLE_QUOTES = '_Single Quotes'
+-- _Parentheses
+MENU_EDIT_SEL_ENC_PARENTHESES = '_Parentheses'
+-- _Brackets
+MENU_EDIT_SEL_ENC_BRACKETS = '_Brackets'
+-- B_races
+MENU_EDIT_SEL_ENC_BRACES = 'B_races'
+-- _Character Sequence
+MENU_EDIT_SEL_ENC_CHAR_SEQ = '_Character Sequence'
+-- _Grow
+MENU_EDIT_SEL_GROW = '_Grow'
+-- Select i_n...
+MENU_EDIT_SEL_IN_TITLE = 'Select i_n...'
+-- S_tructure
+MENU_EDIT_SEL_IN_STRUCTURE = 'S_tructure'
+-- _HTML Tag
+MENU_EDIT_SEL_IN_HTML_TAG = '_HTML Tag'
+-- _Double Quote
+MENU_EDIT_SEL_IN_DOUBLE_QUOTE = '_Double Quote'
+-- _Single Quote
+MENU_EDIT_SEL_IN_SINGLE_QUOTE = '_Single Quote'
+-- _Parenthesis
+MENU_EDIT_SEL_IN_PARENTHESIS = '_Parenthesis'
+-- _Bracket
+MENU_EDIT_SEL_IN_BRACKET = '_Bracket'
+-- B_race
+MENU_EDIT_SEL_IN_BRACE = 'B_race'
+-- _Word
+MENU_EDIT_SEL_IN_WORD = '_Word'
+-- _Line
+MENU_EDIT_SEL_IN_LINE = '_Line'
+-- Para_graph
+MENU_EDIT_SEL_IN_PARAGRAPH = 'Para_graph'
+-- _Indented Block
+MENU_EDIT_SEL_IN_INDENTED_BLOCK = '_Indented Block'
+-- S_cope
+MENU_EDIT_SEL_IN_SCOPE = 'S_cope'
+
+-- _Search
+MENU_SEARCH_TITLE = '_Search'
+-- gtk-find
+MENU_SEARCH_FIND = 'gtk-find'
+-- Find _Next
+MENU_SEARCH_FIND_NEXT = 'Find _Next'
+-- Find _Previous
+MENU_SEARCH_FIND_PREV = 'Find _Previous'
+-- gtk-find-and-replace
+MENU_SEARCH_FIND_AND_REPLACE = 'gtk-find-and-replace'
+-- Replace
+MENU_SEARCH_REPLACE = 'Replace'
+-- Replace _All
+MENU_SEARCH_REPLACE_ALL = 'Replace _All'
+-- gtk-jump-to
+MENU_SEARCH_GOTO_LINE = 'gtk-jump-to'
+
+-- _Tools
+MENU_TOOLS_TITLE = '_Tools'
+-- Focus _Command Entry
+MENU_TOOLS_FOCUS_COMMAND_ENTRY = 'Focus _Command Entry'
+-- _Snippets
+MENU_TOOLS_SNIPPETS_TITLE = '_Snippets'
+-- _Insert Snippet
+MENU_TOOLS_SNIPPETS_INSERT = '_Insert'
+-- _Previous Placeholder
+MENU_TOOLS_SNIPPETS_PREV_PLACE = '_Previous Placeholder'
+-- _Cancel
+MENU_TOOLS_SNIPPETS_CANCEL = '_Cancel'
+-- _List
+MENU_TOOLS_SNIPPETS_LIST = '_List'
+-- _Show Scope
+MENU_TOOLS_SNIPPETS_SHOW_SCOPE = '_Show Scope'
+-- _Multiple Line Editing
+MENU_TOOLS_ML_TITLE = '_Multiple Line Editing'
+-- _Add Line
+MENU_TOOLS_ML_ADD = '_Add Line'
+-- Add _Multiple Lines
+MENU_TOOLS_ML_ADD_MULTIPLE = 'Add _Multiple Lines'
+-- _Remove Line
+MENU_TOOLS_ML_REMOVE = '_Remove Line'
+-- R_emove Multiple Lines
+MENU_TOOLS_ML_REMOVE_MULTIPLE = 'R_emove Multiple Lines'
+-- _Update Multiple Lines
+MENU_TOOLS_ML_UPDATE = '_Update Multiple Lines'
+-- _Finish Editing
+MENU_TOOLS_ML_FINISH = '_Finish Editing'
+-- M_acros
+MENU_TOOLS_MACROS_TITLE = 'M_acros'
+-- _Start Recording
+MENU_TOOLS_MACROS_START = '_Start Recording'
+-- S_top Recording
+MENU_TOOLS_MACROS_STOP = 'S_top Recording'
+-- _Play Macro
+MENU_TOOLS_MACROS_PLAY = '_Play Macro'
+
+-- _Buffers
+MENU_BUF_TITLE = '_Buffers'
+-- _Next Buffer
+MENU_BUF_NEXT = '_Next Buffer'
+-- _Prev Buffer
+MENU_BUF_PREV = '_Prev Buffer'
+-- Toggle View _EOL
+MENU_BUF_TOGGLE_VIEW_EOL = 'Toggle View _EOL'
+-- Toggle _Wrap Mode
+MENU_BUF_TOGGLE_WRAP = 'Toggle _Wrap Mode'
+-- Toggle Show _Indentation Guides
+MENU_BUF_TOGGLE_INDENT_GUIDES = 'Toggle Show _Indentation Guides'
+-- Toggle Use _Tabs
+MENU_BUF_TOGGLE_TABS = 'Toggle Use _Tabs'
+-- Toggle View White_space
+MENU_BUF_TOGGLE_VIEW_WHITESPACE = 'Toggle View White_space'
+-- _Refresh Syntax Highlighting
+MENU_BUF_REFRESH = '_Refresh Syntax Highlighting'
+
+-- _Views
+MENU_VIEW_TITLE = '_Views'
+-- _Next View
+MENU_VIEW_NEXT = '_Next View'
+-- _Prev View
+MENU_VIEW_PREV = '_Prev View'
+-- Split _Vertical
+MENU_VIEW_SPLIT_VERTICAL = 'Split _Vertical'
+-- Split _Horizontal
+MENU_VIEW_SPLIT_HORIZONTAL = 'Split _Horizontal'
+-- _Unsplit
+MENU_VIEW_UNSPLIT = '_Unsplit'
+-- Unsplit _All
+MENU_VIEW_UNSPLIT_ALL = 'Unsplit _All'
+-- _Grow
+MENU_VIEW_GROW = '_Grow'
+-- _Shrink
+MENU_VIEW_SHRINK = '_Shrink'
+
+-- _Project Manager
+MENU_PM_TITLE = '_Project Manager'
+-- _Toggle Visible
+MENU_PM_TOGGLE_VISIBLE = '_Toggle Visible'
+-- _Focus
+MENU_PM_FOCUS = '_Focus'
+-- Show _Project
+MENU_PM_PROJECT = 'Show _Project'
+-- Show _CTags
+MENU_PM_CTAGS = 'Show _CTags'
+-- Show _Buffers
+MENU_PM_BUFFERS = 'Show _Buffers'
+-- Show _Files
+MENU_PM_FILES = 'Show _Files'
+-- Show _Macros
+MENU_PM_MACROS = 'Show _Macros'
+-- Show Mo_dules
+MENU_PM_MODULES = 'Show Mo_dules'
+
+-- _Lexers
+MENU_LEX_TITLE = '_Lexers'
+
+-- "Unknown command: "
+MENU_UNKNOWN_COMMAND = 'Unknown command: '
+
+-- core/ext/mime_types.lua
+
+-- core/ext/pm.lua
+
+-- core/ext/pm/buffer_browser.lua
+
+-- gtk-new
+PM_BROWSER_BUFFER_NEW = 'gtk-new'
+-- gtk-open
+PM_BROWSER_BUFFER_OPEN = 'gtk-open'
+-- gtk-save
+PM_BROWSER_BUFFER_SAVE = 'gtk-save'
+-- gtk-save-as
+PM_BROWSER_BUFFER_SAVEAS = 'gtk-save-as'
+-- gtk-close
+PM_BROWSER_BUFFER_CLOSE = 'gtk-close'
+
+-- core/ext/pm/ctags.lua
+
+-- 'Extension "%s" not recognized'
+PM_BROWSER_CTAGS_BAD_EXT = 'Extension "%s" not recognized.'
+-- "Unmatched ctag: %s"
+PM_BROWSER_CTAGS_UNMATCHED = 'Unmatched ctag: %s'
+-- '"%s" not found.'
+PM_BROWSER_CTAGS_NOT_FOUND = '"%s" not found.'
+
+-- core/ext/pm/file_browser.lua
+
+-- _Change Directory
+PM_BROWSER_FILE_CD = '_Change Directory'
+-- File _Info
+PM_BROWSER_FILE_INFO = 'File _Info'
+-- Mode: %s
+-- Size: %s
+-- UID: %s
+-- GID: %s
+-- Device: %s
+-- Accessed: %s
+-- Modified: %s
+-- Changed: %s
+PM_BROWSER_FILE_DATA = [[
+Mode: %s
+Size: %s
+UID: %s
+GID: %s
+Device: %s
+Accessed: %s
+Modified: %s
+Changed: %s
+]]
+-- 'File info for "%s"'
+PM_BROWSER_FILE_INFO_TEXT = 'File info for "%s"'
+-- OK
+PM_BROWSER_FILE_INFO_OK = 'OK'
+
+-- core/ext/pm/find_browser.lua
+
+-- core/ext/pm/macro_browser.lua
+
+-- _Delete
+PM_BROWSER_MACRO_DELETE = '_Delete'
+
+-- core/ext/pm/modules_browser.lua
+
+-- _New Module
+PM_BROWSER_MODULE_NEW = '_New Module'
+-- _Delete Module
+PM_BROWSER_MODULE_DELETE = '_Delete Module'
+-- Configure _MIME Types
+PM_BROWSER_MODULE_CONF_MIME_TYPES = 'Configure _MIME Types'
+-- Configure _Key Commands
+PM_BROWSER_MODULE_CONF_KEY_COMMANDS = 'Configure _Key Commands'
+-- _Reload Modules
+PM_BROWSER_MODULE_RELOAD = '_Reload Modules'
+-- Module Name
+PM_BROWSER_MODULE_NEW_TITLE = 'Module Name'
+-- Module name:
+PM_BROWSER_MODULE_NEW_INFO_TEXT = 'Module name:'
+-- Language Name
+PM_BROWSER_MODULE_NEW_LANG_TITLE = 'Language Name'
+-- Language name:
+PM_BROWSER_MODULE_NEW_LANG_INFO_TEXT = 'Language name:'
+-- Error
+PM_BROWSER_MODULE_NEW_ERROR = 'Error'
+-- A module by that name already exists or you
+-- do not have permission to create the module.
+PM_BROWSER_MODULE_NEW_ERROR_TEXT = [[
+A module by that name already exists or you
+do not have permission to create the module.
+]]
+-- Delete Module?
+PM_BROWSER_MODULE_DELETE_TITLE = 'Delete Module?'
+-- Are you sure you want to permanently delete
+-- the "%s" module?
+PM_BROWSER_MODULE_DELETE_TEXT = [[
+Are you sure you want to permanently delete
+the "%s" module?
+]]
+
+-- core/ext/pm/project_browser.lua
+
+-- _New Project
+PM_BROWSER_PROJECT_NEW = '_New Project'
+-- _Open Project
+PM_BROWSER_PROJECT_OPEN = '_Open Project'
+-- _Close Project
+PM_BROWSER_PROJECT_CLOSE = '_Close Project'
+-- Add New File
+PM_BROWSER_PROJECT_NEW_FILE = 'Add New File'
+-- Add Existing Files
+PM_BROWSER_PROJECT_ADD_FILES = 'Add Existing Files'
+-- Add New Directory
+PM_BROWSER_PROJECT_NEW_DIR = 'Add New Directory'
+-- Add Existing Directory
+PM_BROWSER_PROJECT_ADD_DIR = 'Add Existing Directory'
+-- _Delete
+PM_BROWSER_PROJECT_DELETE_FILE = '_Delete'
+-- _Rename
+PM_BROWSER_PROJECT_RENAME_FILE = '_Rename'
+-- Save Project
+PM_BROWSER_PROJECT_NEW_TITLE = 'Save Project'
+-- Open Project
+PM_BROWSER_PROJECT_OPEN_TITLE = 'Open Project'
+-- Save File
+PM_BROWSER_PROJECT_NEW_FILE_TITLE = 'Save File'
+-- Add to Project Root Instead?
+PM_BROWSER_PROJECT_NEW_FILE_LIVE_FOLDER_TITLE = 'Add to Project Root Instead?'
+-- You are adding a new file to a live folder
+-- which may not show up if the filepaths do
+-- not match.
+-- Add the file to the project root instead?
+PM_BROWSER_PROJECT_NEW_FILE_LIVE_FOLDER_TEXT = [[
+You are adding a new file to a live folder
+which may not show up if the filepaths do
+not match.
+Add the file to the project root instead?
+]]
+-- Select Files
+PM_BROWSER_PROJECT_ADD_FILES_TITLE = 'Select Files'
+-- Select files to add to the project
+PM_BROWSER_PROJECT_ADD_FILES_TEXT = 'Select files to add to the project'
+-- Add to Project Root Instead?
+PM_BROWSER_PROJECT_ADD_FILES_LIVE_FOLDER_TITLE = 'Add to Project Root Instead?'
+-- You are adding existing files to a live
+-- folder which is not possible.
+-- Add them to the project root instead?
+PM_BROWSER_PROJECT_ADD_FILES_LIVE_FOLDER_TEXT = [[
+You are adding existing files to a live
+folder which is not possible.
+Add them to the project root instead?
+]]
+-- Directory Name?
+PM_BROWSER_PROJECT_NEW_DIR_TITLE = 'Directory Name?'
+-- Select Directory
+PM_BROWSER_PROJECT_ADD_DIR_TITLE = 'Select Directory'
+-- Select a directory to add to the project
+PM_BROWSER_PROJECT_ADD_DIR_TEXT = 'Select a directory to add to the project'
+-- Add to Project Root Instead?
+PM_BROWSER_PROJECT_ADD_DIR_LIVE_FOLDER_TITLE = 'Add to Project Root Instead?'
+-- You are adding an existing directory to
+-- a live folder which is not possible.
+-- Add it to the project root instead?
+PM_BROWSER_PROJECT_ADD_DIR_LIVE_FOLDER_TEXT = [[
+You are adding an existing directory to
+a live folder which is not possible.
+Add it to the project root instead?
+]]
+-- Keep on Disk?
+PM_BROWSER_PROJECT_DELETE_FILE_TITLE = 'Keep on Disk?'
+-- This file will be removed from the project.
+-- Leave it on your computer? If not, it will
+-- be permanently deleted.
+PM_BROWSER_PROJECT_DELETE_FILE_TEXT = [[
+This file will be removed from the project.
+Leave it on your computer? If not, it will
+be permanently deleted.
+]]
+-- Keep on Disk
+PM_BROWSER_PROJECT_DELETE_DIR_TITLE = 'Keep on Disk?'
+-- This directory will be removed from the
+-- project. Leave it on your computer? If
+-- not, it will be permanently deleted.
+PM_BROWSER_PROJECT_DELETE_DIR_TEXT = [[
+This directory will be removed from the
+project. Leave it on your computer? If
+not, it will be permanently deleted.
+]]
+-- Delete Permanently?
+PM_BROWSER_PROJECT_DELETE_LIVE_FILE_TITLE = 'Delete Permanently?'
+-- You have selected a file from a live folder
+-- to delete. It will be deleted PERMANENTLY.
+-- Continue?
+-- (To delete a live folder from the project,
+-- select the highest level live folder.)
+PM_BROWSER_PROJECT_DELETE_LIVE_FILE_TEXT = [[
+You have selected a file from a live folder
+to delete. It will be deleted PERMANENTLY.
+Continue?
+(To delete a live folder from the project,
+select the highest level live folder.)
+]]
+-- No
+PM_BROWSER_PROJECT_DELETE_LIVE_FILE_BUTTON1 = 'No'
+-- Yes
+PM_BROWSER_PROJECT_DELETE_LIVE_FILE_BUTTON2 = 'Yes'
+-- Cancel
+PM_BROWSER_PROJECT_DELETE_LIVE_FILE_BUTTON3 = 'Cancel'
+-- New Name?
+PM_BROWSER_PROJECT_RENAME_FILE_TEXT = 'New Name?'
+
+-- modules/textadept/bookmarks.lua
+
+-- modules/textadept/editing.lua
+
+-- Go To
+M_TEXTADEPT_EDITING_GOTO_TITLE = 'Go To'
+-- Line Number:
+M_TEXTADEPT_EDITING_GOTO_TEXT = 'Line Number:'
+
+-- modules/textadept/init.lua
+
+-- modules/textadept/macros.lua
+
+-- Macro recording
+M_TEXTADEPT_MACRO_RECORDING = 'Macro recording'
+-- Macro name?
+M_TEXTADEPT_MACRO_SAVE_TITLE = 'Macro name?'
+-- Macro name
+M_TEXTADEPT_MACRO_SAVE_TEXT = 'Macro name'
+-- Macro saved
+M_TEXTADEPT_MACRO_SAVED = 'Macro saved'
+-- Macro not saved
+M_TEXTADEPT_MACRO_NOT_SAVED = 'Macro not saved'
+-- Select a Macro
+M_TEXTADEPT_MACRO_SELECT_TITLE = 'Select a Macro'
+-- Macro name:
+M_TEXTADEPT_MACRO_SELECT_TEXT = 'Macro name:'
+
+-- modules/textadept/mlines.lua
+
+-- modules/textadept/snippets.lua
+
+-- Lexer %s
+-- Style %s (%d)
+M_TEXTADEPT_SNIPPETS_SHOW_STYLE = [[
+Lexer: %s
+Style: %s (%d)]]