Standardize search/find to search (#7398)

* Change 'Find a file' to 'File search' for consistency

There is 'File search' in the Gesture manager already.
There is 'Fulltext search' in the readermenu.
Some help text added.
pull/7490/head
hius07 3 years ago committed by GitHub
parent 6d6760c2b3
commit 052e19ead5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,7 +84,7 @@ function FileSearcher:close()
else else
UIManager:show( UIManager:show(
InfoMessage:new{ InfoMessage:new{
text = BaseUtil.template(_("Found no files matching '%1'."), text = BaseUtil.template(_("No results for '%1'"),
self.search_value) self.search_value)
} }
) )
@ -97,7 +97,7 @@ function FileSearcher:onShowFileSearch()
local dummy = self.search_value local dummy = self.search_value
local enabled_search_home_dir = G_reader_settings:has("home_dir") local enabled_search_home_dir = G_reader_settings:has("home_dir")
self.search_dialog = InputDialog:new{ self.search_dialog = InputDialog:new{
title = _("Search for books by filename"), title = _("Enter filename to search for"),
input = self.search_value, input = self.search_value,
width = math.floor(Screen:getWidth() * 0.9), width = math.floor(Screen:getWidth() * 0.9),
buttons = { buttons = {
@ -162,7 +162,7 @@ function FileSearcher:showSearchResults()
UIManager:close(menu_container) UIManager:close(menu_container)
end end
table.sort(self.results, function(v1,v2) return v1.text < v2.text end) table.sort(self.results, function(v1,v2) return v1.text < v2.text end)
self.search_menu:switchItemTable(_("Search Results"), self.results) self.search_menu:switchItemTable(_("Search results"), self.results)
UIManager:show(menu_container) UIManager:show(menu_container)
end end

@ -641,7 +641,13 @@ To:
self.menu_items.find_file = { self.menu_items.find_file = {
-- @translators Search for files by name. -- @translators Search for files by name.
text = _("Find a file"), text = _("File search"),
help_text = _([[Search a book by filename in the current or home folder and its subfolders.
A search for '*' will show all files.
Search string supports Lua patterns.
Tap a book in the search results to open it.]]),
callback = function() callback = function()
self.ui:handleEvent(Event:new("ShowFileSearch")) self.ui:handleEvent(Event:new("ShowFileSearch"))
end end

@ -332,8 +332,7 @@ function ReaderDictionary:addToMainMenu(menu_items)
value_min = 8, value_min = 8,
value_max = 32, value_max = 32,
default_value = 20, default_value = 20,
ok_text = _("Set size"), title_text = _("Dictionary font size"),
title_text = _("Dictionary font size"),
callback = function(spin) callback = function(spin)
G_reader_settings:saveSetting("dict_font_size", spin.value) G_reader_settings:saveSetting("dict_font_size", spin.value)
if touchmenu_instance then touchmenu_instance:updateItems() end if touchmenu_instance then touchmenu_instance:updateItems() end
@ -679,7 +678,7 @@ end
function ReaderDictionary:onShowDictionaryLookup() function ReaderDictionary:onShowDictionaryLookup()
self.dictionary_lookup_dialog = InputDialog:new{ self.dictionary_lookup_dialog = InputDialog:new{
title = _("Enter a word to look up"), title = _("Enter a word or phrase to look up"),
input = "", input = "",
input_type = "text", input_type = "text",
buttons = { buttons = {
@ -798,7 +797,7 @@ function ReaderDictionary:startSdcv(word, dict_names, fuzzy_search)
{ {
dict = "", dict = "",
word = word, word = word,
definition = lookup_cancelled and _("Dictionary lookup interrupted.") or _("No definition found."), definition = lookup_cancelled and _("Dictionary lookup interrupted.") or _("No results."),
no_result = true, no_result = true,
lookup_cancelled = lookup_cancelled, lookup_cancelled = lookup_cancelled,
} }

@ -37,7 +37,7 @@ end
function ReaderWikipedia:lookupInput() function ReaderWikipedia:lookupInput()
self.input_dialog = InputDialog:new{ self.input_dialog = InputDialog:new{
title = _("Enter words to look up on Wikipedia"), title = _("Enter a word or phrase to look up"),
input = "", input = "",
input_type = "text", input_type = "text",
buttons = { buttons = {
@ -249,7 +249,7 @@ function ReaderWikipedia:addToMainMenu(menu_items)
local text = _([[ local text = _([[
Wikipedia articles can be saved as an EPUB for more comfortable reading. Wikipedia articles can be saved as an EPUB for more comfortable reading.
You can select an existing directory, or use a default directory named "Wikipedia" in your reader's home folder. You can select an existing folder, or use a default folder named "Wikipedia" in your reader's home folder.
Where do you want them saved?]]) Where do you want them saved?]])
UIManager:show(ConfirmBox:new{ UIManager:show(ConfirmBox:new{
@ -442,7 +442,7 @@ function ReaderWikipedia:lookupWikipedia(word, is_sane, box, get_fullpage, force
else else
self.lookup_msg = T(_("Searching Wikipedia %2 for:\n%1"), "%1", lang:upper()) self.lookup_msg = T(_("Searching Wikipedia %2 for:\n%1"), "%1", lang:upper())
req_failure_text = _("Failed searching Wikipedia.") req_failure_text = _("Failed searching Wikipedia.")
no_result_text = _("No Wikipedia articles matching search term.") no_result_text = _("No results.")
end end
self:showLookupInfo(display_word) self:showLookupInfo(display_word)

@ -1206,7 +1206,7 @@ end
function DictQuickLookup:lookupInputWord(hint) function DictQuickLookup:lookupInputWord(hint)
self.input_dialog = InputDialog:new{ self.input_dialog = InputDialog:new{
title = _("Input lookup word"), title = _("Enter a word or phrase to look up"),
input = hint, input = hint,
input_hint = hint or "", input_hint = hint or "",
input_type = "text", input_type = "text",
@ -1219,7 +1219,7 @@ function DictQuickLookup:lookupInputWord(hint)
end, end,
}, },
{ {
text = _("Lookup"), text = self.is_wiki and _("Search Wikipedia") or _("Search dictionary"),
is_enter_default = true, is_enter_default = true,
callback = function() callback = function()
self:closeInputDialog() self:closeInputDialog()

@ -59,7 +59,7 @@ function Calibre:closeWirelessConnection()
end end
function Calibre:onDispatcherRegisterActions() function Calibre:onDispatcherRegisterActions()
Dispatcher:registerAction("calibre_search", { category="none", event="CalibreSearch", title=_("Search in calibre metadata"), device=true,}) Dispatcher:registerAction("calibre_search", { category="none", event="CalibreSearch", title=_("Calibre metadata search"), device=true,})
Dispatcher:registerAction("calibre_browse_tags", { category="none", event="CalibreBrowseTags", title=_("Browse all calibre tags"), device=true,}) Dispatcher:registerAction("calibre_browse_tags", { category="none", event="CalibreBrowseTags", title=_("Browse all calibre tags"), device=true,})
Dispatcher:registerAction("calibre_browse_series", { category="none", event="CalibreBrowseSeries", title=_("Browse all calibre series"), device=true, separator=true,}) Dispatcher:registerAction("calibre_browse_series", { category="none", event="CalibreBrowseSeries", title=_("Browse all calibre series"), device=true, separator=true,})
end end
@ -109,7 +109,7 @@ function Calibre:addToMainMenu(menu_items)
-- insert the metadata search -- insert the metadata search
if G_reader_settings:isTrue("calibre_search_from_reader") or not self.ui.view then if G_reader_settings:isTrue("calibre_search_from_reader") or not self.ui.view then
menu_items.find_book_in_calibre_catalog = { menu_items.find_book_in_calibre_catalog = {
text = _("Find a book via calibre metadata"), text = _("Calibre metadata search"),
callback = function() callback = function()
CalibreSearch:ShowSearch() CalibreSearch:ShowSearch()
end end

@ -180,7 +180,7 @@ local CalibreSearch = InputContainer:new{
function CalibreSearch:ShowSearch() function CalibreSearch:ShowSearch()
self.search_dialog = InputDialog:new{ self.search_dialog = InputDialog:new{
title = _("Search books"), title = _("Calibre metadata search"),
input = self.search_value, input = self.search_value,
buttons = { buttons = {
{ {
@ -214,7 +214,7 @@ function CalibreSearch:ShowSearch()
}, },
{ {
-- @translators Search for books in calibre Library, via on-device metadata (as setup by Calibre's 'Send To Device'). -- @translators Search for books in calibre Library, via on-device metadata (as setup by Calibre's 'Send To Device').
text = _("Find books"), text = _("Search books"),
enabled = true, enabled = true,
callback = function() callback = function()
self.search_value = self.search_dialog:getInputText() self.search_value = self.search_dialog:getInputText()
@ -318,7 +318,7 @@ function CalibreSearch:find(option)
-- this shouldn't happen unless the user disabled all libraries or they are empty. -- this shouldn't happen unless the user disabled all libraries or they are empty.
if #self.books == 0 then if #self.books == 0 then
logger.warn("no metadata to search, aborting") logger.warn("no metadata to search, aborting")
self:prompt(_("No metadata found")) self:prompt(_("No results in metadata"))
return return
end end
@ -438,7 +438,7 @@ end
-- show search results -- show search results
function CalibreSearch:showresults(t, title) function CalibreSearch:showresults(t, title)
if not title then if not title then
title = _("Search Results") title = _("Search results")
end end
local menu_container = CenterContainer:new{ local menu_container = CenterContainer:new{
dimen = Screen:getSize(), dimen = Screen:getSize(),

@ -705,7 +705,6 @@ function OPDSBrowser:browseSearchable(browse_url, username, password)
self.search_server_dialog = InputDialog:new{ self.search_server_dialog = InputDialog:new{
title = _("Search OPDS catalog"), title = _("Search OPDS catalog"),
input = "", input = "",
hint = _("Search string"),
-- @translators: This is an input hint for something to search for in an OPDS catalog, namely a famous author everyone knows. It probably doesn't need to be localized, but this is just here in case another name or book title would be more appropriate outside of a European context. -- @translators: This is an input hint for something to search for in an OPDS catalog, namely a famous author everyone knows. It probably doesn't need to be localized, but this is just here in case another name or book title would be more appropriate outside of a European context.
input_hint = _("Alexandre Dumas"), input_hint = _("Alexandre Dumas"),
input_type = "string", input_type = "string",
@ -783,7 +782,7 @@ function OPDSBrowser:editOPDSServer(item)
fields = { fields = {
{ {
text = item.text or "", text = item.text or "",
hint = _("Catalog Name"), hint = _("Catalog name"),
}, },
{ {
text = item.url or "", text = item.url or "",

Loading…
Cancel
Save