diff options
-rw-r--r-- | core/.find.luadoc | 20 | ||||
-rw-r--r-- | core/locale.conf | 78 | ||||
-rw-r--r-- | modules/textadept/find.lua | 11 | ||||
-rw-r--r-- | src/textadept.c | 28 |
4 files changed, 98 insertions, 39 deletions
diff --git a/core/.find.luadoc b/core/.find.luadoc index b5e3dd99..7b7a474b 100644 --- a/core/.find.luadoc +++ b/core/.find.luadoc @@ -15,6 +15,26 @@ module('gui.find') -- * `whole_word` [bool]: Only whole-word matches are allowed in searches. -- * `lua` [bool]: The search text is interpreted as a Lua pattern. -- * `in_files` [bool]: Search for the text in a list of files. +-- * `find_label_text` [string]: The text of the 'Find' label. This is primarily +-- used for localization. (Write-only) +-- * `replace_label_text` [string]: The text of the 'Replace' label. This is +-- primarily used for localization. (Write-only) +-- * `find_next_button_text` [string]: The text of the 'Find Next' button. This +-- is primarily used for localization. (Write-only) +-- * `find_prev_button_text` [string]: The text of the 'Find Prev' button. This +-- is primarily used for localization. (Write-only) +-- * `replace_button_text` [string]: The text of the 'Replace' button. This is +-- primarily used for localization. (Write-only) +-- * `replace_all_button_text` [string]: The text of the 'Replace All' button. +-- This is primarily used for localization. (Write-only) +-- * `match_case_label_text` [string]: The text of the 'Match case' label. This +-- is primarily used for localization. (Write-only) +-- * `whole_word_label_text` [string]: The text of the 'Whole word' label. This +-- is primarily used for localization. (Write-only) +-- * `lua_pattern_label_text` [string]: The text of the 'Lua pattern' label. +-- This is primarily used for localization. (Write-only) +-- * `in_files_label_text` [string]: The text of the 'In files' label. This is +-- primarily used for localization. (Write-only) --- -- Displays and focuses the find/replace dialog. diff --git a/core/locale.conf b/core/locale.conf index f76aee58..78973277 100644 --- a/core/locale.conf +++ b/core/locale.conf @@ -16,19 +16,6 @@ % You can put the "_" anywhere applicable in your localized version. % core/events.lua -Untitled = Untitled -[Message Buffer] = [Message Buffer] -CRLF = CRLF -CR = CR -LF = LF -Tabs: = Tabs: -Spaces: = Spaces: -Line: = Line: -Col: = Col: -Quit without saving? = Quit without saving? -The following buffers are unsaved: = The following buffers are unsaved: -Quit _without saving = Quit _without saving -[Error Buffer] = [Error Buffer] Undefined event name = Undefined event name % core/file_io.lua @@ -46,27 +33,57 @@ has been modified. Reload it? = has been modified. Reload it? % core/gui.lua Buffer argument expected. = Buffer argument expected. This buffer is not the current one. = This buffer is not the current one. +[Message Buffer] = [Message Buffer] +Untitled = Untitled Switch Buffers = Switch Buffers -Search wrapped = Search wrapped +CRLF = CRLF +CR = CR +LF = LF +Tabs: = Tabs: +Spaces: = Spaces: +Line: = Line: +Col: = Col: +Quit without saving? = Quit without saving? +The following buffers are unsaved: = The following buffers are unsaved: +Quit _without saving = Quit _without saving +[Error Buffer] = [Error Buffer] % core/keys.lua Keychain: = Keychain: Invalid sequence = Invalid sequence -Unknown command: = Unknown command: + +% modules/textadept/bookmarks.lua +Select Bookmark = Select Bookmark + +% modules/textadept/editing.lua +Go To = Go To +Line Number: = Line Number: % modules/textadept/find.lua +_Find: = _Find: +R_eplace: = R_eplace: +Find _Next = Find _Next +Find _Prev = Find _Prev +_Replace = _Replace +Replace _All = Replace _All +_Match case = _Match case +_Whole word = _Whole word +_Lua pattern = _Lua pattern +_In files = _In files +Find in Files = Find in Files No results found = No results found +[Files Found Buffer] = [Files Found Buffer] +Search wrapped = Search wrapped Error = Error An error occured: = An error occured: replacement(s) made = replacement(s) made -Find in Files = Find in Files -[Files Found Buffer] = [Files Found Buffer] % modules/textadept/keys.lua Lexer = Lexer Style = Style % modules/textadept/menu.lua +Error loading webpage: = Error loading webpage: _File = _File gtk-new = gtk-new gtk-open = gtk-open @@ -76,7 +93,9 @@ gtk-save-as = gtk-save-as gtk-close = gtk-close Close A_ll = Close A_ll Loa_d Session... = Loa_d Session... +Load Session = Load Session Sa_ve Session... = Sa_ve Session... +Save Session = Save Session gtk-quit = gtk-quit _Edit = _Edit gtk-undo = gtk-undo @@ -105,7 +124,6 @@ _Single Quotes = _Single Quotes _Parentheses = _Parentheses _Brackets = _Brackets B_races = B_races -_Character Sequence = _Character Sequence _Grow = _Grow Select i_n... = Select i_n... _HTML Tag = _HTML Tag @@ -179,35 +197,19 @@ _Unsplit = _Unsplit Unsplit _All = Unsplit _All _Grow = _Grow _Shrink = _Shrink -Le_xers = Le_xers _Help = _Help _Manual = _Manual _LuaDoc = _LuaDoc gtk-about = gtk-about -Error loading webpage: = Error loading webpage: -Load Session = Load Session -Save Session = Save Session +Le_xers = Le_xers Unknown command: = Unknown command: % modules/textadept/mime_types.lua Select Lexer = Select Lexer -% modules/textadept/bookmarks.lua -Select Bookmark = Select Bookmark - -% modules/textadept/editing.lua -Go To = Go To -Line Number: = Line Number: - % modules/textadept/run.lua does not exist = does not exist -% modules/textadept/snippets.lua -Select Snippet = Select Snippet -Trigger = Trigger -Scope = Scope -Snippet Text = Snippet Text - % modules/textadept/session.lua Session Files Not Found = Session Files Not Found The following session files were not found = The following session files were not found @@ -216,3 +218,9 @@ The following session files were not found = The following session files were no File Limit Exceeded = File Limit Exceeded files or more were found. Showing the first = files or more were found. Showing the first File = File + +% modules/textadept/snippets.lua +Select Snippet = Select Snippet +Trigger = Trigger +Scope = Scope +Snippet Text = Snippet Text diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index a4298d67..a3723683 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -5,6 +5,17 @@ local events = events local find = gui.find local c = _SCINTILLA.constants +find.find_label_text = L('_Find:') +find.replace_label_text = L('R_eplace:') +find.find_next_button_text = L('Find _Next') +find.find_prev_button_text = L('Find _Prev') +find.replace_button_text = L('_Replace') +find.replace_all_button_text = L('Replace _All') +find.match_case_label_text = L('_Match case') +find.whole_word_label_text = L('_Whole word') +find.lua_pattern_label_text = L('_Lua pattern') +find.in_files_label_text = L('_In files') + local MARK_FIND = _SCINTILLA.next_marker_number() local MARK_FIND_COLOR = 0x4D9999 local previous_view diff --git a/src/textadept.c b/src/textadept.c index 7e70ce13..f8ab3758 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -97,7 +97,7 @@ static OSErr w_ae_quit(const AppleEvent *, AppleEvent *, long); // Find/Replace GtkWidget *findbox, *find_entry, *replace_entry, *fnext_button, *fprev_button, *r_button, *ra_button, *match_case_opt, *whole_word_opt, *lua_opt, - *in_files_opt; + *in_files_opt, *flabel, *rlabel; GtkWidget *find_create_ui(); GtkListStore *find_store, *repl_store; @@ -643,8 +643,8 @@ GtkWidget *find_create_ui() { find_store = gtk_list_store_new(1, G_TYPE_STRING); repl_store = gtk_list_store_new(1, G_TYPE_STRING); - GtkWidget *flabel = gtk_label_new_with_mnemonic("_Find:"); - GtkWidget *rlabel = gtk_label_new_with_mnemonic("R_eplace:"); + flabel = gtk_label_new_with_mnemonic("_Find:"); + rlabel = gtk_label_new_with_mnemonic("R_eplace:"); GtkWidget *find_combo = gtk_combo_box_entry_new_with_model( GTK_TREE_MODEL(find_store), 0); gtk_combo_box_entry_set_text_column(GTK_COMBO_BOX_ENTRY(find_combo), 0); @@ -668,7 +668,7 @@ GtkWidget *find_create_ui() { match_case_opt = gtk_check_button_new_with_mnemonic("_Match case"); whole_word_opt = gtk_check_button_new_with_mnemonic("_Whole word"); lua_opt = gtk_check_button_new_with_mnemonic("_Lua pattern"); - in_files_opt = gtk_check_button_new_with_mnemonic("_In Files"); + in_files_opt = gtk_check_button_new_with_mnemonic("_In files"); gtk_label_set_mnemonic_widget(GTK_LABEL(flabel), find_entry); gtk_label_set_mnemonic_widget(GTK_LABEL(rlabel), replace_entry); @@ -1819,6 +1819,26 @@ static int l_find_mt_newindex(lua_State *lua) { toggle(lua_opt, lua_toboolean(lua, -1) ? TRUE : FALSE); else if (streq(key, "in_files")) toggle(in_files_opt, lua_toboolean(lua, -1) ? TRUE : FALSE); + else if (streq(key, "find_label_text")) + gtk_label_set_text_with_mnemonic(GTK_LABEL(flabel), lua_tostring(lua, 3)); + else if (streq(key, "replace_label_text")) + gtk_label_set_text_with_mnemonic(GTK_LABEL(rlabel), lua_tostring(lua, 3)); + else if (streq(key, "find_next_button_text")) + gtk_button_set_label(GTK_BUTTON(fnext_button), lua_tostring(lua, 3)); + else if (streq(key, "find_prev_button_text")) + gtk_button_set_label(GTK_BUTTON(fprev_button), lua_tostring(lua, 3)); + else if (streq(key, "replace_button_text")) + gtk_button_set_label(GTK_BUTTON(r_button), lua_tostring(lua, 3)); + else if (streq(key, "replace_all_button_text")) + gtk_button_set_label(GTK_BUTTON(ra_button), lua_tostring(lua, 3)); + else if (streq(key, "match_case_label_text")) + gtk_button_set_label(GTK_BUTTON(match_case_opt), lua_tostring(lua, 3)); + else if (streq(key, "whole_word_label_text")) + gtk_button_set_label(GTK_BUTTON(whole_word_opt), lua_tostring(lua, 3)); + else if (streq(key, "lua_pattern_label_text")) + gtk_button_set_label(GTK_BUTTON(lua_opt), lua_tostring(lua, 3)); + else if (streq(key, "in_files_label_text")) + gtk_button_set_label(GTK_BUTTON(in_files_opt), lua_tostring(lua, 3)); else lua_rawset(lua, 1); return 0; |