Skip to content

Commit

Permalink
[CI] Switch to custom xgettext build to extract multiline strings
Browse files Browse the repository at this point in the history
Because let's face it, it just looks much better this way.

Docker image update in koreader/virdevenv#43

Discussion in koreader#5238 (comment) and koreader#4524
  • Loading branch information
Frenzie committed Aug 22, 2019
1 parent 0906b69 commit 3fd48c1
Show file tree
Hide file tree
Showing 22 changed files with 94 additions and 95 deletions.
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readerdictionary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ function ReaderDictionary:addToMainMenu(menu_items)
keep_menu_open = true,
callback = function()
UIManager:show(InfoMessage:new{
text = T(_(
[[If you'd like to change the order in which dictionaries are queried (and their results displayed), you can:
text = T(_([[
If you'd like to change the order in which dictionaries are queried (and their results displayed), you can:
- move all dictionary directories out of %1.
- move them back there, one by one, in the order you want them to be used.]]), self.data_dir)
})
Expand Down
24 changes: 12 additions & 12 deletions frontend/apps/reader/modules/readergesture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ local default_multiswipes = {
"southeast northeast northwest",
}
local multiswipes = {}
local multiswipes_info_text = _(
[[Multiswipes allow you to perform complex gestures built up out of multiple swipe directions, never losing touch with the screen.
local multiswipes_info_text = _([[
Multiswipes allow you to perform complex gestures built up out of multiple swipe directions, never losing touch with the screen.
These advanced gestures consist of either straight swipes or diagonal swipes. To ensure accuracy, they can't be mixed.]])

Expand Down Expand Up @@ -433,8 +433,8 @@ function ReaderGesture:addToMainMenu(menu_items)
local SpinWidget = require("ui/widget/spinwidget")
local GestureDetector = require("device/gesturedetector")
local items = SpinWidget:new{
text = T(_(
[[Set double tap interval in milliseconds.
text = T(_([[
Set double tap interval in milliseconds.
The interval value can range from 100 (0.1 seconds) to 2000 (2 seconds).
Default value: %1]]), GestureDetector.DOUBLE_TAP_INTERVAL/1000),
width = Screen:getWidth() * 0.6,
Expand All @@ -460,8 +460,8 @@ Default value: %1]]), GestureDetector.DOUBLE_TAP_INTERVAL/1000),
local SpinWidget = require("ui/widget/spinwidget")
local GestureDetector = require("device/gesturedetector")
local items = SpinWidget:new{
text = T(_(
[[Set two finger tap duration in milliseconds.
text = T(_([[
Set two finger tap duration in milliseconds.
The duration value can range from 100 (0.1 seconds) to 2000 (2 seconds).
Default value: %1]]), GestureDetector.TWO_FINGER_TAP_DURATION/1000),
width = Screen:getWidth() * 0.6,
Expand All @@ -487,8 +487,8 @@ Default value: %1]]), GestureDetector.TWO_FINGER_TAP_DURATION/1000),
local SpinWidget = require("ui/widget/spinwidget")
local GestureDetector = require("device/gesturedetector")
local items = SpinWidget:new{
text = T(_(
[[Set hold interval in milliseconds.
text = T(_([[
Set hold interval in milliseconds.
The interval value can range from 100 (0.1 seconds) to 2000 (2 seconds).
Default value: %1]]), GestureDetector.HOLD_INTERVAL/1000),
width = Screen:getWidth() * 0.6,
Expand All @@ -514,8 +514,8 @@ Default value: %1]]), GestureDetector.HOLD_INTERVAL/1000),
local SpinWidget = require("ui/widget/spinwidget")
local GestureDetector = require("device/gesturedetector")
local items = SpinWidget:new{
text = T(_(
[[Set pan delay interval in milliseconds.
text = T(_([[
Set pan delay interval in milliseconds.
The interval value can range from 100 (0.1 seconds) to 2000 (2 seconds).
Default value: %1]]), GestureDetector.PAN_DELAYED_INTERVAL/1000),
width = Screen:getWidth() * 0.6,
Expand All @@ -541,8 +541,8 @@ Default value: %1]]), GestureDetector.PAN_DELAYED_INTERVAL/1000),
local SpinWidget = require("ui/widget/spinwidget")
local GestureDetector = require("device/gesturedetector")
local items = SpinWidget:new{
text = T(_(
[[Set swipe interval in milliseconds.
text = T(_([[
Set swipe interval in milliseconds.
The interval value can range from 100 (0.1 seconds) to 2000 (2 seconds).
Default value: %1]]), GestureDetector.SWIPE_INTERVAL/1000),
width = Screen:getWidth() * 0.6,
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readerhighlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ function ReaderHighlight:onHoldPan(_, ges)
UIManager:setDirty(self.dialog, "ui")
end

local info_message_ocr_text = _(
[[No OCR results or no language data.
local info_message_ocr_text = _([[
No OCR results or no language data.
KOReader has a build-in OCR engine for recognizing words in scanned PDF and DjVu documents. In order to use OCR in scanned pages, you need to install tesseract trained data for your document language.
Expand Down
24 changes: 12 additions & 12 deletions frontend/apps/reader/modules/readerlink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ function ReaderLink:addToMainMenu(menu_items)
G_reader_settings:saveSetting("tap_ignore_external_links",
not isTapIgnoreExternalLinksEnabled())
end,
help_text = _(
[[Ignore taps on external links. Useful with Wikipedia EPUBs to make page turning easier.
help_text = _([[
Ignore taps on external links. Useful with Wikipedia EPUBs to make page turning easier.
You can still follow them from the dictionary window or the selection menu after holding on them.]]),
separator = true,
},
Expand Down Expand Up @@ -162,8 +162,8 @@ You can still follow them from the dictionary window or the selection menu after
G_reader_settings:saveSetting("swipe_ignore_external_links",
not isSwipeIgnoreExternalLinksEnabled())
end,
help_text = _(
[[Ignore external links near swipe. Useful with Wikipedia EPUBs to follow only footnotes with swipe.
help_text = _([[
Ignore external links near swipe. Useful with Wikipedia EPUBs to follow only footnotes with swipe.
You can still follow external links from the dictionary window or the selection menu after holding on them.]]),
separator = true,
},
Expand All @@ -174,8 +174,8 @@ You can still follow external links from the dictionary window or the selection
G_reader_settings:saveSetting("swipe_to_jump_to_latest_bookmark",
not isSwipeToJumpToLatestBookmarkEnabled())
end,
help_text = _(
[[Swipe to the left to go the most recently bookmarked page.
help_text = _([[
Swipe to the left to go the most recently bookmarked page.
This can be useful to quickly swipe back and forth between what you are reading and some reference page (for example notes, a map or a characters list).
If any of the other Swipe to follow link options is enabled, this will work only when the current page contains no link.]]),
},
Expand Down Expand Up @@ -208,8 +208,8 @@ If any of the other Swipe to follow link options is enabled, this will work only
G_reader_settings:saveSetting("footnote_link_in_popup",
not isFootnoteLinkInPopupEnabled())
end,
help_text = _(
[[Show internal link target content in a footnote popup when it looks like it might be a footnote, instead of following the link.
help_text = _([[
Show internal link target content in a footnote popup when it looks like it might be a footnote, instead of following the link.
Note that depending on the book quality, footnote detection may not always work correctly.
The footnote content may be empty, truncated, or include other footnotes.
Expand Down Expand Up @@ -246,8 +246,8 @@ From the footnote popup, you can jump to the footnote location in the book by sw
precision = "%+d",
ok_text = _("Set font size"),
title_text = _("Set footnote popup font size"),
text = _(
[[The footnote popup font adjusts to the font size you've set for the document.
text = _([[
The footnote popup font adjusts to the font size you've set for the document.
You can specify here how much smaller or larger it should be relative to the document font size.
A negative value will make it smaller, while a positive one will make it larger.
The recommended value is -2.]]),
Expand All @@ -256,8 +256,8 @@ The recommended value is -2.]]),
end,
})
end,
help_text = _(
[[The footnote popup font adjusts to the font size you've set for the document.
help_text = _([[
The footnote popup font adjusts to the font size you've set for the document.
This allows you to specify how much smaller or larger it should be relative to the document font size.]]),
separator = true,
})
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readerrolling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ function ReaderRolling:addToMainMenu(menu_items)
-- FIXME: repeated code with page overlap menu for readerpaging
-- needs to keep only one copy of the logic as for the DRY principle.
-- The difference between the two menus is only the enabled func.
local overlap_lines_help_text = _(
[[When page overlap is enabled, some lines from the previous page will be displayed on the next page.
local overlap_lines_help_text = _([[
When page overlap is enabled, some lines from the previous page will be displayed on the next page.
You can set how many lines are shown.]])
local page_overlap_menu = {
{
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readerstyletweak.lua
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ function ReaderStyleTweak:init()
end,
hold_callback = function()
UIManager:show(InfoMessage:new{
text = _(
[[Style tweaks allow changing small parts of book styles (including the publisher/embedded styles) to make visual adjustments or disable unwanted publisher layout choices.
text = _([[
Style tweaks allow changing small parts of book styles (including the publisher/embedded styles) to make visual adjustments or disable unwanted publisher layout choices.
Some tweaks may be useful with some books, while resulting in undesirable effects with others.
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readertypeset.lua
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ function ReaderTypeset:onSetPageMargins(margins, refresh_callback)
if refresh_callback then
-- Show a toast on set, with the unscaled & scaled values
UIManager:show(InfoMessage:new{
text = T(_(
[[ Margins set to:
text = T(_([[
Margins set to:
horizontal: %1 (%2px)
top: %3 (%4px)
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readerview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,8 @@ end
function ReaderView:onSetScrollMode(page_scroll)
if self.ui.document.info.has_pages and page_scroll and self.ui.zooming.paged_modes[self.zoom_mode] then
UIManager:show(InfoMessage:new{
text = _(
[[Continuous view (scroll mode) works best with zoom to page width or zoom to content width.
text = _([[
Continuous view (scroll mode) works best with zoom to page width or zoom to content width.
In combination with zoom to fit page, page height, content height or content, continuous view can cause unexpected shifts when turning pages.]]),
timeout = 5,
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readerwikipedia.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ function ReaderWikipedia:addToMainMenu(menu_items)
home_dir = home_dir:gsub("^(.-)/*$", "%1") -- remove trailing slash
if home_dir and lfs.attributes(home_dir, "mode") == "directory" then
local wikipedia_dir = home_dir.."/Wikipedia"
local text = _(
[[Wikipedia articles can be saved as an EPUB for more comfortable reading.
local text = _([[
Wikipedia articles can be saved as an EPUB for more comfortable reading.
You can select an existing directory, or use a default directory named "Wikipedia" in your reader's home directory.
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readerzooming.lua
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ end
function ReaderZooming:setZoomMode(mode)
if self.ui.view.page_scroll and self.paged_modes[mode] then
UIManager:show(InfoMessage:new{
text = T(_(
[[%1
text = T(_([[
%1
In combination with continuous view (scroll mode), this can cause unexpected vertical shifts when turning pages.]]), self.paged_modes[mode]),
timeout = 5,
Expand Down
7 changes: 3 additions & 4 deletions frontend/ui/data/creoptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ local CreOptions = {
optionsutil.enableIfEquals(configurable, "view_mode", 0) -- "page"
end,
name_text_hold_callback = optionsutil.showValues,
help_text = _(
[[In landscape mode, you can choose to display one or two pages of the book on the screen.
help_text = _([[In landscape mode, you can choose to display one or two pages of the book on the screen.
Note that this may not be ensured under some conditions: in scroll mode, when a very big font size is used, or on devices with a very low aspect ratio.]]),
},
}
Expand Down Expand Up @@ -205,8 +204,8 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m
default_arg = 2,
event = "SetBlockRenderingMode",
name_text_hold_callback = optionsutil.showValues,
help_text = _(
[[- 'legacy' uses original CR3 block rendering code.
help_text = _([[
- 'legacy' uses original CR3 block rendering code.
- 'flat' ensures flat rendering with collapsing margins and accurate page breaks.
- 'book' additionally allows floats, but limits style support to avoid blank spaces and overflows.
- 'web' renders as web browsers do, allowing negative margins and possible page overflow.]]),
Expand Down
40 changes: 20 additions & 20 deletions frontend/ui/data/css_tweaks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ h1 + h6, h2 + h6, h3 + h6, h4 + h6, h5 + h6 { page-break-before: avoid !importan
title = _("Widows and orphans"),
{
title = _("About widow and orphan lines"),
info_text = _(
[[Widows and orphans are lines at the beginning or end of a paragraph, which are left dangling at the top or bottom of a page, separated from the rest of the paragraph.
info_text = _([[
Widows and orphans are lines at the beginning or end of a paragraph, which are left dangling at the top or bottom of a page, separated from the rest of the paragraph.
The first line of a paragraph alone at the bottom of a page is called an orphan line.
The last line of a paragraph alone at the top of a page is called a widow line.
Expand Down Expand Up @@ -202,8 +202,8 @@ DocFragment {
{
id = "widows_avoid_orphans_allow";
title = _("Avoid widows but allow orphans"),
description = _(
[[Avoid widow lines, but allow orphan lines, allowing for some possible blank space at the bottom of pages.
description = _([[
Avoid widow lines, but allow orphan lines, allowing for some possible blank space at the bottom of pages.
Allowing orphans avoids ambiguous blank space at the bottom of a page, which could otherwise be confused with real spacing between paragraphs.]]),
css = [[
body { orphans: 1; widows: 2; }
Expand Down Expand Up @@ -274,8 +274,8 @@ h1, h2, h3, h4, h5, h6 { hyphens: none !important; }
{
id = "paragraph_web_browser_style";
title = _("Generic web browser paragraph style"),
description = _(
[[Display paragraphs as browsers do, in full-block style without indentation or justification, discarding KOReader's book paragraph style.
description = _([[
Display paragraphs as browsers do, in full-block style without indentation or justification, discarding KOReader's book paragraph style.
This might be needed with some documents that expect this style as the default, and only use CSS when it needs to diverge from this default.]]),
priority = -1,
css = [[
Expand Down Expand Up @@ -420,8 +420,8 @@ width: 100% !important;
title = _("Alternative TOC hints"),
{
title = _("About alternative TOC"),
info_text = _(
[[An alternative table of contents can be built with a long-press on the "Table of contents" menu item.
info_text = _([[
An alternative table of contents can be built with a long-press on the "Table of contents" menu item.
The TOC will be built from document headings <H1> to <H6>. Some of these can be ignored with the tweaks available here.
If the document contains no headings, or all are ignored, the alternative TOC will be built from document fragments and will point to the start of each individual HTML file in the EPUB.
Expand Down Expand Up @@ -470,8 +470,8 @@ After applying these tweaks, the alternative TOC needs to be rebuilt by long-pre
{
id = "alt_toc_level_example";
title = _("Example of book specific TOC hints"),
description = _(
[[If headings or document fragments do not result in a usable TOC, you can inspect the HTML and look for elements that contain chapter titles. Then you can set hints to their class names.
description = _([[
If headings or document fragments do not result in a usable TOC, you can inspect the HTML and look for elements that contain chapter titles. Then you can set hints to their class names.
This is just an example, that will need to be adapted into a user style tweak.]]),
css = [[
.book_n { -cr-hint: toc-level1; }
Expand All @@ -486,8 +486,8 @@ This is just an example, that will need to be adapted into a user style tweak.]]
{
id = "footnote-inpage_epub";
title = _("In-page EPUB footnotes"),
description = _(
[[Show EPUB footnote text at the bottom of pages that contain links to them.
description = _([[
Show EPUB footnote text at the bottom of pages that contain links to them.
This only works with footnotes that have specific attributes set by the publisher.]]),
css = [[
*[type~="note"],
Expand All @@ -505,8 +505,8 @@ This only works with footnotes that have specific attributes set by the publishe
{
id = "footnote-inpage_epub_smaller";
title = _("In-page EPUB footnotes (smaller)"),
description = _(
[[Show EPUB footnote text at the bottom of pages that contain links to them.
description = _([[
Show EPUB footnote text at the bottom of pages that contain links to them.
This only works with footnotes that have specific attributes set by the publisher.]]),
css = [[
*[type~="note"],
Expand Down Expand Up @@ -559,8 +559,8 @@ ol.references > li > .mw-cite-backlink { display: none; }
{
id = "footnote-inpage_classic_classnames";
title = _("In-page classic classname footnotes"),
description = _(
[[Show footnotes with classic class names at the bottom of pages.
description = _([[
Show footnotes with classic class names at the bottom of pages.
This tweak can be duplicated as a user style tweak when books contain footnotes wrapped with other class names.]]),
css = [[
.footnote, .note, .note1, .ntb, .ntb-txt, .ntb-txt-j
Expand All @@ -573,8 +573,8 @@ This tweak can be duplicated as a user style tweak when books contain footnotes
{
id = "footnote-inpage_classic_classnames_smaller";
title = _("In-page classic classname footnotes (smaller)"),
description = _(
[[Show footnotes with classic classname at the bottom of pages.
description = _([[
Show footnotes with classic classname at the bottom of pages.
This tweak can be duplicated as a user style tweak when books contain footnotes wrapped with other class names.]]),
css = [[
.footnote, .note, .note1, .ntb, .ntb-txt, .ntb-txt-j
Expand All @@ -589,8 +589,8 @@ This tweak can be duplicated as a user style tweak when books contain footnotes
{
id = "epub_switch_show_case";
title = _("Toggle alternative EPUB content"),
description = _(
[[The EPUB3 format allows a
description = _([[
The EPUB3 format allows a
<epub:switch> <epub:case> <epub:default>
construct to provide alternative content to engines that support optional features.
KOReader currently falls back to hiding all <epub:case> content and shows the <epub:default> content (usually an image).
Expand Down
Loading

0 comments on commit 3fd48c1

Please sign in to comment.