[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 ButtonDialogTitle = require("ui/widget/buttondialogtitle")
local FileChooser = require("ui/widget/filechooser")
local Font = require("ui/font")
@@ -104,14 +105,14 @@ function PathChooser:onMenuHold(item)
local filesize = util.getFormattedSize(attr.size)
local lastmod = os.date("%Y-%m-%d %H:%M", attr.modification)
title = T(_("Select this file?\n\n%1\n\nFile size: %2 bytes\nLast modified: %3"),
path, filesize, lastmod)
BD.filepath(path), filesize, lastmod)
else
title = T(_("Select this file?\n\n%1"), path)
title = T(_("Select this file?\n\n%1"), BD.filepath(path))
end
elseif attr.mode == "directory" then
title = T(_("Select this directory?\n\n%1"), path)
title = T(_("Select this directory?\n\n%1"), BD.dirpath(path))
else -- just in case we get something else
title = T(_("Select this path?\n\n%1"), path)
title = T(_("Select this path?\n\n%1"), BD.path(path))
end
local onConfirm = self.onConfirm
self.button_dialog = ButtonDialogTitle:new{