[RTL UI] Bidi-wrap filenames, paths, urls, metadata

bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
This commit is contained in:
poire-z
2020-01-04 01:18:51 +01:00
parent a31abf79de
commit 0599c440cc
50 changed files with 378 additions and 182 deletions

View File

@@ -1,3 +1,4 @@
local BD = require("ui/bidi")
local ConfirmBox = require("ui/widget/confirmbox")
local DocumentRegistry = require("document/documentregistry")
local InfoMessage = require("ui/widget/infomessage")
@@ -22,12 +23,12 @@ function WebDav:downloadFile(item, address, username, password, local_path, clos
local __, filename = util.splitFilePathName(local_path)
if G_reader_settings:isTrue("show_unsupported") and not DocumentRegistry:hasProvider(filename) then
UIManager:show(InfoMessage:new{
text = T(_("File saved to:\n%1"), local_path),
text = T(_("File saved to:\n%1"), BD.filepath(local_path)),
})
else
UIManager:show(ConfirmBox:new{
text = T(_("File saved to:\n%1\nWould you like to read the downloaded book now?"),
local_path),
BD.filepath(local_path)),
ok_callback = function()
close()
ReaderUI:showReader(local_path)
@@ -36,7 +37,7 @@ function WebDav:downloadFile(item, address, username, password, local_path, clos
end
else
UIManager:show(InfoMessage:new{
text = T(_("Could not save file to:\n%1"), local_path),
text = T(_("Could not save file to:\n%1"), BD.filepath(local_path)),
timeout = 3,
})
end