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 8c67154
Show file tree
Hide file tree
Showing 23 changed files with 95 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: koreader/koappimage:0.1.5
- image: koreader/koappimage:0.1.6
environment:
EMULATE_READER: 1
# this is for shellcheck 0.4.5 and lower; can be removed for 0.4.6
Expand Down
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
Loading

0 comments on commit 8c67154

Please sign in to comment.