diff --git a/doc/Building_targets.md b/doc/Building_targets.md index 954f70bbc408..04209ae294e2 100644 --- a/doc/Building_targets.md +++ b/doc/Building_targets.md @@ -6,7 +6,7 @@ These instructions are intended for a Linux OS. MacOS and Windows users are sugg ## Prerequisites -This instructions asume that you [have a development environment ready to run](Building.md) KOReader. If not then please install common prerequisites first. +This instructions assume that you [have a development environment ready to run](Building.md) KOReader. If not then please install common prerequisites first. ### A toolchain for your target. diff --git a/doc/Collaborating_with_Git.md b/doc/Collaborating_with_Git.md index 0ee05dd8c8c3..9ecbfe0f253b 100644 --- a/doc/Collaborating_with_Git.md +++ b/doc/Collaborating_with_Git.md @@ -90,7 +90,7 @@ integrate changes from this issue (or diff, patch, git cherry-pick sha-commit) ``` dpavlin$ git add -p unireader.lua ``` -interactivly select just changes which are not whitespace +interactively select just changes which are not whitespace ``` dpavlin$ git commit --author NuPogodi -m 'TOC position on current place in the tree #235' diff --git a/doc/DataStore.md b/doc/DataStore.md index 337b96f05df4..e77b9ad4124e 100644 --- a/doc/DataStore.md +++ b/doc/DataStore.md @@ -62,7 +62,7 @@ print(total_time) --> 50 conn:close() -- Do not forget to close stmt after you are done ``` -For more information on supported SQL quries, check out [SQLite3's official +For more information on supported SQL queries, check out [SQLite3's official documentation][sq3-doc]. diff --git a/doc/Porting.md b/doc/Porting.md index 61f1617c1d61..b8ac51f26869 100644 --- a/doc/Porting.md +++ b/doc/Porting.md @@ -21,7 +21,7 @@ At 16bpp, we assume the pixel format is RGB565. For obvious performance reasons, we prefer 8bpp, and we will attempt to enforce that on devices which are not natively running at that depth (i.e., [on Kobos](https://github.com/koreader/koreader/blob/d1cd5e7ad4283611c57007b2c2d3dd5f7dab7057/platform/kobo/koreader.sh#L138-L186)). As explained below, the same considerations should be kept in mind regarding the effective 16c palette of eInk screens. When we're in control of the data, we attempt to always use "perfect" in-palette colors (c.f., the [COLOR constants](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/blitbuffer.lua#L1881-L1889) in the BlitBuffer module). -Otherwise, when there'd be signficiant gain in doing so (i.e., when displaying mainly image content), we attempt to make use of [dithering](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/blitbuffer.lua#L227-L271), ideally [offloaded to the hardware](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/framebuffer_mxcfb.lua#L412-L423) when supported. +Otherwise, when there'd be significant gain in doing so (i.e., when displaying mainly image content), we attempt to make use of [dithering](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/blitbuffer.lua#L227-L271), ideally [offloaded to the hardware](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/framebuffer_mxcfb.lua#L412-L423) when supported. The actual framebuffer content is then refreshed (i.e., displayed) via device-specific ioctls, making the best effort in using device-specific capabilities, whether that be [optimized waveform modes](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/framebuffer_mxcfb.lua#L643-L655), hardware dithering or [hardware inversion](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/framebuffer_mxcfb.lua#L253-L256). @@ -50,7 +50,7 @@ Following are the framebuffers that `framebuffer_einkfb.lua` currently supports: For 4bpp framebuffers, it means every pixel is represented with 4 bits, so we have 2 pixels in 1 byte. That also effectively limits the palette to 16 colors. The inverted part means that every pixel's color value is flipped (`^ 0xFF`). -For example, two pixels `0x00` and `0xF0` will be flipped to `0xFF` and `0x0F`, before being packed to accomodate the framebuffer's pixel format (here, [into a single byte](https://github.com/NiLuJe/FBInk/blob/4f0230b17c480cdc75dd5497fddf33937781c812/fbink.c#L106-L133)). +For example, two pixels `0x00` and `0xF0` will be flipped to `0xFF` and `0x0F`, before being packed to accommodate the framebuffer's pixel format (here, [into a single byte](https://github.com/NiLuJe/FBInk/blob/4f0230b17c480cdc75dd5497fddf33937781c812/fbink.c#L106-L133)). For 8bpp framebuffers, it means each pixel is instead stored in 1 byte, making addressing much simpler. The effective color palette of the display is still limited to 16 shades of gray: it will do a decimating quantization pass on its own on refresh. @@ -83,7 +83,7 @@ Next, you might need to define `Input:eventAdjustHook()` function in `Input:init We use this hook function to translate events into a format that KOReader understands. You can look at the KindleTouch initialization code for a real-world example. -For some Kobo devices (Mini, Touch, Glo and Aura HD) the function `Input:eventAdjustHook()` was skipped and the functions `Input:init()` and `Input:handleTypeBTouchEv()` were changed to accomodate for the single touch protocol. +For some Kobo devices (Mini, Touch, Glo and Aura HD) the function `Input:eventAdjustHook()` was skipped and the functions `Input:init()` and `Input:handleTypeBTouchEv()` were changed to accommodate for the single touch protocol. For the Kobo Aura (and others with the same kernel quirks) with multitouch support, an extra function `Input:handlePhoenixTouchEv()` was added. Linux supports two kinds of Multi-touch protocols: diff --git a/frontend/apps/filemanager/filemanagermenu.lua b/frontend/apps/filemanager/filemanagermenu.lua index a37b37ef0c58..a404f643f6a6 100644 --- a/frontend/apps/filemanager/filemanagermenu.lua +++ b/frontend/apps/filemanager/filemanagermenu.lua @@ -508,7 +508,7 @@ To: FFIUtil.purgeDir(cachedir) end lfs.mkdir(cachedir) - -- Also remove from the Cache objet references to the cache files we've just deleted + -- Also remove from the Cache object references to the cache files we've just deleted local Cache = require("cache") Cache.cached = {} UIManager:askForRestart(_("Caches cleared. Please restart KOReader.")) diff --git a/frontend/apps/filemanager/filemanagersetdefaults.lua b/frontend/apps/filemanager/filemanagersetdefaults.lua index 8197736e0394..a28d58fc37bc 100644 --- a/frontend/apps/filemanager/filemanagersetdefaults.lua +++ b/frontend/apps/filemanager/filemanagersetdefaults.lua @@ -68,7 +68,7 @@ function SetDefaultsWidget:init() end end - -- Prepare our menu entires + -- Prepare our menu entries self.menu_entries = {} local set_dialog diff --git a/frontend/apps/reader/modules/readercropping.lua b/frontend/apps/reader/modules/readercropping.lua index b7a50b8ffe00..9596d41956ac 100644 --- a/frontend/apps/reader/modules/readercropping.lua +++ b/frontend/apps/reader/modules/readercropping.lua @@ -103,7 +103,7 @@ function ReaderCropping:onPageCrop(mode) self.crop_dialog = VerticalGroup:new{ align = "left", self.bbox_widget, - (Device:isTouchDevice() and button_container) or nil, -- button bar only availble for touch devices + (Device:isTouchDevice() and button_container) or nil, -- button bar only available for touch devices } UIManager:show(self.crop_dialog) return true diff --git a/frontend/apps/reader/modules/readerdictionary.lua b/frontend/apps/reader/modules/readerdictionary.lua index d550d360d86f..9f8a5cf2e3b2 100644 --- a/frontend/apps/reader/modules/readerdictionary.lua +++ b/frontend/apps/reader/modules/readerdictionary.lua @@ -114,7 +114,7 @@ function ReaderDictionary:init() os.getenv("STARDICT_DATA_DIR") or DataStorage:getDataDir() .. "/data/dict" - -- Show the "Seaching..." InfoMessage after this delay + -- Show the "Searching..." InfoMessage after this delay self.lookup_msg_delay = 0.5 -- Allow quick interruption or dismiss of search result window -- with tap if done before this delay. After this delay, the @@ -649,7 +649,7 @@ local function tidyMarkup(results) if ok then result.definition = fixed_definition else - logger.warn("Dict's user provided funcion failed:", fixed_definition) + logger.warn("Dict's user provided function failed:", fixed_definition) end end else @@ -813,7 +813,7 @@ function ReaderDictionary:rawSdcv(words, dict_names, fuzzy_search, lookup_progre -- and a really bad selected text, can take up to 10 seconds. -- It is nice to be able to cancel it when noticing wrong text was -- selected. - -- Because sdcv starts outputing its output only at the end when it has + -- Because sdcv starts outputting its output only at the end when it has -- done its work, we can use Trapper:dismissablePopen() to cancel it as -- long as we are waiting for output. -- When fuzzy search is enabled, we have a lookup_progress_msg that can diff --git a/frontend/apps/reader/modules/readerfont.lua b/frontend/apps/reader/modules/readerfont.lua index c2524537d26e..592c6ef7ce88 100644 --- a/frontend/apps/reader/modules/readerfont.lua +++ b/frontend/apps/reader/modules/readerfont.lua @@ -427,7 +427,7 @@ function ReaderFont:updateFontFamilyFonts() -- font (we have here in self.font_face) because of its increased bias (or the -- monospace font we also added with bias). -- So, we don't need to insert self.font_face in the list for unset family fonts, - -- which would otherwise need us to call updateFontFamilyFonts() everytime we + -- which would otherwise need us to call updateFontFamilyFonts() every time we -- change the main font face. local g_font_family_fonts = G_reader_settings:readSetting("cre_font_family_fonts", {}) local family_fonts = {} @@ -745,7 +745,7 @@ If that font happens to be part of this list already, it will be used first.]]), self.ui:handleEvent(Event:new("UpdatePos")) end, help_text = _([[ -Adjust the size of each fallback font so they all get the same x-height, and lowercase characters picked in them look similarly sized as those from the defaut font. +Adjust the size of each fallback font so they all get the same x-height, and lowercase characters picked in them look similarly sized as those from the default font. This may help with Greek words among Latin text (as Latin fonts often do not have all the Greek characters), but may make Chinese or Indic characters smaller when picked from fallback fonts.]]), separator = true, }) diff --git a/frontend/apps/reader/modules/readerhandmade.lua b/frontend/apps/reader/modules/readerhandmade.lua index bd46757a4a05..f8377c99696f 100644 --- a/frontend/apps/reader/modules/readerhandmade.lua +++ b/frontend/apps/reader/modules/readerhandmade.lua @@ -258,7 +258,7 @@ Hidden flows are shown with gray or hatched background in Book map and Page brow self:updateDocFlows() self.ui:handleEvent(Event:new("UpdateToc")) self.ui:handleEvent(Event:new("InitScrollPageStates")) - -- The footer may be visible, so have it update its dependant items + -- The footer may be visible, so have it update its dependent items self.view.footer:onUpdateFooter(self.view.footer_visible) self.ui.annotation:setNeedsUpdateFlag() if touchmenu_instance then @@ -282,7 +282,7 @@ Hidden flows are shown with gray or hatched background in Book map and Page brow self:updateDocFlows() self.ui:handleEvent(Event:new("UpdateToc")) self.ui:handleEvent(Event:new("InitScrollPageStates")) - -- The footer may be visible, so have it update its dependant items + -- The footer may be visible, so have it update its dependent items self.view.footer:onUpdateFooter(self.view.footer_visible) self.ui.annotation:setNeedsUpdateFlag() if touchmenu_instance then @@ -326,7 +326,7 @@ function ReaderHandMade:onReaderReady() -- and it may fillToc(). So, it may happen that the expensive validateAndFixToc() -- is called twice (first with the original ToC, then with ours). -- - ReaderRolling will have its onReaderReady() called after ours, and if we - -- have set up hidden flows, we'll have overriden some documents methods so + -- have set up hidden flows, we'll have overridden some documents methods so -- its cacheFlows() is a no-op. self:updateHandmagePages() -- Don't have each of these send their own events: we'll send them once afterwards @@ -358,7 +358,7 @@ function ReaderHandMade:setupToc(no_event) -- If enabled, plug one method into the document object, -- so it is used instead of the method from its class. self.document.getToc = function(this) - -- ReaderToc may add fieds to ToC items: return a copy, + -- ReaderToc may add fields to ToC items: return a copy, -- so the one we will save doesn't get polluted. return util.tableDeepCopy(self.toc) end diff --git a/frontend/apps/reader/modules/readerkoptlistener.lua b/frontend/apps/reader/modules/readerkoptlistener.lua index 455c5d7c4b18..6afac570cea7 100644 --- a/frontend/apps/reader/modules/readerkoptlistener.lua +++ b/frontend/apps/reader/modules/readerkoptlistener.lua @@ -23,7 +23,7 @@ function ReaderKoptListener:onReadSettings(config) self:setZoomMode(normal_zoom_mode) self.ui:handleEvent(Event:new("GammaUpdate", self.document.configurable.contrast, true)) -- no notification -- since K2pdfopt v2.21 negative value of word spacing is also used, for config - -- compatability we should manually change previous -1 to a more reasonable -0.2 + -- compatibility we should manually change previous -1 to a more reasonable -0.2 if self.document.configurable.word_spacing == -1 then self.document.configurable.word_spacing = -0.2 end diff --git a/frontend/apps/reader/modules/readerlink.lua b/frontend/apps/reader/modules/readerlink.lua index c3a65f753c53..5477257ad463 100644 --- a/frontend/apps/reader/modules/readerlink.lua +++ b/frontend/apps/reader/modules/readerlink.lua @@ -694,7 +694,7 @@ function ReaderLink:onTap(_, ges) -- -- 30px on a reference 167 dpi screen makes 0.45cm, which -- seems fine (on a 300dpi device, this will be scaled - -- to 54px (which makes 1/20th of screen witdh on a GloHD) + -- to 54px (which makes 1/20th of screen width on a GloHD) -- Trust Screen.dpi (which may not be the real device -- screen DPI if the user has set another one). max_distance = Screen:scaleByDPI(30) @@ -1292,7 +1292,7 @@ function ReaderLink:onGoToLatestBookmark(ges) if latest_bookmark then if self.ui.paging then -- self:onGotoLink() needs something with a page attribute. - -- we need to substract 1 to bookmark page, as links start from 0 + -- we need to subtract 1 to bookmark page, as links start from 0 -- and onGotoLink will add 1 - we need a fake_link (with a single -- page attribute) so we don't touch the bookmark itself local fake_link = {} @@ -1355,7 +1355,7 @@ function ReaderLink:showAsFootnotePopup(link, neglect_current_location) flags = flags + 0x0002 end -- Checks for private CSS properties "-cr-hint: footnote/noteref/..." are - -- always done (they can be applied to specific elements or classe names + -- always done (they can be applied to specific elements or class names -- with Styles tweaks.) -- Trust role= and epub:type= attribute values if defined, for source(*) and target diff --git a/frontend/apps/reader/modules/readerpagemap.lua b/frontend/apps/reader/modules/readerpagemap.lua index 19b3a5c02694..ed375977b7be 100644 --- a/frontend/apps/reader/modules/readerpagemap.lua +++ b/frontend/apps/reader/modules/readerpagemap.lua @@ -248,7 +248,7 @@ function ReaderPageMap:onShowPageList() pl_menu, } - -- buid up menu widget method as closure + -- build up menu widget method as closure local pagemap = self function pl_menu:onMenuChoice(item) pagemap.ui.link:addCurrentLocationToStack() @@ -274,7 +274,7 @@ end function ReaderPageMap:getCurrentPageLabel(clean_label) -- Note: in scroll mode with PDF, when multiple pages are shown on - -- the screen, the advertized page number is the greatest page number + -- the screen, the advertised page number is the greatest page number -- among the pages shown (so, the page number of the partial page -- shown at bottom of screen). -- For consistency, getPageMapCurrentPageLabel() returns the last page diff --git a/frontend/apps/reader/modules/readerpaging.lua b/frontend/apps/reader/modules/readerpaging.lua index a80ebc413189..9a6ed76de3ee 100644 --- a/frontend/apps/reader/modules/readerpaging.lua +++ b/frontend/apps/reader/modules/readerpaging.lua @@ -662,7 +662,7 @@ function ReaderPaging:onInitScrollPageStates(orig_mode) blank_area:setSizeTo(self.view.visible_area) while blank_area.h > 0 do local offset = Geom:new() - -- caculate position in current page + -- calculate position in current page if self.current_page == self.orig_page then local page_area = self.view:getPageArea( self.view.state.page, diff --git a/frontend/apps/reader/modules/readerrolling.lua b/frontend/apps/reader/modules/readerrolling.lua index 70d1e4aa15a6..9f9a0cd48603 100644 --- a/frontend/apps/reader/modules/readerrolling.lua +++ b/frontend/apps/reader/modules/readerrolling.lua @@ -95,7 +95,7 @@ function ReaderRolling:init() -- We loaded from a valid cache file: remember its hash. It may allow not -- having to do any background rerendering if the user somehow reverted -- some setting changes before any background rerendering had completed - -- (ie. with autorotation, transitionning from portrait to landscape for + -- (ie. with autorotation, transitioning from portrait to landscape for -- a few seconds, to then end up back in portrait). self.valid_cache_rendering_hash = self.ui.document:getDocumentRenderingHash(false) end @@ -841,7 +841,7 @@ function ReaderRolling:onGotoXPointer(xp, marker_xp) -- rectangle to unmark it; but it might not always be just white -- margin: when we're in dual page mode and crengine has drawn a -- vertical pages separator - or if we have had crengine draw - -- some backgroud texture with credocument:setBackgroundImage(). + -- some background texture with credocument:setBackgroundImage(). if self.mark_orig_content_bb then -- be sure we don't leak memory if a previous one is still -- hanging around @@ -1148,7 +1148,7 @@ function ReaderRolling:_gotoPos(new_pos, do_dim_area) self.ui:handleEvent(Event:new("PageChangeAnimation", new_pos > self.current_pos)) end self.ui.document:gotoPos(new_pos) - -- The current page we get in scroll mode may be a bit innacurate, + -- The current page we get in scroll mode may be a bit inaccurate, -- but we give it anyway to onPosUpdate so footer and statistics can -- keep up with page. self.current_page = self.ui.document:getCurrentPage() @@ -1241,7 +1241,7 @@ function ReaderRolling:onSetStatusLine(status_line) self.cre_top_bar_enabled = status_line == 0 -- (We used to toggle the footer when toggling the top status bar, -- but people seem to like having them both, and it feels more - -- practicable to have the independant.) + -- practicable to have the independent.) self:onUpdatePos() end @@ -1681,7 +1681,7 @@ function ReaderRolling:handlePartialRerendering() end function ReaderRolling:_waitOrKillCurrentRerenderingSubprocess(wait, kill) - -- No need for an asynchronous collector: we'll explicitely call this and wait + -- No need for an asynchronous collector: we'll explicitly call this and wait -- before going on, even when reloading, to avoid having multiple possibly huge -- subprocesses at the same time. -- Returns true if the process is no longer running. @@ -1913,7 +1913,7 @@ function ReaderRolling:_rerenderInBackground() -- (which happens when CSS properties "display:" and "white-space:" have changed for some nodes, which -- is rather rare with our style tweaks) here, and do the reload and rerendering in this same background -- subprocess, and doing this would hide this whole thing from the user, making the UX seamless. - -- But this would need a lot more memory, as we would then have 2 independant DOM in memory. + -- But this would need a lot more memory, as we would then have 2 independent DOM in memory. -- Ie. with a big book and KOReader taking 120 MB, the subprocess would additionally use: -- - 60 MB when doing a simple rerendering -- - 130 MB when doing a full load+render diff --git a/frontend/apps/reader/modules/readerscrolling.lua b/frontend/apps/reader/modules/readerscrolling.lua index e394399abee2..8d8adcfe4056 100644 --- a/frontend/apps/reader/modules/readerscrolling.lua +++ b/frontend/apps/reader/modules/readerscrolling.lua @@ -9,7 +9,7 @@ local C_ = _.pgettext local T = require("ffi/util").template local Screen = Device.screen --- This module exposes Scrolling settings, and additionnally +-- This module exposes Scrolling settings, and additionally -- handles inertial scrolling on non-eInk devices. local SCROLL_METHOD_CLASSIC = "classic" @@ -55,7 +55,7 @@ function ReaderScrolling:init() -- The different scrolling methods are handled directly by readerpaging/readerrolling self.scroll_method = G_reader_settings:readSetting("scroll_method") - -- Keep inertial scrolling available on the emulator (which advertizes itself as eInk) + -- Keep inertial scrolling available on the emulator (which advertises itself as eInk) if not Device:hasEinkScreen() or Device:isEmulator() then self._inertial_scroll_supported = true end diff --git a/frontend/apps/reader/modules/readersearch.lua b/frontend/apps/reader/modules/readersearch.lua index 61a7646d5f95..cf9543b459a8 100644 --- a/frontend/apps/reader/modules/readersearch.lua +++ b/frontend/apps/reader/modules/readersearch.lua @@ -352,7 +352,7 @@ function ReaderSearch:onShowSearchDialog(text, direction, regex, case_insensitiv -- that are on previous/next page of the page we should show. And -- sometimes even xpointers that resolve to no page. -- We need to loop thru all the results until we find one suitable, - -- to follow its link and go to the next/prev page with occurences. + -- to follow its link and go to the next/prev page with occurrences. local valid_link -- If backward search, results are already in a reversed order, so we'll -- start from the nearest to current page one. @@ -367,7 +367,7 @@ function ReaderSearch:onShowSearchDialog(text, direction, regex, case_insensitiv logger.dbg("res.end page & xpointer:", r_end_page, r_end) local bounds = {} if self._expect_back_results then - -- Process end of occurence first, which is nearest to current page + -- Process end of occurrence first, which is nearest to current page table.insert(bounds, {r_end, r_end_page}) table.insert(bounds, {r_start, r_start_page}) else diff --git a/frontend/apps/reader/modules/readerstyletweak.lua b/frontend/apps/reader/modules/readerstyletweak.lua index 0fbc6fac533f..88196a76b1eb 100644 --- a/frontend/apps/reader/modules/readerstyletweak.lua +++ b/frontend/apps/reader/modules/readerstyletweak.lua @@ -228,7 +228,7 @@ function TweakInfoWidget:onSelect() return true end --- Ordering function for tweaks when appened to css_test. +-- Ordering function for tweaks when appended to css_test. -- The order needs to be consistent for crengine's stylesheet change -- detection code to not invalidate cache across loadings. local function tweakOrdering(l, r) @@ -399,7 +399,7 @@ function ReaderStyleTweak:updateCssText(apply) end -- We could store what's been read into tweak.css to avoid -- re-reading it, but this will allow a user to experiment - -- wihout having to restart KOReader + -- without having to restart KOReader end css = util.trim(css) table.insert(css_snippets, css) @@ -718,7 +718,7 @@ function ReaderStyleTweak:onToggleStyleTweak(tweak_id, item, no_notification) local enabled, g_enabled = self:isTweakEnabled(tweak_id) if enabled then if g_enabled then - -- if globaly enabled, mark it as disabled + -- if globally enabled, mark it as disabled -- for this document only self.doc_tweaks[tweak_id] = false else diff --git a/frontend/apps/reader/modules/readerthumbnail.lua b/frontend/apps/reader/modules/readerthumbnail.lua index a55acd96e5d6..3ed19b1c8456 100644 --- a/frontend/apps/reader/modules/readerthumbnail.lua +++ b/frontend/apps/reader/modules/readerthumbnail.lua @@ -514,7 +514,7 @@ function ReaderThumbnail:_getPageImage(page) self.ui.bookmark:onPageUpdate(page) -- Update dogear state for this page end - -- Draw the page on a new BB with the targetted size + -- Draw the page on a new BB with the targeted size local bb = Blitbuffer.new(target_w, target_h, self.bb_type) self.ui.view:paintTo(bb, 0, 0) diff --git a/frontend/apps/reader/modules/readertoc.lua b/frontend/apps/reader/modules/readertoc.lua index 954992d1b864..77316fb69526 100644 --- a/frontend/apps/reader/modules/readertoc.lua +++ b/frontend/apps/reader/modules/readertoc.lua @@ -183,7 +183,7 @@ function ReaderToc:validateAndFixToc() local first = 1 local last = #toc - -- For testing: shuffle a bit a valid TOC and make it randomely invalid + -- For testing: shuffle a bit a valid TOC and make it randomly invalid -- for i = first, last do -- toc[i].page = toc[i].page + math.random(10) - 5 -- end @@ -783,7 +783,7 @@ function ReaderToc:onShowToc() end -- Estimate expand/collapse icon size - -- *2/5 to acount for Menu top title and bottom icons, and add some space between consecutive icons + -- *2/5 to account for Menu top title and bottom icons, and add some space between consecutive icons local icon_size = math.floor(Screen:getHeight() / items_per_page * 2/5) local button_width = icon_size * 2 self.expand_button = Button:new{ diff --git a/frontend/apps/reader/modules/readertypeset.lua b/frontend/apps/reader/modules/readertypeset.lua index 33dfc0716d6f..66928c93da3f 100644 --- a/frontend/apps/reader/modules/readertypeset.lua +++ b/frontend/apps/reader/modules/readertypeset.lua @@ -155,7 +155,7 @@ function ReaderTypeset:onSetRenderDPI(dpi) end -- June 2018: epub.css has been cleaned to be more conforming to HTML specs --- and to not include class name based styles (with conditional compatiblity +-- and to not include class name based styles (with conditional compatibility -- styles for previously opened documents). It should be usable on all -- HTML based documents, except FB2 which has some incompatible specs. -- These other css files have not been updated in the same way, and are diff --git a/frontend/apps/reader/modules/readertypography.lua b/frontend/apps/reader/modules/readertypography.lua index 8d0c99ab2f1a..ad2fe7235ce0 100644 --- a/frontend/apps/reader/modules/readertypography.lua +++ b/frontend/apps/reader/modules/readertypography.lua @@ -151,7 +151,7 @@ When the book's language tag is not among our presets, no specific features will hold_callback = function() -- Show infos about TextLangMan seen lang_tags and loaded hyph dicts local lang_infos = {} - local seen_hyph_dicts = {} -- to avoid outputing count and size for shared hyph dicts + local seen_hyph_dicts = {} -- to avoid outputting count and size for shared hyph dicts local cre = require("document/credocument"):engineInit() local main_lang_tag, main_lang_active_hyph_dict, loaded_lang_infos = cre.getTextLangStatus() -- luacheck: no unused -- First output main lang tag @@ -762,7 +762,7 @@ function ReaderTypography:onReadSettings(config) self.allow_doc_lang_tag_override = true -- Use the one manually set as fallback (with Hold) self.text_lang_tag = G_reader_settings:readSetting("text_lang_fallback") - logger.dbg("Typography lang: using fallback ", self.text_lang_tag, ", might be overriden by doc language") + logger.dbg("Typography lang: using fallback ", self.text_lang_tag, ", might be overridden by doc language") else self.allow_doc_lang_tag_override = true -- None decided, use default (shouldn't be reached) diff --git a/frontend/apps/reader/modules/readeruserhyph.lua b/frontend/apps/reader/modules/readeruserhyph.lua index 29accf9c0ed2..da6efc9af6dc 100644 --- a/frontend/apps/reader/modules/readeruserhyph.lua +++ b/frontend/apps/reader/modules/readeruserhyph.lua @@ -11,7 +11,7 @@ local logger = require("logger") local _ = require("gettext") local T = require("ffi/util").template --- if sometime in the future crengine is updated to use normalized utf8 for hypenation +-- if sometime in the future crengine is updated to use normalized utf8 for hyphenation -- this variable can be set to `true`. (see discussion in : https://github.com/koreader/crengine/pull/466), -- and some `if NORM then` branches can be simplified. local NORM = false @@ -108,7 +108,7 @@ end -- Helper functions for dictionary entries------------------------------------------- --- checks if suggestion is well formated +-- checks if suggestion is well formatted function ReaderUserHyph:checkHyphenation(suggestion, word) if suggestion:find("%-%-") then return false -- two or more consecutive '-' diff --git a/frontend/apps/reader/readerui.lua b/frontend/apps/reader/readerui.lua index d06306d00ef3..f6ec1b6180a4 100644 --- a/frontend/apps/reader/readerui.lua +++ b/frontend/apps/reader/readerui.lua @@ -306,7 +306,7 @@ function ReaderUI:init() }) else -- load crengine default settings (from cr3.ini, some of these - -- will be overriden by our settings by some reader modules below) + -- will be overridden by our settings by some reader modules below) if self.document.setupDefaultView then self.document:setupDefaultView() end @@ -766,7 +766,7 @@ end function ReaderUI:onFlushSettings(show_notification) self:saveSettings() if show_notification then - -- Invoked from dispatcher to explicitely flush settings + -- Invoked from dispatcher to explicitly flush settings Notification:notify(_("Book metadata saved.")) end end diff --git a/frontend/depgraph.lua b/frontend/depgraph.lua index 7f69bb8d8987..105525908177 100644 --- a/frontend/depgraph.lua +++ b/frontend/depgraph.lua @@ -114,7 +114,7 @@ function DepGraph:addNode(node_key, deps) end -- Attempt to remove a node, as well as all traces of it from other nodes' deps --- If node has deps, it's kept, but marked as disabled, c.f., lenghty comment below. +-- If node has deps, it's kept, but marked as disabled, c.f., lengthy comment below. function DepGraph:removeNode(node_key) -- We shouldn't remove a node if it has dependencies (as these may have been added via addNodeDep -- (as opposed to the optional deps list passed to addNode), like what InputContainer does with overrides, diff --git a/frontend/device/android/device.lua b/frontend/device/android/device.lua index d3d922f59000..07b75cee9f07 100644 --- a/frontend/device/android/device.lua +++ b/frontend/device/android/device.lua @@ -46,7 +46,7 @@ local function getCodename() return codename end --- thirdparty app support +-- third-party app support local external = require("device/thirdparty"):new{ dicts = { { "Aard2", "Aard2", false, "itkach.aard2", "aard2" }, diff --git a/frontend/device/generic/device.lua b/frontend/device/generic/device.lua index 798ff05c937c..2d84e01f979d 100644 --- a/frontend/device/generic/device.lua +++ b/frontend/device/generic/device.lua @@ -96,7 +96,7 @@ local Device = { stopTextInput = function() end, -- use these only as a last resort. We should abstract the functionality - -- and have device dependent implementations in the corresponting + -- and have device dependent implementations in the corresponding -- device//device.lua file -- (these are functions!) isAndroid = no, diff --git a/frontend/device/gesturedetector.lua b/frontend/device/gesturedetector.lua index 2c009ea28512..a23c1cd83f4f 100644 --- a/frontend/device/gesturedetector.lua +++ b/frontend/device/gesturedetector.lua @@ -87,7 +87,7 @@ local GestureDetector = { -- Hash of our currently active contacts active_contacts = {}, contact_count = 0, - -- Used for double tap and bounce detection (this is outside a Contact object because it requires minimal persistance). + -- Used for double tap and bounce detection (this is outside a Contact object because it requires minimal persistence). previous_tap = {}, -- for timestamp clocksource detection clock_id = nil, @@ -806,7 +806,7 @@ function Contact:voidState() if tev.id == -1 then if self.down and buddy_contact and buddy_contact.down and self.mt_gesture then -- If we were lifted before our buddy, and we're part of a MT gesture, - -- defer to the proper state (wthout switching state ourselves). + -- defer to the proper state (without switching state ourselves). if self.mt_gesture == "tap" then return self:tapState() elseif self.mt_gesture == "swipe" or self.mt_gesture == "pan" or self.mt_gesture == "pan_release" then diff --git a/frontend/device/input.lua b/frontend/device/input.lua index 76fb06ac898e..3fbbfa80352a 100644 --- a/frontend/device/input.lua +++ b/frontend/device/input.lua @@ -185,7 +185,7 @@ local Input = { ev_slots = nil, -- table gesture_detector = nil, - -- simple internal clipboard implementation, can be overidden to use system clipboard + -- simple internal clipboard implementation, can be overridden to use system clipboard hasClipboardText = function() return _internal_clipboard_text ~= "" end, @@ -1493,7 +1493,7 @@ function Input:waitEvent(now, deadline) for __, event in ipairs(ev) do if DEBUG.is_on then -- NOTE: This is rather spammy and computationally intensive, - -- and we can't conditionally prevent evalutation of function arguments, + -- and we can't conditionally prevent evaluation of function arguments, -- so, just hide the whole thing behind a branch ;). if event.type == C.EV_KEY then logger.dbg(string.format( diff --git a/frontend/device/kindle/device.lua b/frontend/device/kindle/device.lua index d638d16853cb..b0c796023fea 100644 --- a/frontend/device/kindle/device.lua +++ b/frontend/device/kindle/device.lua @@ -72,7 +72,7 @@ local function kindleGetCurrentProfile() if lipc_handle then local ha_input = lipc_handle:new_hasharray() -- an empty hash array since we only want to read local ha_result = lipc_handle:access_hash_property("com.lab126.wifid", "currentEssid", ha_input) - local profile = ha_result:to_table()[1] -- theres only a single element + local profile = ha_result:to_table()[1] -- there is only a single element ha_input:destroy() ha_result:destroy() lipc_handle:close() diff --git a/frontend/device/kindle/powerd.lua b/frontend/device/kindle/powerd.lua index edc82cfa1158..a1fbdf1d2c7d 100644 --- a/frontend/device/kindle/powerd.lua +++ b/frontend/device/kindle/powerd.lua @@ -242,7 +242,7 @@ function KindlePowerD:checkUnexpectedWakeup() end end --- Dummy fuctions. They will be defined in initWakeupMgr +-- Dummy functions. They will be defined in initWakeupMgr function KindlePowerD:wakeupFromSuspend() end function KindlePowerD:readyToSuspend() end diff --git a/frontend/device/pocketbook/device.lua b/frontend/device/pocketbook/device.lua index 717299339bea..4ed7406a1949 100644 --- a/frontend/device/pocketbook/device.lua +++ b/frontend/device/pocketbook/device.lua @@ -52,7 +52,7 @@ local PocketBook = Generic:extend{ -- instead of busy looping at 50Hz the way inkview insists on doing. -- In case this method fails (no root), we fallback to classic inkview api. raw_input = nil, --[[{ - -- value or function to adjust touch matrix orientiation. + -- value or function to adjust touch matrix orientation. touch_rotation = -3+4, -- Works same as input.event_map, but for raw input EV_KEY translation keymap = { [scan] = event }, @@ -170,7 +170,7 @@ function PocketBook:init() return self._fb_init(fb, finfo, vinfo) end, - -- raw touch input orientiation is different from the screen + -- raw touch input orientation is different from the screen getTouchRotation = function(fb) if type(touch_rotation) == "function" then return touch_rotation(self, fb:getRotationMode()) diff --git a/frontend/device/remarkable/device.lua b/frontend/device/remarkable/device.lua index ff5397ceb956..e68d3c08eb24 100644 --- a/frontend/device/remarkable/device.lua +++ b/frontend/device/remarkable/device.lua @@ -125,7 +125,7 @@ function Remarkable:init() -- logger.info("PPID:") -- local parent_process = os.execute("echo $PPID") -- os.execute("ps | grep $PPID") - -- logger.info(string.format("parent proccess is oxide?: %s", parent_process_is_oxide)) + -- logger.info(string.format("parent process is oxide?: %s", parent_process_is_oxide)) self.screen = require("ffi/framebuffer_mxcfb"):new{device = self, debug = logger.dbg} self.powerd = require("device/remarkable/powerd"):new{ diff --git a/frontend/device/sdl/device.lua b/frontend/device/sdl/device.lua index d51804b109bc..912bb8f61d09 100644 --- a/frontend/device/sdl/device.lua +++ b/frontend/device/sdl/device.lua @@ -50,7 +50,7 @@ local function getLinkOpener() return false end --- thirdparty app support +-- third-party app support local external = require("device/thirdparty"):new{ dicts = getDesktopDicts(), check = function(self, app) @@ -185,7 +185,7 @@ function Device:init() y = self.window.top, is_always_portrait = self.isAlwaysPortrait(), } - -- Pickup the updated window sizes if they were enforced in S.open (we'll get the coordinates via the inital SDL_WINDOWEVENT_MOVED)... + -- Pickup the updated window sizes if they were enforced in S.open (we'll get the coordinates via the initial SDL_WINDOWEVENT_MOVED)... self.window.width = self.screen.w self.window.height = self.screen.h self.powerd = require("device/sdl/powerd"):new{device = self} diff --git a/frontend/device/sysfs_light.lua b/frontend/device/sysfs_light.lua index 4f205ac932a9..03f3bf397b75 100644 --- a/frontend/device/sysfs_light.lua +++ b/frontend/device/sysfs_light.lua @@ -66,7 +66,7 @@ function SysfsLight:setNaturalBrightness(brightness, warmth) warmth = self.current_warmth end - -- Newer devices use a mixer instead of writting values per color. + -- Newer devices use a mixer instead of writing values per color. if self.frontlight_mixer then if set_brightness then -- Prefer the ioctl, as it's much lower latency. diff --git a/frontend/device/thirdparty.lua b/frontend/device/thirdparty.lua index 553fc8881141..9eb3a9ebfaf3 100644 --- a/frontend/device/thirdparty.lua +++ b/frontend/device/thirdparty.lua @@ -1,4 +1,4 @@ --- module for integration with thirdparty applications +-- module for integration with third-party applications local logger = require("logger") local roles = { @@ -56,7 +56,7 @@ function M:checkMethod(role, method) end function M:dump() - local str = "user defined thirdparty apps\n" + local str = "user defined third-party apps\n" for i, role in ipairs(roles) do local apps = self[role.."s"] for index, _ in ipairs(apps or {}) do diff --git a/frontend/device/wakeupmgr.lua b/frontend/device/wakeupmgr.lua index 25069c9116ce..a201a02732c1 100644 --- a/frontend/device/wakeupmgr.lua +++ b/frontend/device/wakeupmgr.lua @@ -138,7 +138,7 @@ function WakeupMgr:removeTasks(epoch, callback) end table.remove(self._task_queue, k) removed = true - -- If we've successfuly pop'ed the upcoming task, we need to schedule the next one (if any) on exit. + -- If we've successfully pop'ed the upcoming task, we need to schedule the next one (if any) on exit. if k == 1 then reschedule = true end diff --git a/frontend/document/credocument.lua b/frontend/document/credocument.lua index b51be301415e..d15a3c6c8ad2 100644 --- a/frontend/document/credocument.lua +++ b/frontend/document/credocument.lua @@ -53,7 +53,7 @@ local CreDocument = Document:extend{ -- in any fallback font. Also, we don't know if the user is using -- a serif or a sans main font, so choosing to have one of these early -- might not be the best decision (and moving them before FreeSans would - -- require one to set FreeSans as fallback to get its nicer glyphes, which + -- require one to set FreeSans as fallback to get its nicer glyphs, which -- would override Noto Sans CJK good symbol glyphs with smaller ones -- (Noto Sans & Serif do not have these symbol glyphs). fallback_fonts = { -- const @@ -169,12 +169,12 @@ function CreDocument:init() local file_type = string.lower(string.match(self.file, ".+%.([^.]+)") or "") if file_type == "zip" then -- NuPogodi, 20.05.12: read the content of zip-file - -- and return extention of the 1st file + -- and return extension of the 1st file file_type = self:zipContentExt(self.file) or "unknown" end -- June 2018: epub.css has been cleaned to be more conforming to HTML specs - -- and to not include class name based styles (with conditional compatiblity + -- and to not include class name based styles (with conditional compatibility -- styles for previously opened documents). It should be usable on all -- HTML based documents, except FB2 which has some incompatible specs. -- The other css files (htm.css, rtf.css...) have not been updated in the @@ -1065,7 +1065,7 @@ function CreDocument:setFontFace(new_font_face) -- don't have the font. cre.setAsPreferredFontWithBias(new_font_face, 1 + 128*5 + 256*5) - -- The above call has resetted all other biases, so re-set our other ones + -- The above call has reset all other biases, so re-set our other ones self:setOtherFontBiases() end end @@ -1207,7 +1207,7 @@ function CreDocument:setRenderDPI(value) end function CreDocument:setRenderScaleFontWithDPI(toggle) - -- wheter to scale font with DPI, or keep the current size + -- whether to scale font with DPI, or keep the current size logger.dbg("CreDocument: set render scale font with dpi", toggle) self._document:setIntProperty("crengine.render.scale.font.with.dpi", toggle) end @@ -1620,7 +1620,7 @@ function CreDocument:setupCallCache() local do_log = false -- Beware below for luacheck warnings "shadowing upvalue argument 'self'": - -- the 'self' we got and use here, and the one we may get implicitely + -- the 'self' we got and use here, and the one we may get implicitly -- as first parameter of the methods we define or redefine, are actually -- the same, but luacheck doesn't know that and would logically complain. -- So, we define our helpers (self._callCache*) as functions and not methods: @@ -1909,13 +1909,13 @@ function CreDocument:setupCallCache() if add_reset then self[name] = function(...) -- logger.dbg("callCache:", name, "called with", select(2,...)) - if do_log then logger.dbg("callCache:", name, "reseting cache") end + if do_log then logger.dbg("callCache:", name, "resetting cache") end self._callCacheReset() return func(...) end elseif add_buffer_trash then self[name] = function(...) - if do_log then logger.dbg("callCache:", name, "reseting buffer") end + if do_log then logger.dbg("callCache:", name, "resetting buffer") end self._callCacheSet("current_buffer_tag", nil) return func(...) end diff --git a/frontend/document/document.lua b/frontend/document/document.lua index 08a2bf3513a9..c90bc0156f00 100644 --- a/frontend/document/document.lua +++ b/frontend/document/document.lua @@ -23,7 +23,7 @@ local Document = { GAMMA_NO_GAMMA = 1.0, - -- override bbox from orignal page's getUsedBBox + -- override bbox from original page's getUsedBBox bbox = nil, -- table -- flag to show whether the document was opened successfully @@ -501,7 +501,7 @@ function Document:renderPage(pageno, rect, zoom, rotation, gamma, hinting) -- Make the context match the rotation, -- by pointing at the rotated origin via coordinates offsets. -- NOTE: We rotate our *Screen* bb on rotation (SetRotationMode), not the document, - -- so we hardly ever exercize this codepath... + -- so we hardly ever exercise this codepath... -- AFAICT, the only thing that will *ever* (attempt to) rotate the document is ReaderRotation's key bindings (RotationUpdate). --- @fixme: And whaddayano, it's broken ;). The aptly named key binds in question are J/K, I shit you not. if rotation == 90 then diff --git a/frontend/document/koptinterface.lua b/frontend/document/koptinterface.lua index 9ae72be17772..4d84748aa33c 100644 --- a/frontend/document/koptinterface.lua +++ b/frontend/document/koptinterface.lua @@ -1379,7 +1379,7 @@ end local function all_matches(boxes, plist, case_insensitive) local pnb = #plist - -- return mached word indices from index i, j + -- return matched word indices from index i, j local function match(i, j) local pindex = 1 local matched_indices = {} diff --git a/frontend/gettext.lua b/frontend/gettext.lua index aa4994307c3d..ba7d6dd09e39 100644 --- a/frontend/gettext.lua +++ b/frontend/gettext.lua @@ -35,7 +35,7 @@ local GetText_mt = { __index = {} } --- wrapUntranslated() will be overriden by bidi.lua when UI language is RTL, +-- wrapUntranslated() will be overridden by bidi.lua when UI language is RTL, -- to wrap untranslated english strings as LTR-isolated segments. -- It should do nothing when the UI language is LTR. GetText.wrapUntranslated_nowrap = function(text) return text end diff --git a/frontend/httpclient.lua b/frontend/httpclient.lua index 3cf91aa73deb..2b102e603ca7 100644 --- a/frontend/httpclient.lua +++ b/frontend/httpclient.lua @@ -26,7 +26,7 @@ function HTTPClient:request(request, response_callback) local client = turbo.async.HTTPClient({verify_ca = false}) local res = coroutine.yield(client:fetch(request.url, request)) self.input_timeouts = self.input_timeouts - 1 - -- reset INPUT_TIMEOUT to nil when all HTTP requests are fullfilled. + -- reset INPUT_TIMEOUT to nil when all HTTP requests are fulfilled. if self.input_timeouts == 0 then UIManager:resetInputTimeout() end if response_callback then response_callback(res) diff --git a/frontend/languagesupport.lua b/frontend/languagesupport.lua index 2ee3bb666fb0..852446803ea1 100644 --- a/frontend/languagesupport.lua +++ b/frontend/languagesupport.lua @@ -54,7 +54,7 @@ corresponding onHandler method): Note that "XPointer" is used here but code written should take it as an opaque object and only use the given callbacks since in future this feature may work with PDFs and all of the XPointers will instead be PDF equivalents. - +fulfilled Called with { pos0 = [XPointer], pos1 = [XPointer], callbacks = { @@ -210,7 +210,7 @@ function LanguageSupport:improveWordSelection(selection) -- We want to use native crengine text selection here, but we cannot use -- getTextFromPositions because the conversion to and from screen - -- co-ordinates leads to issues with text selection of text. In + -- coordinates leads to issues with text selection of text. In -- addition, using getTextFromXPointers means we can select text not on the -- screen. But this means we need to manually create the text selection -- object returned by getTextFromPositions (though this is not a big deal diff --git a/frontend/ui/bidi.lua b/frontend/ui/bidi.lua index 0d6800367d96..a0886e00e4f6 100644 --- a/frontend/ui/bidi.lua +++ b/frontend/ui/bidi.lua @@ -13,7 +13,7 @@ only 2 valid combinations: Text direction is handled by the libkoreader-xtext.so C module, and the TextWidget and TextBoxWidget widgets that handle text -aligment. We just need here to set the default global paragraph +alignment. We just need here to set the default global paragraph direction (that widgets can override if needed). UI mirroring is to be handled by our widget themselves, with the @@ -62,7 +62,7 @@ function Bidi.setup(lang) -- Text direction should normally not follow ui mirroring -- lang override (so that Arabic is still right aligned -- when one wants the UI layout LTR). But allow it to - -- be independantly reversed (for testing UI mirroring + -- be independently reversed (for testing UI mirroring -- with english text right aligned). if G_reader_settings:isTrue("dev_reverse_ui_text_direction") then is_rtl = not is_rtl @@ -127,7 +127,7 @@ function Bidi.mirroredUILayout() return Bidi._mirrored_ui_layout end --- This fuction can be used by document widgets to temporarily match a widget +-- This function can be used by document widgets to temporarily match a widget -- to the document page turn direction instead of the UI layout direction. function Bidi.invert() if not Bidi._inverted then diff --git a/frontend/ui/data/creoptions.lua b/frontend/ui/data/creoptions.lua index 36f4040737ee..6c38f4d21123 100644 --- a/frontend/ui/data/creoptions.lua +++ b/frontend/ui/data/creoptions.lua @@ -554,7 +554,7 @@ Note that your selected font size is not affected by this setting.]]), unit = "%", name = "cjk_width_scaling", name_text = _("CJK width scaling"), - info_text = _([[Increase the width of all CJK (Chinese, Japanese, Korean) chararacters by this percentage. This has the effect of adding space between these glyphs, and might make them easier to distinguish to some readers.]]), + info_text = _([[Increase the width of all CJK (Chinese, Japanese, Korean) characters by this percentage. This has the effect of adding space between these glyphs, and might make them easier to distinguish to some readers.]]), event = "SetCJKWidthScaling", other_button = { text = _("Word expansion"), diff --git a/frontend/ui/data/css_tweaks.lua b/frontend/ui/data/css_tweaks.lua index 951bbde68016..ae496b0cc206 100644 --- a/frontend/ui/data/css_tweaks.lua +++ b/frontend/ui/data/css_tweaks.lua @@ -189,7 +189,7 @@ These tweaks allow you to change this behavior, and to override publisher rules. separator = true, }, -- To avoid duplicating these 2 tweaks into 2 others for ignoring publisher rules, - -- we apply the rules to BODY without !important (so they can still be overriden + -- we apply the rules to BODY without !important (so they can still be overridden -- by publisher rules applied to BODY), and to DocFragment with !important (so -- that with "* {widows/orphans: inherit !important}", all elements will inherit -- from the DocFragment rules. @@ -684,7 +684,7 @@ table, tcaption, tr, th, td { border: black solid 1px; border-collapse: collapse title = _("Full-width images"), description = _("Useful for books containing only images, when they are smaller than your screen. May stretch images in some cases."), -- This helped me once with a book. Will mess with aspect ratio - -- when images have a style="width: NNpx; heigh: NNpx" + -- when images have a style="width: NNpx; height: NNpx" css = [[ img { text-align: center !important; @@ -1019,7 +1019,7 @@ This tweak can be duplicated as a user style tweak when books contain footnotes -- to apply the hint). -- For the font-size changes, we want to match only block elements (with "-inline") -- as we want to keep any relative font-size (ie. 0.5em) for inline nodes like . - -- We also add a selector for the internal element (which are explicitely + -- We also add a selector for the internal element (which are explicitly -- not matched by '*') as we may get some in/as footnote containers, and they would -- inherit some of these properties, that we wish to reset too. (function() @@ -1121,7 +1121,7 @@ This will break any complex footnote containing quotes or lists.]]), id = "inpage_footnote_regularize_text", title = _("Regularize text size on inline elements"), description = _([[ -If the footnote text uses variable or absolute font sizes, line height or vertical alignments, which would make it too irregular, you can reset all of them to get a leaner text (to the expense of loosing superscripts).]]), +If the footnote text uses variable or absolute font sizes, line height or vertical alignments, which would make it too irregular, you can reset all of them to get a leaner text (to the expense of losing superscripts).]]), priority = 6, css = [[ *, autoBoxing { diff --git a/frontend/ui/data/koptoptions.lua b/frontend/ui/data/koptoptions.lua index ffc5628d1eca..dc9b5e8c2536 100644 --- a/frontend/ui/data/koptoptions.lua +++ b/frontend/ui/data/koptoptions.lua @@ -665,7 +665,7 @@ if BD.mirroredUILayout() then j.values[2], j.values[4] = j.values[4], j.values[2] j.labels[2], j.labels[4] = j.labels[4], j.labels[2] -- The zoom direction items will be mirrored, but we want them to - -- stay as is, as the RTL diretions are at the end of the arrays. + -- stay as is, as the RTL directions are at the end of the arrays. -- By reverting the mirroring, RTL directions will be on the right, -- so, at the start of the options for a RTL reader. j = KoptOptions[3].options[7] diff --git a/frontend/ui/data/onetime_migration.lua b/frontend/ui/data/onetime_migration.lua index c50515578a50..164d5530b5ce 100644 --- a/frontend/ui/data/onetime_migration.lua +++ b/frontend/ui/data/onetime_migration.lua @@ -78,7 +78,7 @@ if last_migration_date < 20200421 then G_reader_settings:saveSetting("text_lang_fallback", dict_info[2]) g_text_lang_set = true -- We can't really tweak other settings if the hyph algo fallback happens to be - -- @none, @softhyphens, @algortihm... + -- @none, @softhyphens, @algorithm... end end if not g_text_lang_set then @@ -444,7 +444,7 @@ end if last_migration_date < 20220625 then os.remove("afterupdate.marker") - -- Move an existing `koreader/patch.lua` to `koreader/patches/1-patch.lua` (-> will be excuted in `early`) + -- Move an existing `koreader/patch.lua` to `koreader/patches/1-patch.lua` (-> will be executed in `early`) local data_dir = DataStorage:getDataDir() local patch_dir = data_dir .. "/patches" if lfs.attributes(data_dir .. "/patch.lua", "mode") == "file" then diff --git a/frontend/ui/elements/font-test-sample-default.template b/frontend/ui/elements/font-test-sample-default.template index c911cae52dc7..b09386e72901 100644 --- a/frontend/ui/elements/font-test-sample-default.template +++ b/frontend/ui/elements/font-test-sample-default.template @@ -56,7 +56,7 @@ This should be enough to appreciate this font.
 
This is some sample content. You can have this document generated -with some text of yours in your prefered language(s) by creating and +with some text of yours in your preferred language(s) by creating and adding it to a file named:
koreader/settings/font-test-sample.html
diff --git a/frontend/ui/elements/menu_keyboard_layout.lua b/frontend/ui/elements/menu_keyboard_layout.lua index 94cbfad8c884..69fdae776fc4 100644 --- a/frontend/ui/elements/menu_keyboard_layout.lua +++ b/frontend/ui/elements/menu_keyboard_layout.lua @@ -228,7 +228,7 @@ local sub_item_table = { }, } if Device:hasKeyboard() or Device:hasScreenKB() then - -- we use same pos. 4 as below so we are always above "keyboard apperance settings" + -- we use same pos. 4 as below so we are always above "keyboard appearance settings" table.insert(sub_item_table, 4, { text = _("Show virtual keyboard"), help_text = _("Enable this setting to always display the virtual keyboard within a text input field. When a field is selected (in focus), you can temporarily toggle the keyboard on/off by pressing 'Shift' (or 'ScreenKB') + 'Home'."), diff --git a/frontend/ui/font.lua b/frontend/ui/font.lua index 9ba2364538fb..607fbb3250ab 100644 --- a/frontend/ui/font.lua +++ b/frontend/ui/font.lua @@ -29,11 +29,11 @@ local Font = { regular_font_variant = _regular_font_variant, -- Allow globally not promoting fonts to their bold variants - -- (and use thiner and narrower synthetized bold instead). + -- (and use thinner and narrower synthesized bold instead). use_bold_font_for_bold = G_reader_settings:nilOrTrue("use_bold_font_for_bold"), -- Widgets can provide "bold = Font.FORCE_SYNTHETIZED_BOLD" instead - -- of "bold = true" to explicitely request synthetized bold, which, + -- of "bold = true" to explicitly request synthesized bold, which, -- with XText, makes a bold string the same width as itself non-bold. FORCE_SYNTHETIZED_BOLD = "FORCE_SYNTHETIZED_BOLD", @@ -168,7 +168,7 @@ for _, font_path in ipairs(FontList:getFontList()) do end bold_candidates = nil -- luacheck: ignore --- Helper functions with explicite names around +-- Helper functions with explicit names around -- bold/regular_font_variant tables function Font:hasBoldVariant(name) return self.bold_font_variant[name] and true or false @@ -186,7 +186,7 @@ function Font:getRegularVariantName(name) return self.regular_font_variant[name] or name end --- Synthetized bold strength can be tuned: +-- Synthesized bold strength can be tuned: -- local bold_strength_factor = 1 -- really too bold -- local bold_strength_factor = 1/2 -- bold enough local bold_strength_factor = 3/8 -- as crengine, lighter @@ -226,7 +226,7 @@ local _getFallbackFont = function(face_obj, num) -- If main font is a real bold, or if it's not but we want bold, -- get the bold variant of the fallback if one exists. -- But if one exists, use the regular variant as an additional - -- fallback, drawn with synthetized bold (often, bold fonts + -- fallback, drawn with synthesized bold (often, bold fonts -- have less glyphs than their regular counterpart). if face_obj.is_real_bold or face_obj.wants_bold == true then -- (not if wants_bold==Font.FORCE_SYNTHETIZED_BOLD) @@ -296,7 +296,7 @@ function Font:getFace(font, size, faceindex) if face_obj.orig_size ~= orig_size then -- orig_size has changed (which may happen on small orig_size variations -- mapping to a same final size, but more importantly when geometry - -- or dpi has changed): keep it updated, so code that would re-use + -- or dpi has changed): keep it updated, so code that would reuse -- it to fetch another font get the current original font size and -- not one from the past face_obj.orig_size = orig_size @@ -386,8 +386,8 @@ function Font:getAdjustedFace(face, bold) if face.is_real_bold then -- No adjustment needed: main real bold font will ensure -- fallback fonts use their associated bold font or - -- get synthetized bold - whether bold is requested or not - -- (Set returned bold to true, to force synthetized bold + -- get synthesized bold - whether bold is requested or not + -- (Set returned bold to true, to force synthesized bold -- on fallback fonts with no associated real bold) -- (Drop bold=FORCE_SYNTHETIZED_BOLD and use 'true' if -- we were given a real bold font.) @@ -413,8 +413,8 @@ function Font:getAdjustedFace(face, bold) end end -- Only the regular font is available, and bold requested: - -- we'll have synthetized bold - but _getFallbackFont() should - -- build a list of fallback fonts either synthetized, or possibly + -- we'll have synthesized bold - but _getFallbackFont() should + -- build a list of fallback fonts either synthesized, or possibly -- using the bold variant of a regular fallback font. -- We don't want to collide with the regular font face_obj.fallbacks -- so let's make a shallow clone of this face_obj, and have it cached. @@ -432,13 +432,13 @@ function Font:getAdjustedFace(face, bold) orig_size = face.orig_size, -- We can keep the same FT object and the same hash in this face_obj -- (which is only used to identify cached glyphs, that we don't need - -- to distinguish as "bold" is appended when synthetized as bold) + -- to distinguish as "bold" is appended when synthesized as bold) ftsize = face.ftsize, hash = face.hash, hb_features = face.hb_features, is_real_bold = nil, wants_bold = bold, -- true or Font.FORCE_SYNTHETIZED_BOLD, used - -- to pick the appropritate fallback fonts + -- to pick the appropriate fallback fonts } face_obj.getFallbackFont = function(num) return _getFallbackFont(face_obj, num) diff --git a/frontend/ui/network/manager.lua b/frontend/ui/network/manager.lua index 7fa72d9bffef..1e307b999721 100644 --- a/frontend/ui/network/manager.lua +++ b/frontend/ui/network/manager.lua @@ -544,7 +544,7 @@ function NetworkMgr:getBeforeActionFlag() return self._before_action_tripped end ---- @note: The callback will only run *after* a *succesful* network connection. +--- @note: The callback will only run *after* a *successful* network connection. --- The only guarantee it provides is isConnected (i.e., an IP & a local gateway), --- *NOT* isOnline (i.e., WAN), se be careful with recursive callbacks! --- Should only return false on *explicit* failures, diff --git a/frontend/ui/renderimage.lua b/frontend/ui/renderimage.lua index 70b660eb4a09..3ef87fcf6524 100644 --- a/frontend/ui/renderimage.lua +++ b/frontend/ui/renderimage.lua @@ -169,7 +169,7 @@ function RenderImage:renderGifImageDataWithGifLib(data, size, want_frames, width end end -- Much like our other stuff, when we're puzzled about __gc, we do it manually! - -- So, also set this method, so that ImageViewer can explicitely call it onClose. + -- So, also set this method, so that ImageViewer can explicitly call it onClose. function frames:free() logger.dbg("frames.free() called, closing GifDocument", self.gif) if self.gif_close_needed then @@ -251,7 +251,7 @@ function RenderImage:renderWebpImageDataWithLibwebp(data, size, want_frames, wid end end -- Much like our other stuff, when we're puzzled about __gc, we do it manually! - -- So, also set this method, so that ImageViewer can explicitely call it onClose. + -- So, also set this method, so that ImageViewer can explicitly call it onClose. function frames:free() logger.dbg("frames.free() called, closing webp object", self.webp) if self.webp_close_needed then diff --git a/frontend/ui/rendertext.lua b/frontend/ui/rendertext.lua index c50f12fbc499..d7e4ce653f7e 100644 --- a/frontend/ui/rendertext.lua +++ b/frontend/ui/rendertext.lua @@ -243,7 +243,7 @@ function RenderText:renderUtf8Text(dest_bb, x, baseline, face, text, kerning, bo pen_x = pen_x + (char_pads[char_idx] or 0) -- We used to use: -- pen_x = pen_x + char_pads[char_idx] - -- above will fail if we didnt count the same number of chars, we'll see + -- above will fail if we didn't count the same number of chars, we'll see -- We saw, and it's pretty robust: it never failed before we tried to -- render some binary content, which messes the utf8 sequencing: the -- split to UTF8 is only reversible if text is valid UTF8 (or nearly UTF8). diff --git a/frontend/ui/screensaver.lua b/frontend/ui/screensaver.lua index a353d558b74f..3fd905cf91fd 100644 --- a/frontend/ui/screensaver.lua +++ b/frontend/ui/screensaver.lua @@ -687,7 +687,7 @@ function Screensaver:show() message_widget, } else - -- No prevously created widget, so just show message widget + -- No previously created widget, so just show message widget widget = message_widget end end diff --git a/frontend/ui/time.lua b/frontend/ui/time.lua index 8e6dcc4b1fc6..8c4804d6d791 100644 --- a/frontend/ui/time.lua +++ b/frontend/ui/time.lua @@ -1,5 +1,5 @@ --[[-- -A runtime optimized module to compare and do simple arithmetics with fixed point time values (which are called fts in here). +A runtime optimized module to compare and do simple arithmetic with fixed point time values (which are called fts in here). Also implements functions to retrieve time from various system clocks (monotonic, monotonic_coarse, realtime, realtime_coarse, boottime ...). @@ -226,7 +226,7 @@ Which means that, yes, this is a fancier POSIX Epoch ;). local time = require("ui/time") local fts_start = time.realtime() -- Do some stuff. - -- You can add and substract fts times + -- You can add and subtract fts times local fts_duration = time.realtime() - fts_start @treturn fts fixed point time @@ -282,7 +282,7 @@ if HAVE_BOOTTIME then time.boottime_or_realtime_coarse = time.boottime else function time.boottime() - logger.warn("fts: Attemped to call boottime on a platform where it's unsupported!") + logger.warn("fts: Attempted to call boottime on a platform where it's unsupported!") return 0 end diff --git a/frontend/ui/trapper.lua b/frontend/ui/trapper.lua index 167ac833ac39..b98992ff273c 100644 --- a/frontend/ui/trapper.lua +++ b/frontend/ui/trapper.lua @@ -179,7 +179,7 @@ function Trapper:info(text, fast_refresh) return false end if self.current_widget then - -- Resurect a dead widget. This should only be performed by trained Necromancers. + -- Resurrect a dead widget. This should only be performed by trained Necromancers. -- Do NOT do this at home, kids. -- Some state *might* be lost, but the basics should survive... self.current_widget:init() @@ -397,7 +397,7 @@ function Trapper:dismissablePopen(cmd, trap_widget_or_string) -- We check regularly if data is available to be read, and we give control -- in the meantime to UIManager so our trap_widget's dismiss_callback -- get a chance to be triggered, in which case we won't wait for reading, - -- We'll schedule a background function to collect the uneeded output and + -- We'll schedule a background function to collect the unneeded output and -- close the pipe later. while true do -- Every 10 iterations, increase interval until a max of 1 sec is reached @@ -417,7 +417,7 @@ function Trapper:dismissablePopen(cmd, trap_widget_or_string) -- zombie processes. local collect_and_clean collect_and_clean = function() - if ffiutil.getNonBlockingReadSize(std_out) ~= 0 then -- cmd started outputing + if ffiutil.getNonBlockingReadSize(std_out) ~= 0 then -- cmd started outputting std_out:read("*all") std_out:close() logger.dbg("collected cancelled cmd output") @@ -600,7 +600,7 @@ function Trapper:dismissableRunInSubprocess(task, trap_widget_or_string, task_re logger.dbg("collected previously dismissed subprocess") else if parent_read_fd and ffiutil.getNonBlockingReadSize(parent_read_fd) ~= 0 then - -- If subprocess started outputing to fd, read from it, + -- If subprocess started outputting to fd, read from it, -- so its write() stops blocking and subprocess can exit ffiutil.readAllFromFD(parent_read_fd) -- We closed our fd, don't try again to read or close it diff --git a/frontend/ui/uimanager.lua b/frontend/ui/uimanager.lua index 6912c57bee0e..fff294fa0ec9 100644 --- a/frontend/ui/uimanager.lua +++ b/frontend/ui/uimanager.lua @@ -767,7 +767,7 @@ end --- Top-to-bottom widgets iterator --- NOTE: VirtualKeyboard can be instantiated multiple times, and is a modal, --- so don't be suprised if you find a couple of instances of it at the top ;). +-- so don't be surprised if you find a couple of instances of it at the top ;). function UIManager:topdown_widgets_iter() local n = #self._window_stack local i = n + 1 @@ -1149,7 +1149,7 @@ function UIManager:_refresh(mode, region, dither) end -- special case: "partial" refreshes -- will get promoted every self.FULL_REFRESH_COUNT refreshes - -- since _refresh can be called mutiple times via setDirty called in + -- since _refresh can be called multiple times via setDirty called in -- different widgets before a real screen repaint, we should make sure -- refresh_count is incremented by only once at most for each repaint -- NOTE: Ideally, we'd only check for "partial"" w/ no region set (that neatly narrows it down to just the reader). @@ -1671,7 +1671,7 @@ function UIManager:_standbyTransition() end -- Used by a PM transition event handler to request an early return from input polling. --- NOTE: We can't re-use setInputTimeout to avoid interactions with ZMQ... +-- NOTE: We can't reuse setInputTimeout to avoid interactions with ZMQ... function UIManager:consumeInputEarlyAfterPM(toggle) self._pm_consume_input_early = toggle end diff --git a/frontend/ui/viewhtml.lua b/frontend/ui/viewhtml.lua index 4358679279ff..d3e6596fc9ce 100644 --- a/frontend/ui/viewhtml.lua +++ b/frontend/ui/viewhtml.lua @@ -308,7 +308,7 @@ function ViewHtml:_handleLongPress(document, css_selectors_offsets, offset_shift ancestors_classnames_selector = " > " .. ancestors_classnames_selector end ancestors_classnames_selector = elem .. all_classnames .. ancestors_classnames_selector - seen_kind.element = true -- done with selectors targetting the selected element only + seen_kind.element = true -- done with selectors targeting the selected element only end if elem == "DocFragment" or elem == "FictionBook" then -- Ignore the root node up these diff --git a/frontend/ui/widget/bookmapwidget.lua b/frontend/ui/widget/bookmapwidget.lua index 24be4e6484ab..9e80d60b7c94 100644 --- a/frontend/ui/widget/bookmapwidget.lua +++ b/frontend/ui/widget/bookmapwidget.lua @@ -39,8 +39,8 @@ local BookMapRow = WidgetContainer:extend{ height = nil, pages_frame_border = Size.border.default, toc_span_border = Size.border.thin, - -- pages_frame_border = 10, -- for debugging positionning - -- toc_span_border = 5, -- for debugging positionning + -- pages_frame_border = 10, -- for debugging positioning + -- toc_span_border = 5, -- for debugging positioning toc_items = nil, -- Arrays[levels] of arrays[items at this level to show as spans] -- Many other options not described here, see BookMapWidget:update() -- for the complete list. @@ -151,7 +151,7 @@ function BookMapRow:init() margin = 0, padding = 0, bordersize = self.pages_frame_border, - -- color = Blitbuffer.COLOR_GRAY, -- for debugging positionning + -- color = Blitbuffer.COLOR_GRAY, -- for debugging positioning Widget:new{ -- empty widget to give dimensions around which to draw borders dimen = Geom:new{ w = self.pages_frame_inner_width, @@ -351,7 +351,7 @@ function BookMapRow:init() local read_min_h = math.max(math.ceil(self.span_height * 0.1), unread_marker_h+Size.line.thick) if self.page_slot_width >= 5 * unread_marker_h then -- If page slots are large enough, we can make unread markers a bit taller (so they - -- are noticable and won't be confused with read page slots) + -- are noticeable and won't be confused with read page slots) unread_marker_h = unread_marker_h * 2 end for page = self.start_page, self.end_page do @@ -359,7 +359,7 @@ function BookMapRow:init() local x = self:getPageX(page) local w = self:getPageX(page, true) - x local h = math.ceil(self.read_pages[page][1] * self.span_height * 0.8) - h = math.max(h, read_min_h) -- so it's noticable + h = math.max(h, read_min_h) -- so it's noticeable local y = self.pages_frame_height - self.pages_frame_border - h + 1 if self.with_page_sep then -- We put the blank at the start of a page slot @@ -545,11 +545,11 @@ function BookMapRow:paintTo(bb, x, y) end -- Paint regular sub widgets the classic way InputContainer.paintTo(self, bb, x, y) - -- And explicitely paint read pages markers (which are not subwidgets) + -- And explicitly paint read pages markers (which are not subwidgets) for _, marker in ipairs(self.pages_markers) do bb:paintRect(x + self.pages_frame_offset_x + marker.x, y + marker.y, marker.w, marker.h, marker.color) end - -- And explicitely paint indicators (which are not subwidgets) + -- And explicitly paint indicators (which are not subwidgets) for _, indicator in ipairs(self.indicators) do local glyph = RenderText:getGlyph(indicator.face or self.font_face, indicator.c) local alt_bb @@ -572,7 +572,7 @@ function BookMapRow:paintTo(bb, x, y) alt_bb:free() end end - -- And explicitely paint bottom texts (which are not subwidgets) + -- And explicitly paint bottom texts (which are not subwidgets) for _, btext in ipairs(self.bottom_texts) do local text_w = TextWidget:new{ text = btext.text, @@ -601,7 +601,7 @@ function BookMapRow:paintTo(bb, x, y) end end --- BookMapWidget: shows a map of content, including TOC, boomarks, read pages, non-linear flows... +-- BookMapWidget: shows a map of content, including TOC, bookmarks, read pages, non-linear flows... local BookMapWidget = InputContainer:extend{ -- Focus page: show the BookMapRow containing this page -- in the middle of screen @@ -745,9 +745,9 @@ function BookMapWidget:init() } -- We'll handle all events in this main BookMapWidget: none of the vgroup -- children have any handler. Hack into vgroup so it doesn't propagate - -- events needlessly to its children (the slowness gets noticable when + -- events needlessly to its children (the slowness gets noticeable when -- we have many TOC items in flat map mode - the also needless :paintTo() - -- don't seen to cause such a noticable slowness) + -- don't seen to cause such a noticeable slowness) self.vgroup.propagateEvent = function() return false end -- Our scrollable container needs to be known as widget.cropping_widget in @@ -990,7 +990,7 @@ function BookMapWidget:update() cur_left_spacing = cur_left_spacing + Size.span.horizontal_default -- Note: this variable indentation may make the page slot widths variable across -- rows from different levels (and self.fit_pages_per_row not really accurate) :/ - -- Hopefully, it won't be noticable. + -- Hopefully, it won't be noticeable. else p_max = item.page - 1 p_end = p_max @@ -1432,7 +1432,7 @@ function BookMapWidget:onClose(close_all_parents) -- with the current size to be available) self.ui.thumbnail:tidyCache() -- Force a GC to free the memory used by the widgets and tiles - -- (delay it a bit so this pause is less noticable) + -- (delay it a bit so this pause is less noticeable) UIManager:scheduleIn(0.5, function() collectgarbage() collectgarbage() @@ -1463,7 +1463,7 @@ end function BookMapWidget:getVGroupRowAtY(y) -- y is expected relative to the ScrollableContainer crop top - -- (if y is from a screen coordinate, substract 'self.title_bar_h' before calling this) + -- (if y is from a screen coordinate, subtract 'self.title_bar_h' before calling this) y = y + self.cropping_widget._scroll_offset_y return self:getMatchingVGroupRow(function(r, r_y, r_h) return y >= r_y and y < r_y + r_h @@ -1472,7 +1472,7 @@ end function BookMapWidget:getBookMapRowNearY(y) -- y is expected relative to the ScrollableContainer crop top - -- (if y is from a screen coordinate, substract 'self.title_bar_h' before calling this) + -- (if y is from a screen coordinate, subtract 'self.title_bar_h' before calling this) y = y + self.cropping_widget._scroll_offset_y -- Return the BookMapRow at y, or if the vgroup element is a ToC -- title (in flat_map mode), return the follow up BookMapRow @@ -1798,7 +1798,7 @@ end function BookMapWidget:paintTo(bb, x, y) -- Paint regular sub widgets the classic way InputContainer.paintTo(self, bb, x, y) - -- And explicitely paint "swipe" hints along the left and bottom borders + -- And explicitly paint "swipe" hints along the left and bottom borders self:paintLeftVerticalSwipeHint(bb, x, y) if not self.overview_mode then self:paintBottomHorizontalSwipeHint(bb, x, y) diff --git a/frontend/ui/widget/buttondialog.lua b/frontend/ui/widget/buttondialog.lua index b3522cb3d100..3cb9815e778b 100644 --- a/frontend/ui/widget/buttondialog.lua +++ b/frontend/ui/widget/buttondialog.lua @@ -122,7 +122,7 @@ function ButtonDialog:init() shrink_min_width = self.shrink_min_width, show_parent = self, } - local buttontable_width = self.buttontable:getSize().w -- may be shrinked + local buttontable_width = self.buttontable:getSize().w -- may be shrunk local title_widget, title_widget_height if self.title then diff --git a/frontend/ui/widget/container/alphacontainer.lua b/frontend/ui/widget/container/alphacontainer.lua index 3cd86969f61a..5fbb71fc810c 100644 --- a/frontend/ui/widget/container/alphacontainer.lua +++ b/frontend/ui/widget/container/alphacontainer.lua @@ -21,7 +21,7 @@ local WidgetContainer = require("ui/widget/container/widgetcontainer") local AlphaContainer = WidgetContainer:extend{ alpha = 1, - -- we cache a blitbuffer object for re-use here: + -- we cache a blitbuffer object for reuse here: private_bb = nil, } diff --git a/frontend/ui/widget/container/movablecontainer.lua b/frontend/ui/widget/container/movablecontainer.lua index 330e60ec9c67..5e36483e9ec1 100644 --- a/frontend/ui/widget/container/movablecontainer.lua +++ b/frontend/ui/widget/container/movablecontainer.lua @@ -30,7 +30,7 @@ local MovableContainer = InputContainer:extend{ alpha = nil, -- Move threshold (if move distance less than that, considered as a Hold - -- with no movement, used for reseting move to original position) + -- with no movement, used for resetting move to original position) move_threshold = Screen:scaleBySize(5), -- Events to ignore (ie: ignore_events={"hold", "hold_release"}) @@ -414,7 +414,7 @@ end function MovableContainer:resetEventState() -- Cancel some internal moving-or-about-to-move state. - -- Can be called explicitely to prevent bad widget interactions. + -- Can be called explicitly to prevent bad widget interactions. self._touch_pre_pan_was_inside = false self._moving = false end diff --git a/frontend/ui/widget/container/scrollablecontainer.lua b/frontend/ui/widget/container/scrollablecontainer.lua index 2eec01f27dd7..6a5b4c3ccd28 100644 --- a/frontend/ui/widget/container/scrollablecontainer.lua +++ b/frontend/ui/widget/container/scrollablecontainer.lua @@ -45,8 +45,8 @@ local ScrollableContainer = InputContainer:extend{ -- content_bottom = y of the content bottom of a row (included) -- that should not account for any top or bottom padding (which should be accounted in -- top/bottom), which will be used instead of top/bottom when looking for truncated rows. - -- The disctinction allows, if only some top or bottom padding is truncated, but not the - -- content, to consider it fully visible and to not need to be visible after the swipe, + -- The distinction allows (if only some top or bottom padding is truncated, but not the + -- content) to consider it fully visible and to not need to be visible after the swipe, -- but to still use these padding for the alignments. step_scroll_grid = nil, -- either this array step_scroll_grid_func = nil, -- or a function returning this array diff --git a/frontend/ui/widget/datetimewidget.lua b/frontend/ui/widget/datetimewidget.lua index ab16a9fe2fc2..68feee59e005 100644 --- a/frontend/ui/widget/datetimewidget.lua +++ b/frontend/ui/widget/datetimewidget.lua @@ -265,7 +265,7 @@ function DateTimeWidget:createLayout() self.sec_widget, -- 11 } - -- remove empty widgets plus trailling placeholder + -- remove empty widgets plus trailing placeholder for i = #date_group, 1, -2 do if date_group[i] == dummy_widget then table.remove(date_group, i) diff --git a/frontend/ui/widget/dictquicklookup.lua b/frontend/ui/widget/dictquicklookup.lua index 2c1f09a05758..408adb8cfaae 100644 --- a/frontend/ui/widget/dictquicklookup.lua +++ b/frontend/ui/widget/dictquicklookup.lua @@ -863,13 +863,13 @@ function DictQuickLookup:update() -- Update main text widgets if self.is_html and self.shw_widget then - -- Re-use our ScrollHtmlWidget (self.shw_widget) + -- Reuse our ScrollHtmlWidget (self.shw_widget) -- NOTE: The recursive free via our WidgetContainer (self[1]) above already released the previous MµPDF document instance ;) self.text_widget.htmlbox_widget:setContent(self.definition, self:getHtmlDictionaryCss(), Screen:scaleBySize(self.dict_font_size)) -- Scroll back to top self.text_widget:resetScroll() elseif not self.is_html and self.stw_widget then - -- Re-use our ScrollTextWidget (self.stw_widget) + -- Reuse our ScrollTextWidget (self.stw_widget) -- Update properties that may change across results (as done in DictQuickLookup:_instantiateScrollWidget()) self.text_widget.text_widget.text = self.definition self.text_widget.text_widget.charlist = nil -- (required when use_xtext=false for proper re-init) @@ -906,7 +906,7 @@ function DictQuickLookup:update() end function DictQuickLookup:getInitialVisibleArea() - -- Some positionning happens only at paintTo() time, but we want + -- Some positioning happens only at paintTo() time, but we want -- to know this before. So, do a bit like WidgetContainer does -- (without any MovableContainer offset) local dict_size = self.dict_frame:getSize() @@ -1337,12 +1337,12 @@ function DictQuickLookup:lookupWikipedia(get_fullpage, word, is_sane, lang) word = self.lookupword is_sane = true else - -- we use the original word that was querried + -- we use the original word that was queried word = self.word is_sane = false end end - -- Keep providing self.word_boxes so new windows keep being positionned to not hide it + -- Keep providing self.word_boxes so new windows keep being positioned to not hide it self.ui:handleEvent(Event:new("LookupWikipedia", word, is_sane, self.word_boxes, get_fullpage, lang)) end diff --git a/frontend/ui/widget/doublespinwidget.lua b/frontend/ui/widget/doublespinwidget.lua index 06ffddb92150..86b5a1d2e173 100644 --- a/frontend/ui/widget/doublespinwidget.lua +++ b/frontend/ui/widget/doublespinwidget.lua @@ -62,7 +62,7 @@ function DoubleSpinWidget:init() self.screen_height = Screen:getHeight() if not self.width then if not self.width_factor then - self.width_factor = 0.8 -- default if no width speficied + self.width_factor = 0.8 -- default if no width specified end self.width = math.floor(math.min(self.screen_width, self.screen_height) * self.width_factor) end diff --git a/frontend/ui/widget/focusmanager.lua b/frontend/ui/widget/focusmanager.lua index ad0b6c9de4ce..e4fb9e0fac0c 100644 --- a/frontend/ui/widget/focusmanager.lua +++ b/frontend/ui/widget/focusmanager.lua @@ -208,7 +208,7 @@ function FocusManager:onFocusPrevious() end function FocusManager:onFocusMove(args) - if not self.layout then -- allow parent focus manger to handle the event + if not self.layout then -- allow parent focus manager to handle the event return false end local dx, dy = unpack(args) diff --git a/frontend/ui/widget/footnotewidget.lua b/frontend/ui/widget/footnotewidget.lua index 47b11f71940d..b0a0dab1f12a 100644 --- a/frontend/ui/widget/footnotewidget.lua +++ b/frontend/ui/widget/footnotewidget.lua @@ -23,7 +23,7 @@ local time = require("ui/time") -- Note: we can't use < or > in comments in the CSS, or MuPDF complains with: -- error: css syntax error: unterminated comment. --- So, HTML tags in comments are written upppercase (eg:
  • => LI) +-- So, HTML tags in comments are written uppercase (eg:
  • => LI) -- Independent string for @page, so we can T() it individually, -- without needing to escape % in DEFAULT_CSS @@ -38,7 +38,7 @@ local PAGE_CSS = [[ -- Make default MuPDF styles (source/html/html-layout.c) a bit -- more similar to our epub.css ones, and more condensed to fit --- in a small bottom pannel +-- in a small bottom panel local DEFAULT_CSS = [[ body { margin: 0; /* MuPDF: margin: 1em */ @@ -119,7 +119,7 @@ body > section > title { local FootnoteWidget = InputContainer:extend{ html = nil, css = nil, - -- font_face can't really be overriden, it needs to be known by MuPDF + -- font_face can't really be overridden, it needs to be known by MuPDF font_face = "Noto Sans", -- For the doc_* values, we expect to be provided with the real -- (already scaled) sizes in screen pixels diff --git a/frontend/ui/widget/iconwidget.lua b/frontend/ui/widget/iconwidget.lua index 61e563d5f6e5..1c8f25d8bc9e 100644 --- a/frontend/ui/widget/iconwidget.lua +++ b/frontend/ui/widget/iconwidget.lua @@ -35,7 +35,7 @@ local IconWidget = ImageWidget:extend{ icon = ICON_NOT_FOUND, -- show this if not provided -- See ImageWidget for other available options, -- we only start with a few different defaults, that can - -- be overriden by callers. + -- be overridden by callers. width = Screen:scaleBySize(DGENERIC_ICON_SIZE), -- our icons are square height = Screen:scaleBySize(DGENERIC_ICON_SIZE), alpha = false, --- @note: Our icons have a transparent background, but, by default, we flatten them at caching time. diff --git a/frontend/ui/widget/imageviewer.lua b/frontend/ui/widget/imageviewer.lua index b13858290a04..6ddcba711509 100644 --- a/frontend/ui/widget/imageviewer.lua +++ b/frontend/ui/widget/imageviewer.lua @@ -437,7 +437,7 @@ function ImageViewer:_new_image_wg() self._image_wg = ImageWidget:new{ file = self.file, image = self.image, - image_disposable = false, -- we may re-use self.image + image_disposable = false, -- we may reuse self.image file_do_cache = false, alpha = true, -- we might be showing images with an alpha channel (e.g., from Wikipedia) width = max_image_w, @@ -828,7 +828,7 @@ function ImageViewer:onCloseWidget() -- Our ImageWidget (self._image_wg) is always a proper child widget, so it'll receive this event, -- and attempt to free its resources accordingly. -- But, if it didn't have to touch the original BB (self.image) passed to ImageViewer (e.g., no scaling needed), - -- it will *re-use* self.image, and flag it as non-disposable, meaning it will not have been free'd earlier. + -- it will *reuse* self.image, and flag it as non-disposable, meaning it will not have been free'd earlier. -- Since we're the ones who ultimately truly know whether we should dispose of self.image or not, do that now ;). if self.image and self.image_disposable and self.image.free then logger.dbg("ImageViewer:onCloseWidget: free self.image", self.image) diff --git a/frontend/ui/widget/imagewidget.lua b/frontend/ui/widget/imagewidget.lua index 76280246b0a7..b32284597ed2 100644 --- a/frontend/ui/widget/imagewidget.lua +++ b/frontend/ui/widget/imagewidget.lua @@ -284,7 +284,7 @@ function ImageWidget:_render() -- we get corrupted images when using it for scaling such blitbuffers. -- We need to make a real new blitbuffer with rotated content: local rot_bb = self._bb:rotatedCopy(self.rotation_angle) - -- We made a new blitbuffer, we need to explicitely free + -- We made a new blitbuffer, we need to explicitly free -- the old one to not leak memory if self._bb_disposable then self._bb:free() @@ -330,7 +330,7 @@ function ImageWidget:_render() -- replace blitbuffer with a resized one if needed if self.scale_factor == nil then - -- no scaling, but strech to width and height, only if provided and needed + -- no scaling, but stretch to width and height, only if provided and needed if self.width and self.height and (self.width ~= bb_w or self.height ~= bb_h) then logger.dbg("ImageWidget: stretching") self._bb = RenderImage:scaleBlitBuffer(self._bb, self.width, self.height, self._bb_disposable) @@ -583,7 +583,7 @@ function ImageWidget:paintTo(bb, x, y) -- In night mode, invert all rendered images, so the original is -- displayed when the whole screen is inverted by night mode. -- Except for our *black & white* icons: we do *NOT* want to invert them again: - -- they should match the UI's text/backgound. + -- they should match the UI's text/background. --- @note: As for *color* icons, we really *ought* to invert them here, --- but we currently don't, as we don't really trickle down --- a way to discriminate them from the B&W ones. @@ -594,7 +594,7 @@ function ImageWidget:paintTo(bb, x, y) end -- This will normally be called by our WidgetContainer:free() --- But it SHOULD explicitely be called if we are getting replaced +-- But it SHOULD explicitly be called if we are getting replaced -- (ie: in some other widget's update()), to not leak memory with -- BlitBuffer zombies function ImageWidget:free() diff --git a/frontend/ui/widget/infomessage.lua b/frontend/ui/widget/infomessage.lua index 9c5d0e98bfb9..313248f18533 100644 --- a/frontend/ui/widget/infomessage.lua +++ b/frontend/ui/widget/infomessage.lua @@ -11,7 +11,7 @@ Example: local sample sample = InfoMessage:new{ text = _("Some message"), - -- Usually the hight of a InfoMessage is self-adaptive. If this field is actively set, a + -- Usually the height of a InfoMessage is self-adaptive. If this field is actively set, a -- scrollbar may be shown. This variable is usually helpful to display a large chunk of text -- which may exceed the height of the screen. height = Screen:scaleBySize(400), diff --git a/frontend/ui/widget/inputdialog.lua b/frontend/ui/widget/inputdialog.lua index 1198a661f231..485ba5b82b01 100644 --- a/frontend/ui/widget/inputdialog.lua +++ b/frontend/ui/widget/inputdialog.lua @@ -60,7 +60,7 @@ To add |Save|Close| buttons, use: -- Stuff to do when InputDialog is closed, if anything. ) end - return nil -- sucess, default notification shown + return nil -- success, default notification shown return true, success_notif_text return false, error_infomsg_text end diff --git a/frontend/ui/widget/inputtext.lua b/frontend/ui/widget/inputtext.lua index fface2edd634..8a080cddf987 100644 --- a/frontend/ui/widget/inputtext.lua +++ b/frontend/ui/widget/inputtext.lua @@ -633,7 +633,7 @@ function InputText:onKeyPress(key) elseif key["Right"] then self:rightChar() -- NOTE: When we are not showing the virtual keyboard, let focusmanger handle up/down keys, as they are used to directly move around the widget - -- seemlessly in and out of text fields and onto virtual buttons like `[cancel] [search dict]`, no need to unfocus first. + -- seamlessly in and out of text fields and onto virtual buttons like `[cancel] [search dict]`, no need to unfocus first. elseif key["Up"] and G_reader_settings:nilOrTrue("virtual_keyboard_enabled") then self:upLine() elseif key["Down"] and G_reader_settings:nilOrTrue("virtual_keyboard_enabled") then diff --git a/frontend/ui/widget/keyvaluepage.lua b/frontend/ui/widget/keyvaluepage.lua index 1603246c3bda..75a9140556f3 100644 --- a/frontend/ui/widget/keyvaluepage.lua +++ b/frontend/ui/widget/keyvaluepage.lua @@ -286,8 +286,8 @@ local KeyValuePage = FocusManager:extend{ values_lang = nil, -- index for the first item to show show_page = 1, - -- aligment of value when key or value overflows its reserved width (for - -- now: 50%): "left" (stick to key), "right" (stick to scren right border) + -- alignment of value when key or value overflows its reserved width (for + -- now: 50%): "left" (stick to key), "right" (stick to screen's right border) value_overflow_align = "left", single_page = nil, -- show all items on one single page (and make them small) title_bar_align = "left", diff --git a/frontend/ui/widget/listview.lua b/frontend/ui/widget/listview.lua index a97d13eb0bca..c827540cfb8f 100644 --- a/frontend/ui/widget/listview.lua +++ b/frontend/ui/widget/listview.lua @@ -51,7 +51,7 @@ local ListView = InputContainer:extend{ height = nil, padding = nil, item_height = nil, - itmes = nil, + items = nil, } function ListView:init() diff --git a/frontend/ui/widget/menu.lua b/frontend/ui/widget/menu.lua index 348fc71eb94b..99dd3b00477e 100644 --- a/frontend/ui/widget/menu.lua +++ b/frontend/ui/widget/menu.lua @@ -1154,7 +1154,7 @@ function Menu:mergeTitleBarIntoLayout() end --[[ - the itemnumber paramter determines menu page number after switching item table + the itemnumber parameter determines menu page number after switching item table 1. itemnumber >= 0 the page number is calculated with items per page 2. itemnumber == nil @@ -1497,10 +1497,10 @@ function Menu:setTitleBarLeftIcon(icon) self.title_bar:setLeftIcon(icon) end -function Menu:onLeftButtonTap() -- to be overriden and implemented by the caller +function Menu:onLeftButtonTap() -- to be overridden and implemented by the caller end -function Menu:onLeftButtonHold() -- to be overriden and implemented by the caller +function Menu:onLeftButtonHold() -- to be overridden and implemented by the caller end function Menu:getFirstVisibleItemIndex() diff --git a/frontend/ui/widget/pagebrowserwidget.lua b/frontend/ui/widget/pagebrowserwidget.lua index a2088608114b..85105d27aa51 100644 --- a/frontend/ui/widget/pagebrowserwidget.lua +++ b/frontend/ui/widget/pagebrowserwidget.lua @@ -240,7 +240,7 @@ function PageBrowserWidget:updateLayout() -- which should span over the page slots that get their thumbnails shown. self.view_finder_r = Size.radius.window self.view_finder_bw = Size.border.default - -- Have its top border noticable above the BookMapRow top border + -- Have its top border noticeable above the BookMapRow top border self.view_finder_y = self.dimen.h - self.row_height - 2*self.view_finder_bw -- And put its bottom rounded corner outside of screen self.view_finder_h = self.row_height + 2*self.view_finder_bw + Size.radius.window @@ -678,7 +678,7 @@ function PageBrowserWidget:paintTo(bb, x, y) -- bb:paintRect(r.x, r.y, r.w, r.h, Blitbuffer.COLOR_GRAY_5) -- But we prefer them translucent, so we can draw them over chapter spans -- without getting bothered too much by them (alpha=0.3 feels fine). - -- Only hatchRect() currently supports paiting with alpha, + -- Only hatchRect() currently supports painting with alpha, -- so use it to fill our rectangle by using a larger stripe_width -- so it is fully filled. bb:hatchRect(r.x, r.y, r.w, r.h, r.h, Blitbuffer.COLOR_BLACK, 0.3) @@ -687,7 +687,7 @@ function PageBrowserWidget:paintTo(bb, x, y) -- If we would prefer to see the BookMapRow top border always take the full width -- so it acts as a separator from the thumbnail grid, add this: -- bb:paintRect(0, self.dimen.h - self.row_height, self.dimen.w, BookMapRow.pages_frame_border, Blitbuffer.COLOR_BLACK) - -- And explicitely paint our viewfinder over the BookMapRow + -- And explicitly paint our viewfinder over the BookMapRow bb:paintBorder(self.view_finder_x, self.view_finder_y, self.view_finder_w, self.view_finder_h, self.view_finder_bw, Blitbuffer.COLOR_BLACK, self.view_finder_r) end @@ -1079,7 +1079,7 @@ function PageBrowserWidget:onClose(close_all_parents) -- with the current size to be available) self.ui.thumbnail:tidyCache() -- Force a GC to free the memory used by the widgets and tiles - -- (delay it a bit so this pause is less noticable) + -- (delay it a bit so this pause is less noticeable) UIManager:scheduleIn(0.5, function() collectgarbage() collectgarbage() @@ -1465,7 +1465,7 @@ function PageBrowserWidget:onHold(arg, ges) -- our current focus_page to help locating where we were (it's -- quite more complicated to draw a rounded rectangle around -- multiple pages to figure our view finder, as these pages - -- may be splitted onto multiple BookMapRows...) + -- may be split onto multiple BookMapRows...) if ges.pos.y > Screen:getHeight() - self.row_height then local page = self.row[1]:getPageAtX(ges.pos.x) if page then diff --git a/frontend/ui/widget/spinwidget.lua b/frontend/ui/widget/spinwidget.lua index b8df9748bbf5..540dac5dd5f5 100644 --- a/frontend/ui/widget/spinwidget.lua +++ b/frontend/ui/widget/spinwidget.lua @@ -60,7 +60,7 @@ function SpinWidget:init() self.screen_height = Screen:getHeight() if not self.width then if not self.width_factor then - self.width_factor = 0.6 -- default if no width speficied + self.width_factor = 0.6 -- default if no width specified end self.width = math.floor(math.min(self.screen_width, self.screen_height) * self.width_factor) end diff --git a/frontend/ui/widget/textboxwidget.lua b/frontend/ui/widget/textboxwidget.lua index ce6bab9d2a74..beff0b570f74 100644 --- a/frontend/ui/widget/textboxwidget.lua +++ b/frontend/ui/widget/textboxwidget.lua @@ -41,8 +41,8 @@ local TextBoxWidget = InputContainer:extend{ alignment = "left", -- or "center", "right" dialog = nil, -- parent dialog that will be set dirty face = nil, - bold = nil, -- use bold=true to use a real bold font (or synthetized if not available), - -- or bold=Font.FORCE_SYNTHETIZED_BOLD to force using synthetized bold, + bold = nil, -- use bold=true to use a real bold font (or synthesized if not available), + -- or bold=Font.FORCE_SYNTHETIZED_BOLD to force using synthesized bold, -- which, with XText, makes a bold string the same width as it non-bolded. line_height = 0.3, -- in em fgcolor = Blitbuffer.COLOR_BLACK, @@ -101,7 +101,7 @@ local TextBoxWidget = InputContainer:extend{ auto_para_direction = false, -- detect direction of each paragraph in text -- (para_direction_rtl or UI language is then only -- used as a weak hint about direction) - alignment_strict = false, -- true to force the alignemnt set by the alignment= attribute. + alignment_strict = false, -- true to force the alignment set by the alignment= attribute. -- When false, specified alignment is inverted when para direction is RTL tabstop_nb_space_width = 8, -- unscaled_size_check: ignore -- width of tabstops, as a factor of the width of a space @@ -404,11 +404,11 @@ function TextBoxWidget:_splitToLines() end self.vertical_string_list[ln] = line if line.no_allowed_break_met then - -- let the fact a long word was splitted be known + -- let the fact a long word was split be known self.has_split_inside_word = true end if line.hard_newline_at_eot and not line.next_start_offset then - -- Add an empty line to reprensent the \n at end of text + -- Add an empty line to represent the \n at end of text -- and allow positioning cursor after it self.vertical_string_list[ln+1] = { offset = size+1, @@ -460,7 +460,7 @@ function TextBoxWidget:_splitToLines() -- either a very long english word occupying more than one line, -- or the excessive char is itself splittable: -- we let that excessive char for next line - if adjusted_idx == offset then -- let the fact a long word was splitted be known + if adjusted_idx == offset then -- let the fact a long word was split be known self.has_split_inside_word = true end end_offset = idx - 1 @@ -479,7 +479,7 @@ function TextBoxWidget:_splitToLines() idx = adjusted_idx + 1 end if self.justified then - -- this line was splitted and can be justified + -- this line was split and can be justified -- we record in idx_pad the nb of pixels to add to each char -- to make the whole line justified. This also helps hold -- position accuracy. @@ -856,7 +856,7 @@ function TextBoxWidget:_renderText(start_row_idx, end_row_idx) if self.line_with_ellipsis and i == self.line_with_ellipsis and not line.ellipsis_added then -- Requested to add an ellipsis on this line local ellipsis_width = RenderText:getEllipsisWidth(self.face) - -- no bold: xtext does synthetized bold with normal metrics + -- no bold: xtext does synthesized bold with normal metrics line.width = line.width + ellipsis_width if line.width > line.targeted_width then -- The ellipsis would overflow: we need to re-makeLine() @@ -1241,7 +1241,7 @@ function TextBoxWidget:free(full) if full ~= false then -- final free(): free all remaining resources if self.use_xtext and self._xtext then -- Allow not waiting until Lua gc() to cleanup C XText malloc'ed stuff - -- (we should not free it if full=false as it is re-usable across renderings) + -- (we should not free it if full=false as it is reusable across renderings) self._xtext:free() self._xtext = nil -- logger.dbg("TextBoxWidget:_xtext:free()") @@ -1674,7 +1674,7 @@ function TextBoxWidget:moveCursorToCharPos(charpos) -- needs to deal with possible overflow ? y = y - scroll_lines * self.line_height_px end - -- We can also get x ouside current view, when a line takes the full width + -- We can also get x outside current view, when a line takes the full width -- (which happens when text is justified): move the cursor a bit to the left -- (it will be drawn over the right of the last glyph, which should be ok.) if x > self.width - self.cursor_line.dimen.w then @@ -1711,7 +1711,7 @@ function TextBoxWidget:moveCursorToCharPos(charpos) self._bb:blitFrom(self.cursor_restore_bb, self.cursor_restore_x, self.cursor_restore_y, 0, 0, self.cursor_line.dimen.w, self.cursor_line.dimen.h) -- remember current values for use in the setDirty funcs, as - -- we will have overriden them when these are called + -- we will have overridden them when these are called restore_x = self.cursor_restore_x restore_y = self.cursor_restore_y if not CURSOR_COMBINE_REGIONS then @@ -1939,7 +1939,7 @@ function TextBoxWidget:onHoldWord(callback, ges) local words = util.splitToWords(self:_getLineText(line)) local probe_idx = char_start for _, w in ipairs(words) do - -- +1 for word separtor + -- +1 for word separator probe_idx = probe_idx + #util.splitToChars(w) if idx <= probe_idx - 1 then callback(w) @@ -2024,7 +2024,7 @@ function TextBoxWidget:onHoldReleaseText(callback, ges) local ImageViewer = require("ui/widget/imageviewer") local imgviewer = ImageViewer:new{ image = image.hi_bb or image.bb, -- fallback to low-res if high-res failed - image_disposable = false, -- we may re-use our bb if called again + image_disposable = false, -- we may reuse our bb if called again with_title_bar = true, title_text = image.title, caption = image.caption, diff --git a/frontend/ui/widget/textwidget.lua b/frontend/ui/widget/textwidget.lua index f27a3c12881f..4f83c9091283 100644 --- a/frontend/ui/widget/textwidget.lua +++ b/frontend/ui/widget/textwidget.lua @@ -27,8 +27,8 @@ local xtext -- Delayed (and optional) loading local TextWidget = Widget:extend{ text = nil, face = nil, - bold = false, -- use bold=true to use a real bold font (or synthetized if not available), - -- or bold=Font.FORCE_SYNTHETIZED_BOLD to force using synthetized bold, + bold = false, -- use bold=true to use a real bold font (or synthesized if not available), + -- or bold=Font.FORCE_SYNTHETIZED_BOLD to force using synthesized bold, -- which, with XText, makes a bold string the same width as it non-bolded. fgcolor = Blitbuffer.COLOR_BLACK, padding = Size.padding.small, -- vertical padding (should it be function of face.size ?) @@ -212,7 +212,7 @@ function TextWidget:_measureWithXText() -- a TextWidget, with use_xtext, to have it compute the width of -- the ellipsis, and then cache this width in the font table.) reserved_width = RenderText:getEllipsisWidth(self.face) - -- no bold: xtext does synthetized bold with normal metrics + -- no bold: xtext does synthesized bold with normal metrics end local max_width = self.max_width - reserved_width if max_width <= 0 then -- avoid _xtext:makeLine() crash diff --git a/frontend/ui/widget/titlebar.lua b/frontend/ui/widget/titlebar.lua index b899d286f242..b5bff47ba370 100644 --- a/frontend/ui/widget/titlebar.lua +++ b/frontend/ui/widget/titlebar.lua @@ -30,7 +30,7 @@ local TitleBar = OverlapGroup:extend{ title_face = nil, -- if not provided, one of these will be used: title_face_fullscreen = Font:getFace("smalltfont"), title_face_not_fullscreen = Font:getFace("x_smalltfont"), - -- by default: single line, truncated if overflow -- the default could be made dependant on self.fullscreen + -- by default: single line, truncated if overflow -- the default could be made dependent on self.fullscreen title_multilines = false, -- multilines if overflow title_shrink_font_to_fit = false, -- reduce font size so that single line text fits @@ -159,7 +159,7 @@ function TitleBar:init() -- We're with title_shrink_font_to_fit and in the first :init(): -- we don't want to go on measuring with this too long text. -- We want metrics proper for when text fits, so if later :setTitle() - -- is called with a text that fits, this text will look allright. + -- is called with a text that fits, this text will look alright. -- Longer title with a smaller font size should be laid out on the -- baseline of a fitted text. -- So, go on computing sizes with an empty title. When all is @@ -224,7 +224,7 @@ function TitleBar:init() } end end - -- To debug vertical positionning: + -- To debug vertical positioning: -- local FrameContainer = require("ui/widget/container/framecontainer") -- self.title_widget = FrameContainer:new{ padding=0, margin=0, bordersize=1, self.title_widget} -- self.subtitle_widget = FrameContainer:new{ padding=0, margin=0, bordersize=1, self.subtitle_widget} diff --git a/frontend/ui/widget/touchmenu.lua b/frontend/ui/widget/touchmenu.lua index 7f156ab8a1f1..50b40620d82d 100644 --- a/frontend/ui/widget/touchmenu.lua +++ b/frontend/ui/widget/touchmenu.lua @@ -304,10 +304,10 @@ function TouchMenuBar:init() self.bar_icon_group = HorizontalGroup:new{} -- build up image widget for menu icon bar self.icon_widgets = {} - -- hold icon seperators + -- hold icon separators self.icon_seps = {} -- the start_seg for first icon_widget should be 0 - -- we asign negative here to offset it in the loop + -- we assign negative here to offset it in the loop local start_seg = -icon_sep_width local end_seg = start_seg -- self.width is the screen width @@ -784,7 +784,7 @@ function TouchMenu:switchMenuTab(tab_num) self.tab_item_table[tab_num].callback() end - -- It's like getting a new menu everytime we switch tab! + -- It's like getting a new menu every time we switch tab! -- Also, switching to the _same_ tab resets the stack and takes us back to -- the top of the menu tree self.page = 1 @@ -1092,7 +1092,7 @@ function TouchMenu:openMenu(path, with_animation) local function walkStep() walkStep_scheduled = false - -- Default delay if not overriden (-1 means no scheduleIn() so no refresh, 0 means nextTick) + -- Default delay if not overridden (-1 means no scheduleIn() so no refresh, 0 means nextTick) local next_delay = with_animation and 1 or -1 if step == STEPS.START then -- Ensure some initial delay so search dialog and result list can be closed and refreshed @@ -1224,7 +1224,7 @@ function TouchMenu:openMenu(path, with_animation) end, resend_event = not with_animation, -- if not animation, don't eat the tap } - UIManager:show(trap_widget) -- catch taps during animaton + UIManager:show(trap_widget) -- catch taps during animation -- Call it: it will reschedule itself if animation; if not, it will -- just execute itself without pause until done. diff --git a/frontend/ui/widget/trapwidget.lua b/frontend/ui/widget/trapwidget.lua index c4b3242909e4..a5b77cb99dfa 100644 --- a/frontend/ui/widget/trapwidget.lua +++ b/frontend/ui/widget/trapwidget.lua @@ -117,7 +117,7 @@ function TrapWidget:_dismissAndResend(evtype, ev) -- There may be some timing issues that could cause crashes, as we -- use nextTick, if the dismiss_callback uses UIManager:scheduleIn() -- or has set up some widget that may catch that event while not being - -- yet fully initialiazed. + -- yet fully initialized. -- (It happened mostly when I had some bug somewhere, and it was a quite -- reliable sign of a bug somewhere, but the stacktrace was unrelated -- to the bug location.) diff --git a/frontend/ui/wikipedia.lua b/frontend/ui/wikipedia.lua index 33555648df22..b7ccf886c23d 100644 --- a/frontend/ui/wikipedia.lua +++ b/frontend/ui/wikipedia.lua @@ -54,7 +54,7 @@ local Wikipedia = { wiki_phtml_params = { action = "parse", format = "json", - -- we only need the following informations + -- we only need the following pieces of information prop = "text|sections|displaytitle|revid", -- page = nil, -- text to lookup, will be added below -- disabletoc = "", -- if we want to remove toc IN html @@ -67,7 +67,7 @@ local Wikipedia = { wiki_images_params = { -- same as previous one, with just text html action = "parse", format = "json", - -- we only need the following informations + -- we only need the following pieces of information prop = "text", -- page = nil, -- text to lookup, will be added below redirects = "", @@ -346,7 +346,7 @@ function Wikipedia:getFullPageImages(wiki_title, lang) end local width = tonumber(timg:match([[width="([^"]*)"]])) local height = tonumber(timg:match([[height="([^"]*)"]])) - -- Ignore img without width and height, which should exlude + -- Ignore img without width and height, which should exclude -- javascript maps and other unsupported stuff if width and height then -- Images in the html we got seem to be x4.5 the size of @@ -582,7 +582,7 @@ end -- UTF8 of unicode geometrical shapes we'll prepend to wikipedia section headers, --- to help identifying hierarchy (othewise, the small font size differences helps). +-- to help identifying hierarchy (otherwise, the small font size differences helps). -- Best if identical to the ones used above for prettifying full plain text page. -- These chosen ones are available in most fonts (prettier symbols -- exist in unicode, but are available in a few fonts only) and @@ -1417,7 +1417,7 @@ abbr.abbr { -- crengine does not support the family of tags for displaying formulas, -- which results in lots of space taken by individual character in the formula, -- each on a single line... - -- Also, usally, these tags are followed by a tag pointing to a + -- Also, usually, these tags are followed by a tag pointing to a -- SVG version of the formula, that we took care earlier to change the url to -- point to a PNG version of the formula (which is still not perfect, as it does -- not adjust to the current html font size, but it is at least readable). @@ -1442,7 +1442,7 @@ abbr.abbr { end html = html:gsub([[href="/wiki/([^"]*)"]], cleanWikiPageTitle) - -- Remove href from links to non existant wiki page so they are not clickable : + -- Remove href from links to nonexistent wiki page so they are not clickable : -- PageTitle____on -- (removal of the href="" will make them non clickable) diff --git a/platform/remarkable/koreader.sh b/platform/remarkable/koreader.sh index b271a6ce0871..f0abe396fb95 100755 --- a/platform/remarkable/koreader.sh +++ b/platform/remarkable/koreader.sh @@ -22,7 +22,7 @@ ko_update_check() { INSTALLED="${KOREADER_DIR}/ota/koreader.installed.tar" if [ -f "${NEWUPDATE}" ]; then # If button-listen service is running then stop it during update so that - # the update can overwite the binary + # the update can overwrite the binary systemctl is-active --quiet button-listen USING_BUTTON_LISTEN=$? if [ ${USING_BUTTON_LISTEN} -eq 0 ]; then diff --git a/plugins/autosuspend.koplugin/main.lua b/plugins/autosuspend.koplugin/main.lua index 892aaf0f1978..fcc79d2014d0 100644 --- a/plugins/autosuspend.koplugin/main.lua +++ b/plugins/autosuspend.koplugin/main.lua @@ -549,7 +549,7 @@ function AutoSuspend:addToMainMenu(menu_items) keep_menu_open = true, callback = function(touchmenu_instance) -- 5*60 sec (5') is the minimum and 28*24*3600 (28days) is the maximum shutdown time. - -- Minimum time has to be big enough, to avoid start-stop death scenarious. + -- Minimum time has to be big enough, to avoid start-stop death scenarios. -- Maximum more than four weeks seems a bit excessive if you want to enable authoshutdown, -- even if the battery can last up to three months. self:pickTimeoutValue(touchmenu_instance, diff --git a/plugins/autowarmth.koplugin/main.lua b/plugins/autowarmth.koplugin/main.lua index d51322698c58..7e6216b5d2c3 100644 --- a/plugins/autowarmth.koplugin/main.lua +++ b/plugins/autowarmth.koplugin/main.lua @@ -110,7 +110,7 @@ function AutoWarmth:init() i = j end - -- schedule recalculation shortly afer midnight + -- schedule recalculation shortly after midnight self:scheduleMidnightUpdate() end @@ -676,7 +676,7 @@ function AutoWarmth:getFlOffDuringDayMenu() • off after sunrise and • on before sunset.]], ok_always_enabled = true, - -- read the saved setting, as this get's not overwritten by toggling easy_mode + -- read the saved setting, as this gets overwritten by toggling easy_mode value = G_reader_settings:readSetting("autowarmth_fl_off_during_day_offset_s", 0) * (1/60), value_min = -15, value_max = 30, diff --git a/plugins/autowarmth.koplugin/suntime.lua b/plugins/autowarmth.koplugin/suntime.lua index 9b6f46c6e827..23c595cd886e 100644 --- a/plugins/autowarmth.koplugin/suntime.lua +++ b/plugins/autowarmth.koplugin/suntime.lua @@ -24,7 +24,7 @@ Maximal errors from 2020-2050 (compared to https://midcdmz.nrel.gov/spa/) are: *) A few days around beginning of summer (error <290s) -**) A few days after and befor midnight sun (error <1200s) +**) A few days after and before midnight sun (error <1200s) @usage local SunTime = require("suntime") @@ -45,7 +45,7 @@ Maximal errors from 2020-2050 (compared to https://midcdmz.nrel.gov/spa/) are: @module suntime --]]-- --- math abbrevations +-- math abbreviations local pi = math.pi local pi_2 = pi/2 @@ -131,7 +131,7 @@ function SunTime:getZglAdvanced() end -- set current date or year/month/day daylightsaving hh/mm/ss --- if dst == nil use curent daylight saving of the system +-- if dst == nil use current daylight saving of the system local days_in_month = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} function SunTime:setDate(year, month, day, dst, hour, min, sec) @@ -167,7 +167,7 @@ Set position for later calculations @param longitude Geographical longitude, West is negative @param time_zone Timezone e.g. CET = +1; if nil try to autodetect the current zone @param altitude Altitude of the location above the sea level -@param degree if `nil` latitude and longitue are in radian, else in decimal degree +@param degree if `nil` latitude and longitude are in radian, else in decimal degree --]]-- function SunTime:setPosition(name, latitude, longitude, time_zone, altitude, degree) altitude = altitude or 200 @@ -442,7 +442,7 @@ function SunTime:calculateNoon(hour) return hour + local_correction + aberration_time end end - else -- sourthern hemisphere + else -- southern hemisphere if pi_2 + self.pos.latitude - self.decl > self.eod then if self:getHeight(hour) > 0 then return hour + local_correction + aberration_time @@ -466,7 +466,7 @@ function SunTime:calculateMidnight(hour) return hour + local_correction end end - else -- sourthern hemisphere + else -- southern hemisphere if pi_2 + self.pos.latitude + self.decl > self.eod then if self:getHeight(hour) < 0 then return hour + local_correction diff --git a/plugins/backgroundrunner.koplugin/wrapper.sh b/plugins/backgroundrunner.koplugin/wrapper.sh index 1799196cb71c..3f56414ce8df 100755 --- a/plugins/backgroundrunner.koplugin/wrapper.sh +++ b/plugins/backgroundrunner.koplugin/wrapper.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Starts the arguments as a bash command in background with low priorty. The +# Starts the arguments as a bash command in background with low priority. The # command will be killed if it executes for over 1 hour. If the command failed # to start, this script returns 127. If the command is timed out, this script # returns 255. Otherwise the return value of the command will be returned. diff --git a/plugins/coverbrowser.koplugin/bookinfomanager.lua b/plugins/coverbrowser.koplugin/bookinfomanager.lua index 35bf25c75a60..d4a9d91e31d3 100644 --- a/plugins/coverbrowser.koplugin/bookinfomanager.lua +++ b/plugins/coverbrowser.koplugin/bookinfomanager.lua @@ -115,7 +115,7 @@ local BOOKINFO_SELECT_SQL = "SELECT " .. table.concat(BOOKINFO_COLS_SET, ",") .. "WHERE directory=? AND filename=? AND in_progress=0;" local BOOKINFO_IN_PROGRESS_SQL = "SELECT in_progress, filename, unsupported FROM bookinfo WHERE directory=? AND filename=?;" --- We need these _ litterals for them to be made available to translators. the english "string" is +-- We need these _ literals for them to be made available to translators. the english "string" is -- what is inserted in the DB, and it will be translated only when read from the DB and displayed. local UNSUPPORTED_REASONS = { not_readable_by_engine = { @@ -306,7 +306,7 @@ function BookInfoManager:saveSetting(key, value, db_conn, skip_reload) value = "Y" end stmt:bind(key, value) - stmt:step() -- commited + stmt:step() -- committed stmt:clearbind():reset() -- cleanup -- Optionally, reload settings, so we may get (or not if it failed) what we just saved @@ -465,7 +465,7 @@ function BookInfoManager:extractBookInfo(filepath, cover_specs) for num, col in ipairs(BOOKINFO_COLS_SET) do self.set_stmt:bind1(num, dbrow[col]) end - self.set_stmt:step() -- commited + self.set_stmt:step() -- committed self.set_stmt:clearbind():reset() -- get ready for next query if tried_enough then return -- Last insert done for this book, we're giving up @@ -566,7 +566,7 @@ function BookInfoManager:setBookInfoProperties(filepath, props) v = nil end stmt:bind(v, directory, filename) - stmt:step() -- commited + stmt:step() -- committed stmt:clearbind():reset() -- cleanup end end @@ -577,7 +577,7 @@ function BookInfoManager:deleteBookInfo(filepath) local query = "DELETE FROM bookinfo WHERE directory=? AND filename=?;" local stmt = self.db_conn:prepare(query) stmt:bind(directory, filename) - stmt:step() -- commited + stmt:step() -- committed stmt:clearbind():reset() -- cleanup end @@ -599,7 +599,7 @@ function BookInfoManager:removeNonExistantEntries() local stmt = self.db_conn:prepare(query) for i=1, #bcids_to_remove do stmt:bind(bcids_to_remove[i]) - stmt:step() -- commited + stmt:step() -- committed stmt:clearbind():reset() -- cleanup end return T(_("Removed %1 / %2 entries from cache."), #bcids_to_remove, #bcids) @@ -702,7 +702,7 @@ function BookInfoManager:extractInBackground(files) -- Run task in sub-process, and remember its pid local task_pid = FFIUtil.runInSubProcess(task) if not task_pid then - logger.warn("Failed lauching background extraction sub-process (fork failed)") + logger.warn("Failed launching background extraction sub-process (fork failed)") return false -- let caller know it failed end -- No straight control flow exists for background task completion here, so we bump prevent diff --git a/plugins/coverbrowser.koplugin/covermenu.lua b/plugins/coverbrowser.koplugin/covermenu.lua index 8e924b320361..d9ecc1967b73 100644 --- a/plugins/coverbrowser.koplugin/covermenu.lua +++ b/plugins/coverbrowser.koplugin/covermenu.lua @@ -10,9 +10,9 @@ local BookInfoManager = require("bookinfomanager") -- This is a kind of "base class" for both MosaicMenu and ListMenu. -- It implements the common code shared by these, mostly the non-UI --- work : the updating of items and the management of backgrouns jobs. +-- work : the updating of items and the management of background jobs. -- --- Here are defined the common overriden methods of Menu: +-- Here the common overridden methods of Menu are defined: -- :updateItems(select_number) -- :onCloseWidget() -- @@ -117,7 +117,7 @@ function CoverMenu:updateItems(select_number, no_recalculate_dimen) -- when memory usage is already high nb_drawings_since_last_collectgarbage = nb_drawings_since_last_collectgarbage + 1 if nb_drawings_since_last_collectgarbage >= NB_DRAWINGS_BETWEEN_COLLECTGARBAGE then - -- (delay it a bit so this pause is less noticable) + -- (delay it a bit so this pause is less noticeable) UIManager:scheduleIn(0.2, function() collectgarbage() collectgarbage() @@ -131,7 +131,7 @@ function CoverMenu:updateItems(select_number, no_recalculate_dimen) -- Set the local variables with the things we know -- These are used only by extractBooksInDirectory(), which should -- use the cover_specs set for FileBrowser, and not those from History. - -- Hopefully, we get self.path=nil when called fro History + -- Hopefully, we get self.path=nil when called from History if self.path then current_path = self.path current_cover_specs = self.cover_specs @@ -356,7 +356,7 @@ function CoverMenu:onHistoryMenuHold(item) end, }, { -- Allow user to ignore some bad metadata (filename will be used instead) - text = bookinfo.ignore_meta and _("Unignore metadata") or _("Ignore metadata"), + text = noticeablebookinfo.ignore_meta and _("Unignore metadata") or _("Ignore metadata"), enabled = bookinfo.has_meta and true or false, callback = function() BookInfoManager:setBookInfoProperties(file, { @@ -490,7 +490,7 @@ function CoverMenu:onCloseWidget() self.cover_info_cache = nil -- Force garbage collecting when leaving too - -- (delay it a bit so this pause is less noticable) + -- (delay it a bit so this pause is less noticeable) UIManager:scheduleIn(0.2, function() collectgarbage() collectgarbage() diff --git a/plugins/coverbrowser.koplugin/listmenu.lua b/plugins/coverbrowser.koplugin/listmenu.lua index ba43e42eb16b..a5db0dbae47c 100644 --- a/plugins/coverbrowser.koplugin/listmenu.lua +++ b/plugins/coverbrowser.koplugin/listmenu.lua @@ -150,13 +150,13 @@ function ListMenuItem:init() }, } - -- We now build the minimal widget container that won't change after udpate() + -- We now build the minimal widget container that won't change after update() -- As done in MenuItem -- for compatibility with keyboard navigation -- (which does not seem to work well when multiple pages, -- even with classic menu) - self.underline_h = 1 -- smaller than default (3) to not shift our vertical aligment + self.underline_h = 1 -- smaller than default (3) to not shift our vertical alignment self._underline_container = UnderlineContainer:new{ vertical_align = "top", padding = 0, @@ -176,7 +176,7 @@ function ListMenuItem:init() end function ListMenuItem:update() - -- We will be a disctinctive widget whether we are a directory, + -- We will be a distinctive widget whether we are a directory, -- a known file with image / without image, or a not yet known file local widget @@ -278,7 +278,7 @@ function ListMenuItem:update() else -- cover was not fetched previously, do as if not found -- to force a new extraction - bookinfo = nil + bookinfonoticeable = nil end end @@ -341,7 +341,7 @@ function ListMenuItem:update() } end end - -- In case we got a blitbuffer and didnt use it (ignore_cover), free it + -- In case we got a blitbuffer and didn't use it (ignore_cover), free it if bookinfo.cover_bb and not cover_bb_used then bookinfo.cover_bb:free() end @@ -375,7 +375,7 @@ function ListMenuItem:update() local filename_without_suffix, filetype = filemanagerutil.splitFileNameType(filename) local fileinfo_str if bookinfo._no_provider then - -- for unspported files: don't show extension on the right, + -- for unsupported files: don't show extension on the right, -- keep it in filename filename_without_suffix = filename fileinfo_str = self.mandatory @@ -489,7 +489,7 @@ function ListMenuItem:update() -- whether to use or not title and authors -- (We wrap each metadata text with BD.auto() to get for each of them -- the text direction from the first strong character - which should - -- individually be the best thing, and additionnaly prevent shuffling + -- individually be the best thing, and additionally prevent shuffling -- if concatenated.) if self.do_filename_only or bookinfo.ignore_meta then title = filename_without_suffix -- made out above @@ -719,7 +719,7 @@ function ListMenuItem:update() face = Font:getFace("cfont", fontsize_info), fgcolor = fgcolor, } - local wpageinfo = TextWidget:new{ -- Empty but needed for similar positionning + local wpageinfo = TextWidget:new{ -- Empty but needed for similar positioning text = "", face = Font:getFace("cfont", fontsize_info), } diff --git a/plugins/coverbrowser.koplugin/main.lua b/plugins/coverbrowser.koplugin/main.lua index 994a168ba7cb..f9f5cfd6e77a 100644 --- a/plugins/coverbrowser.koplugin/main.lua +++ b/plugins/coverbrowser.koplugin/main.lua @@ -546,7 +546,7 @@ end function CoverBrowser:setupFileManagerDisplayMode(display_mode) if not DISPLAY_MODES[display_mode] then - display_mode = nil -- unknow mode, fallback to classic + display_mode = nil -- unknown mode, fallback to classic end if init_done and display_mode == filemanager_display_mode then -- no change return @@ -677,7 +677,7 @@ end function CoverBrowser:setupHistoryDisplayMode(display_mode) if not DISPLAY_MODES[display_mode] then - display_mode = nil -- unknow mode, fallback to classic + display_mode = nil -- unknown mode, fallback to classic end if init_done and display_mode == history_display_mode then -- no change return @@ -756,7 +756,7 @@ end function CoverBrowser:setupCollectionDisplayMode(display_mode) if not DISPLAY_MODES[display_mode] then - display_mode = nil -- unknow mode, fallback to classic + display_mode = nil -- unknown mode, fallback to classic end if init_done and display_mode == collection_display_mode then -- no change return diff --git a/plugins/coverbrowser.koplugin/mosaicmenu.lua b/plugins/coverbrowser.koplugin/mosaicmenu.lua index 511f08ed99cb..81ebef9d5ce0 100644 --- a/plugins/coverbrowser.koplugin/mosaicmenu.lua +++ b/plugins/coverbrowser.koplugin/mosaicmenu.lua @@ -154,7 +154,7 @@ function FakeCover:init() if not authors and title and self.filename and self.filename:sub(1,title:len()) == title then bd_wrap_title_as_filename = true -- Replace a hyphen surrounded by spaces (which most probably was - -- used to separate Authors/Title/Serie/Year/Categorie in the + -- used to separate Authors/Title/Series/Year/Categories in the -- filename with a \n title = title:gsub(" %- ", "\n") -- Same with | @@ -165,9 +165,9 @@ function FakeCover:init() -- can also have some meaning, so we can't just remove them. -- But at least, make dots breakable (they wouldn't be if not -- followed by a space), by adding to them a zero-width-space, - -- so the dots stay on the right of their preceeding word. + -- so the dots stay on the right of their preceding word. title = title:gsub("%.", ".\u{200B}") - -- Except for a last dot near end of title that might preceed + -- Except for a last dot near end of title that might precede -- a file extension: we'd rather want the dot and its suffix -- together on a last line: so, move the zero-width-space -- before it. @@ -402,7 +402,7 @@ function MosaicMenuItem:init() }, } - -- We now build the minimal widget container that won't change after udpate() + -- We now build the minimal widget container that won't change after update() -- As done in MenuItem -- for compatibility with keyboard navigation @@ -434,7 +434,7 @@ function MosaicMenuItem:init() end function MosaicMenuItem:update() - -- We will be a disctinctive widget whether we are a directory, + -- We will be a distinctive widget whether we are a directory, -- a known file with image / without image, or a not yet known file local widget @@ -665,7 +665,7 @@ function MosaicMenuItem:update() } } end - -- In case we got a blitbuffer and didnt use it (ignore_cover, wikipedia), free it + -- In case we got a blitbuffer and didn't use it (ignore_cover, wikipedia), free it if bookinfo.cover_bb and not cover_bb_used then bookinfo.cover_bb:free() end @@ -901,7 +901,7 @@ function MosaicMenu:_recalculateDimen() } -- Create or replace corner_mark if needed - -- 1/12 (larger) or 1/16 (smaller) of cover looks allright + -- 1/12 (larger) or 1/16 (smaller) of cover looks alright local mark_size = math.floor(math.min(self.item_width, self.item_height) / 8) if mark_size ~= corner_mark_size then corner_mark_size = mark_size diff --git a/plugins/coverimage.koplugin/main.lua b/plugins/coverimage.koplugin/main.lua index f38b994fda16..7fe5ee5e027e 100644 --- a/plugins/coverimage.koplugin/main.lua +++ b/plugins/coverimage.koplugin/main.lua @@ -35,7 +35,7 @@ local md5 = require("ffi/sha2").md5 local function isPathAllowed(path) - -- don't allow a path that interferes with frontent cache-framework; quick and dirty check + -- don't allow a path that interferes with frontend cache-framework; quick and dirty check if not Device:isValidPath(path) then -- isValidPath expects a trailing slash return false diff --git a/plugins/externalkeyboard.koplugin/main.lua b/plugins/externalkeyboard.koplugin/main.lua index a206d2dd6544..520d995bd00d 100644 --- a/plugins/externalkeyboard.koplugin/main.lua +++ b/plugins/externalkeyboard.koplugin/main.lua @@ -66,7 +66,7 @@ local function setupDebugFS() if not found then -- If we're not root, we won't be able to mount it if C.getuid() ~= 0 then - logger.dbg("ExternalKeyboard: Cannot mount debugfs (unpriviledged user)") + logger.dbg("ExternalKeyboard: Cannot mount debugfs (unprivileged user)") return false end diff --git a/plugins/httpinspector.koplugin/main.lua b/plugins/httpinspector.koplugin/main.lua index 383931d7d08e..814bc95aab62 100644 --- a/plugins/httpinspector.koplugin/main.lua +++ b/plugins/httpinspector.koplugin/main.lua @@ -270,7 +270,7 @@ function HttpInspector:sendResponse(reqinfo, http_code, content_type, body) table.insert(response, T("HTTP/1.0 %1 %2", http_code, HTTP_RESPONSE_CODE[http_code] or "Unspecified")) -- If no content type provided, let the browser sniff it if content_type then - -- Advertize all our text as being UTF-8 + -- Advertise all our text as being UTF-8 local charset = "" if util.stringStartsWith(content_type, "text/") then charset = "; charset=utf-8" @@ -669,7 +669,7 @@ function HttpInspector:exposeObject(obj, uri, reqinfo) return self:sendResponse(reqinfo, 500, CTYPE.TEXT, json) end else - return self:sendResponse(reqinfo, 400, CTYPE.TEXT, "Invalid request: unexepected token after "..reqinfo.parsed_uri) + return self:sendResponse(reqinfo, 400, CTYPE.TEXT, "Invalid request: unexpected token after "..reqinfo.parsed_uri) end elseif obj_type == "function" then @@ -715,7 +715,7 @@ function HttpInspector:exposeObject(obj, uri, reqinfo) elseif (ftype == "=" or ftype == "?=") and fragment and uri then -- 'property=value': assign value to property -- 'property?=value': same, but output HTML allowing to get back to the parent - uri = fragment .. uri -- put back first frament into uri + uri = fragment .. uri -- put back first fragment into uri local args, nb_args = getVariablesFromUri(uri) if nb_args ~= 1 then return self:sendResponse(reqinfo, 400, CTYPE.TEXT, "Variable assignment needs a single value") @@ -744,7 +744,7 @@ function HttpInspector:exposeObject(obj, uri, reqinfo) end end end - return self:sendResponse(reqinfo, 400, CTYPE.TEXT, "Unexepected request") -- luacheck: ignore 511 + return self:sendResponse(reqinfo, 400, CTYPE.TEXT, "Unexpected request") -- luacheck: ignore 511 end -- Send a HTML page describing all this object's key/values @@ -817,7 +817,7 @@ function HttpInspector:browseObject(obj, reqinfo) add_html(T(" %1 instance", classinfo)) end -- Keep track of names seen, so we can show these same names - -- in super classes lighter, as they are then overriden. + -- in super classes lighter, as they are then overridden. local seen_names = {} local seen_prefix = "" local seen_suffix = "" diff --git a/plugins/kosync.koplugin/_meta.lua b/plugins/kosync.koplugin/_meta.lua index 409759f99651..76ddabd569a6 100644 --- a/plugins/kosync.koplugin/_meta.lua +++ b/plugins/kosync.koplugin/_meta.lua @@ -2,5 +2,5 @@ local _ = require("gettext") return { name = "kosync", fullname = _("Progress sync"), - description = _([[Synchronizes your reading progess to a server across your KOReader devices.]]), + description = _([[Synchronizes your reading progress to a server across your KOReader devices.]]), } diff --git a/plugins/newsdownloader.koplugin/feed_config.lua b/plugins/newsdownloader.koplugin/feed_config.lua index 2948942dac83..051b9ba322ee 100644 --- a/plugins/newsdownloader.koplugin/feed_config.lua +++ b/plugins/newsdownloader.koplugin/feed_config.lua @@ -17,7 +17,7 @@ return {--do NOT change this line -- 'download_full_article=false' - means use only feed description to create feeds (usually only beginning of the article) -- default value is 'true' (if no 'download_full_article' entry) - -- 'include_images=true' - means download any images on the page and inlude them in the article + -- 'include_images=true' - means download any images on the page and include them in the article -- 'include_images=false' - means ignore any images, only download the text (faster download, smaller file sizes) -- default value is 'false' (if no 'include_images' entry) diff --git a/plugins/newsdownloader.koplugin/lib/dateparser.lua b/plugins/newsdownloader.koplugin/lib/dateparser.lua index abd6f09572f8..fd573a1db8b0 100644 --- a/plugins/newsdownloader.koplugin/lib/dateparser.lua +++ b/plugins/newsdownloader.koplugin/lib/dateparser.lua @@ -185,8 +185,8 @@ do end) end -dateparser.register_format('RFC822', formats.RFC2822) --2822 supercedes 822, but is not a strict superset. For our intents and purposes though, it's perfectly good enough +dateparser.register_format('RFC822', formats.RFC2822) --2822 supersedes 822, but is not a strict superset. For our intents and purposes though, it's perfectly good enough dateparser.register_format('RFC3339', formats.W3CDTF) --RFC3339 is a subset of W3CDTF -return dateparser \ No newline at end of file +return dateparser diff --git a/plugins/newsdownloader.koplugin/lib/handler.lua b/plugins/newsdownloader.koplugin/lib/handler.lua index 4596dd3f928d..abb5c7e2c1b7 100644 --- a/plugins/newsdownloader.koplugin/lib/handler.lua +++ b/plugins/newsdownloader.koplugin/lib/handler.lua @@ -84,7 +84,7 @@ -- -- Usage -- ===== --- Pased as delegate in xmlParser constructor and called +-- Parsed as delegate in xmlParser constructor and called -- as callback by xmlParser:parse(xml) method. -- -- See textxml.lua for examples diff --git a/plugins/newsdownloader.koplugin/lib/xml.lua b/plugins/newsdownloader.koplugin/lib/xml.lua index 525d490b4b56..8c939278603e 100644 --- a/plugins/newsdownloader.koplugin/lib/xml.lua +++ b/plugins/newsdownloader.koplugin/lib/xml.lua @@ -304,7 +304,7 @@ local xmlParser = function(handler) -- End tag if self._handler.endtag then if attrs then - -- Shouldnt have any attributes in endtag + -- Shouldn't have any attributes in endtag self:_err(string.format("%s (/%s)", self._errstr.endTagErr, tagname) @@ -341,7 +341,7 @@ local xmlParser = function(handler) end end - -- Private attribures/functions + -- Private attributes/functions obj._handler = handler obj._stack = {} diff --git a/plugins/newsdownloader.koplugin/main.lua b/plugins/newsdownloader.koplugin/main.lua index 28843ae2e9ad..2789c94e7398 100644 --- a/plugins/newsdownloader.koplugin/main.lua +++ b/plugins/newsdownloader.koplugin/main.lua @@ -290,7 +290,7 @@ function NewsDownloader:loadConfigAndProcessFeeds(touchmenu_instance) -- Tell the user there were problems. feed_message = _("Downloading news finished with errors.") -- Display a dialogue that requires the user to acknowledge - -- that errors occured. + -- that errors occurred. UI:confirm( T(_([[ Could not process some feeds. @@ -842,7 +842,7 @@ function NewsDownloader:updateFeedConfig(id, key, value) -- In this loop, we cycle through the feed items. A series of -- conditionals checks to see if we are at the right id -- and key (i.e.: the key that triggered this function. - -- If we are at the right spot, we overrite (or create) the value + -- If we are at the right spot, we overwrite (or create) the value for idx, feed in ipairs(feed_config) do -- Check to see if this is the correct feed to update. if idx == id then @@ -959,7 +959,7 @@ function NewsDownloader:deleteFeed(id) -- In this loop, we cycle through the feed items. A series of -- conditionals checks to see if we are at the right id -- and key (i.e.: the key that triggered this function. - -- If we are at the right spot, we overrite (or create) the value + -- If we are at the right spot, we overwrite (or create) the value local new_config = {} for idx, feed in ipairs(feed_config) do -- Check to see if this is the correct feed to update. diff --git a/plugins/statistics.koplugin/calendarview.lua b/plugins/statistics.koplugin/calendarview.lua index 9f5238c32d80..7be10ae3d948 100644 --- a/plugins/statistics.koplugin/calendarview.lua +++ b/plugins/statistics.koplugin/calendarview.lua @@ -302,7 +302,7 @@ function CalendarWeek:update() local offset_y_fixup if self.histo_shown then - -- No real y positionning needed, but push it a bit down + -- No real y positioning needed, but push it a bit down -- over histogram, as histograms rarely reach 100%, and -- will be drawn last, so possibly over last book span if -- really near 100% @@ -1421,9 +1421,9 @@ function CalendarView:_populateItems() close_callback = function(this) -- Refresh calendar in case some day stats were reset for some books -- (we don't know if some reset were done... so we refresh the current - -- display always - at tickAfterNext so there is no noticable slowness - -- when closing, and the re-painting happening after is not noticable; - -- but if some stat reset were done, this will make a nice noticable + -- display always - at tickAfterNext so there is no noticeable slowness + -- when closing, and the re-painting happening after is not noticeable; + -- but if some stat reset were done, this will make a nice noticeable -- repainting showing dynamically reset books disappearing :) UIManager:tickAfterNext(function() self:goToMonth(os.date("%Y-%m", this.day_ts + 10800)) diff --git a/plugins/statistics.koplugin/main.lua b/plugins/statistics.koplugin/main.lua index c060c3238231..10ced6e64dea 100644 --- a/plugins/statistics.koplugin/main.lua +++ b/plugins/statistics.koplugin/main.lua @@ -2863,7 +2863,7 @@ function ReaderStatistics:getReadingRatioPerHourByDay(month) -- We used to have in the SQL statement (with ? = 'YYYY-MM'): -- WHERE strftime('%Y-%m', start_time, 'unixepoch', 'localtime') = ? -- but strftime()ing all start_time is slow. - -- Comverting the month into timestamp boundaries, and just comparing + -- Converting the month into timestamp boundaries, and just comparing -- integers, can be 5 times faster. -- We let SQLite compute these timestamp boundaries from the provided -- month; we need the start of the month to be a real date: diff --git a/plugins/texteditor.koplugin/main.lua b/plugins/texteditor.koplugin/main.lua index d7174a71ac7f..0160f1522d47 100644 --- a/plugins/texteditor.koplugin/main.lua +++ b/plugins/texteditor.koplugin/main.lua @@ -78,8 +78,8 @@ function TextEditor:loadSettings() -- to be re-used by default by InputDialog (on certain conditaions, -- when fullscreen or condensed or add_nav_bar...) -- - -- Allow users to set their prefered font manually in text_editor.lua - -- (sadly, not via TextEditor itself, as they would be overriden on close) + -- Allow users to set their preferred font manually in text_editor.lua + -- (sadly, not via TextEditor itself, as they would be overridden on close) if self.settings:has("normal_font") then self.normal_font = self.settings:readSetting("normal_font") end @@ -457,7 +457,7 @@ function TextEditor:checkEditFile(file_path, from_history, possibly_new_file) self:editFile(file_path, readonly) end else -- File does not exist - -- Try to create it just to check if writting to it later is possible + -- Try to create it just to check if writing to it later is possible local file, err = io.open(file_path, "wb") if file then -- Clean it, we'll create it again on Save, and allow closing diff --git a/plugins/vocabbuilder.koplugin/main.lua b/plugins/vocabbuilder.koplugin/main.lua index 0e8a2a8d2057..5235703ee526 100644 --- a/plugins/vocabbuilder.koplugin/main.lua +++ b/plugins/vocabbuilder.koplugin/main.lua @@ -750,7 +750,7 @@ local VocabItemWidget = InputContainer:extend{ --[[-- item: { checked_func: Block, - review_count: interger, + review_count: integer, word: Text book_title: TEXT create_time: Integer diff --git a/plugins/wallabag.koplugin/main.lua b/plugins/wallabag.koplugin/main.lua index f79f5cb0876c..2a53d21a473a 100644 --- a/plugins/wallabag.koplugin/main.lua +++ b/plugins/wallabag.koplugin/main.lua @@ -47,7 +47,7 @@ end function Wallabag:init() self.token_expiry = 0 - -- default values so that user doesn't have to explicitely set them + -- default values so that user doesn't have to explicitly set them self.is_delete_finished = true self.is_delete_read = false self.is_auto_delete = false @@ -466,7 +466,7 @@ function Wallabag:getBearerToken() end --- Get a JSON formatted list of articles from the server. --- The list should have self.article_per_sync item, or less if an error occured. +-- The list should have self.article_per_sync item, or less if an error occurred. -- If filter_tag is set, only articles containing this tag are queried. -- If ignore_tags is defined, articles containing either of the tags are skipped. function Wallabag:getArticleList() @@ -491,7 +491,7 @@ function Wallabag:getArticleList() logger.dbg("Wallabag: couldn't get page #", page) break -- exit while loop elseif err or articles_json == nil then - -- another error has occured. Don't proceed with downloading + -- another error has occurred. Don't proceed with downloading -- or deleting articles logger.warn("Wallabag: download of page #", page, "failed with", err, code) UIManager:show(InfoMessage:new{ diff --git a/resources/icons/mdlight/license.txt b/resources/icons/mdlight/license.txt index a35a4c656709..26bd599db06e 100644 --- a/resources/icons/mdlight/license.txt +++ b/resources/icons/mdlight/license.txt @@ -1,7 +1,7 @@ Read the license: http://creativecommons.org/licenses/by/3.0/ * -Basicaly, use it anyway you want but include this license file in the source if your project is open source. Nothing is needed in the front facing project (UNLESS you are using any of the icons listed below). Commercial use is not only allowed but encouraged. This pack was made to promote consistency in applications. +Basically, use it anyway you want but include this license file in the source if your project is open source. Nothing is needed in the front facing project (UNLESS you are using any of the icons listed below). Commercial use is not only allowed but encouraged. This pack was made to promote consistency in applications. Creator - Austin Andrews (@templarian) @@ -41,4 +41,4 @@ Contact - Skype - Facebook - Twitter -- etc... \ No newline at end of file +- etc... diff --git a/resources/icons/src/license.txt b/resources/icons/src/license.txt index a35a4c656709..26bd599db06e 100644 --- a/resources/icons/src/license.txt +++ b/resources/icons/src/license.txt @@ -1,7 +1,7 @@ Read the license: http://creativecommons.org/licenses/by/3.0/ * -Basicaly, use it anyway you want but include this license file in the source if your project is open source. Nothing is needed in the front facing project (UNLESS you are using any of the icons listed below). Commercial use is not only allowed but encouraged. This pack was made to promote consistency in applications. +Basically, use it anyway you want but include this license file in the source if your project is open source. Nothing is needed in the front facing project (UNLESS you are using any of the icons listed below). Commercial use is not only allowed but encouraged. This pack was made to promote consistency in applications. Creator - Austin Andrews (@templarian) @@ -41,4 +41,4 @@ Contact - Skype - Facebook - Twitter -- etc... \ No newline at end of file +- etc... diff --git a/spec/unit/autofrontlight_spec.lua b/spec/unit/autofrontlight_spec.lua index a59594b10584..e5e178a10b40 100644 --- a/spec/unit/autofrontlight_spec.lua +++ b/spec/unit/autofrontlight_spec.lua @@ -110,7 +110,7 @@ describe("AutoFrontlight widget tests", function() assert.are.equal(2, Device:getPowerDevice().frontlight) end) - it("should turn on frontlight at the begining", function() + it("should turn on frontlight at the beginning", function() Device:getPowerDevice():turnOffFrontlight() Device.brightness = 0 AutoFrontlight = class:new() @@ -119,7 +119,7 @@ describe("AutoFrontlight widget tests", function() assert.are.equal(2, Device:getPowerDevice().frontlight) end) - it("should turn off frontlight at the begining", function() + it("should turn off frontlight at the beginning", function() Device:getPowerDevice():turnOnFrontlight() Device.brightness = 3 AutoFrontlight = class:new() diff --git a/spec/unit/networksetting_spec.lua b/spec/unit/networksetting_spec.lua index acd7642e945e..930640a48ffc 100644 --- a/spec/unit/networksetting_spec.lua +++ b/spec/unit/networksetting_spec.lua @@ -7,7 +7,7 @@ describe("NetworkSetting module", function() NetworkMgr = require("ui/network/manager") end) - it("should initilize properly with empty network list", function() + it("should initialize properly with empty network list", function() local ns = NetworkSetting:new{network_list = {}} assert.is.falsy(ns.connected_item) end) diff --git a/spec/unit/nickel_conf_spec.lua b/spec/unit/nickel_conf_spec.lua index 929c659c118f..6ac6764af37d 100644 --- a/spec/unit/nickel_conf_spec.lua +++ b/spec/unit/nickel_conf_spec.lua @@ -1,4 +1,4 @@ -describe("Nickel configuation module", function() +describe("Nickel configuration module", function() local lfs, NickelConf setup(function() require("commonrequire") diff --git a/spec/unit/readerfooter_spec.lua b/spec/unit/readerfooter_spec.lua index f229ab4d1c8c..90f1aa5f9c5e 100644 --- a/spec/unit/readerfooter_spec.lua +++ b/spec/unit/readerfooter_spec.lua @@ -284,7 +284,7 @@ describe("Readerfooter module", function() tapFooterMenu(fake_menu, "Time left to finish chapter".." (⤻)") assert.are.same('', footer.footer_text.text) - -- reenable chapter time to read, text should be chapter time to read + -- re-enable chapter time to read, text should be chapter time to read tapFooterMenu(fake_menu, "Time left to finish chapter".." (⤻)") assert.are.same('⤻ N/A', footer.footer_text.text) readerui:closeDocument() diff --git a/spec/unit/uimanager_spec.lua b/spec/unit/uimanager_spec.lua index b6735b7884f0..13c267f9a02b 100644 --- a/spec/unit/uimanager_spec.lua +++ b/spec/unit/uimanager_spec.lua @@ -28,7 +28,7 @@ describe("UIManager spec", function() assert.are.same(future2, UIManager._task_queue[1].time) end) - it("should calcualte wait_until properly in checkTasks routine", function() + it("should calculate wait_until properly in checkTasks routine", function() now = time.now() local future_time = now + time.s(60000) UIManager:quit() @@ -132,7 +132,7 @@ describe("UIManager spec", function() UIManager:schedule(now + time.s(5), "5s"); assert.are.same("5s", UIManager._task_queue[2].action) - -- insert task in place of "10s", as it'll expire shortly afer "10s" + -- insert task in place of "10s", as it'll expire shortly after "10s" -- NOTE: Can't use this here right now, as time.now, which is used internally, -- may or may not have moved, depending on host's performance and clock granularity -- (especially if host is fast and/or COARSE is available). @@ -156,7 +156,7 @@ describe("UIManager spec", function() UIManager:scheduleIn(5, 'barba') -- is a bit later than "5s", as time.now() is used internally assert.are.same('barba', UIManager._task_queue[5].action) - -- "mama is sheduled now and as such inserted in "now"'s place + -- "mama is scheduled now and as such inserted in "now"'s place UIManager:schedule(now, 'mama') assert.are.same('mama', UIManager._task_queue[8].action) @@ -299,7 +299,7 @@ describe("UIManager spec", function() end) it("should handle stack change when checking for active widgets", function() - -- senario 1: 2nd widget removes the 3rd widget in the stack + -- scenario 1: 2nd widget removes the 3rd widget in the stack local call_signals = {0, 0, 0} UIManager._window_stack = { { @@ -335,7 +335,7 @@ describe("UIManager spec", function() assert.is.same(call_signals[2], 0) assert.is.same(call_signals[3], 1) - -- senario 2: top widget removes itself + -- scenario 2: top widget removes itself call_signals = {0, 0, 0} UIManager._window_stack = { { diff --git a/tools/kobo_touch_probe.lua b/tools/kobo_touch_probe.lua index f4042e00b443..f4a7b2246e43 100755 --- a/tools/kobo_touch_probe.lua +++ b/tools/kobo_touch_probe.lua @@ -109,7 +109,7 @@ function TouchProbe:onTapProbe(arg, ges) local need_to_switch_xy = ges.pos.x > ges.pos.y self:saveSwitchXYSetting(need_to_switch_xy) else - -- x not mirroed, need one more probe + -- x not mirrored, need one more probe self.curr_probe_step = 2 self:updateProbeInstruction() UIManager:setDirty(self) diff --git a/tools/wbuilder.lua b/tools/wbuilder.lua index 7ab19bf8e3c3..ec5c12f72872 100755 --- a/tools/wbuilder.lua +++ b/tools/wbuilder.lua @@ -73,7 +73,7 @@ function TestVisible:paintTo(bb) h_line = math.floor(bb:getHeight() / 50) -- Paint white background for higher contrast bb:paintRect(0,0,bb:getWidth(),bb:getHeight(), Blitbuffer.COLOR_WHITE) - -- Only render gridtext not lines at a more central postition, so it doesn't interfere with the + -- Only render gridtext not lines at a more central position, so it doesn't interfere with the for i=1,h_line do y_num = i*50 RenderText:renderUtf8Text(bb, 40, y_num+10, Font:getFace("ffont", 12), y_num, true)