diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/textadept/editing.lua | 6 | ||||
-rw-r--r-- | modules/textadept/lsnippets.lua | 3 | ||||
-rw-r--r-- | modules/textadept/macros.lua | 33 | ||||
-rw-r--r-- | modules/textadept/snippets.lua | 4 |
4 files changed, 25 insertions, 21 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 680bd452..04e9a1a1 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -234,11 +234,11 @@ end -- Goes to the requested line. -- @param line Optional line number to go to. function goto_line(line) - local buffer = buffer + local buffer, locale = buffer, textadept.locale if not line then line = cocoa_dialog( 'standard-inputbox', { - title = 'Go To', - text = 'Line Number:', + title = locale.M_TEXTADEPT_EDITING_GOTO_TITLE, + text = locale.M_TEXTADEPT_EDITING_GOTO_TEXT, ['no-newline'] = true } ) line = tonumber( line:match('%-?%d+$') ) diff --git a/modules/textadept/lsnippets.lua b/modules/textadept/lsnippets.lua index 825b143b..ad64c886 100644 --- a/modules/textadept/lsnippets.lua +++ b/modules/textadept/lsnippets.lua @@ -318,7 +318,8 @@ function show_style() local lexer = buffer:get_lexer_language() local style_num = buffer.style_at[buffer.current_pos] local style = buffer:get_style_name(style_num) - local text = 'Lexer: '..lexer..'\nStyle: '..style..' ('..style_num..')' + local text = string.format( + textadept.locale.M_TEXTADEPT_SNIPPETS_SHOW_STYLE, lexer, style, style_num ) buffer:call_tip_show(buffer.current_pos, text) end diff --git a/modules/textadept/macros.lua b/modules/textadept/macros.lua index 6bb59080..70be5ef4 100644 --- a/modules/textadept/macros.lua +++ b/modules/textadept/macros.lua @@ -39,7 +39,7 @@ local recording = false local function macro_notification(msg, wParam, lParam) if recording then current[#current + 1] = { msg, wParam or 0, lParam or 0 } - textadept.statusbar_text = 'Macro recording' + textadept.statusbar_text = textadept.locale.M_TEXTADEPT_MACRO_RECORDING end end textadept.events.add_handler('macro_record', macro_notification) @@ -63,10 +63,10 @@ function stop_recording() if not recording then return end buffer:stop_record() recording = false - local textadept = textadept + local textadept, locale = textadept, textadept.locale local ret, macro_name = cocoa_dialog( 'standard-inputbox', { - ['informative-text'] = 'Macro name?', - text = 'Macro name', + ['informative-text'] = locale.M_TEXTADEPT_MACRO_SAVE_TITLE, + text = locale.M_TEXTADEPT_MACRO_SAVE_TEXT, ['no-newline'] = true } ):match('^(%d)\n([^\n]+)$') @@ -79,10 +79,10 @@ function stop_recording() end list[macro_name] = current save() - textadept.statusbar_text = 'Macro saved' + textadept.statusbar_text = locale.M_TEXTADEPT_MACRO_SAVED textadept.events.handle('macro_saved') else - textadept.statusbar_text = 'Macro not saved' + textadept.statusbar_text = locale.M_TEXTADEPT_MACRO_NOT_SAVED end end @@ -98,17 +98,20 @@ end -- is prompted to choose one from a list of available macros. function play(macro_name) if not macro_name then + local locale = textadept.locale local macro_list = '' for name in pairs(list) do macro_list = macro_list..'"'..name..'"'..' ' end - local ret - ret, macro_name = cocoa_dialog( 'standard-dropdown', { - title = 'Select a Macro', - text = 'Macro name:', - items = macro_list, - ['string-output'] = true, - ['no-newline'] = true - } ):match('^([^\n]+)\n([^\n]+)$') - if ret == 'Cancel' then return end + if #macro_list > 0 then + local ret + ret, macro_name = cocoa_dialog( 'standard-dropdown', { + title = locale.M_TEXTADEPT_MACRO_SELECT_TITLE, + text = locale.M_TEXTADEPT_MACRO_SELECT_TEXT, + items = macro_list, + ['string-output'] = true, + ['no-newline'] = true + } ):match('^([^\n]+)\n([^\n]+)$') + if ret == 'Cancel' then return end + end end local macro = list[macro_name] if not macro then return end diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index ec4eb1cf..01e42986 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -355,8 +355,8 @@ function show_scope() local buffer = buffer local lexer = buffer:get_lexer_language() local scope = buffer.style_at[buffer.current_pos] - local text = 'Lexer: '..lexer..'\nScope: '.. - buffer:get_style_name(scope)..' ('..scope..')' + local text = string.format( + textadept.locale.M_TEXTADEPT_SNIPPETS_SHOW_STYLE, lexer, style, style_num ) buffer:call_tip_show(buffer.current_pos, text) end |