[chore] Get rid of ui/data/strings.lua (#6921)

As suggested [here](https://github.com/koreader/koreader/pull/6885#issuecomment-734865881)
pull/6927/head
jperon 3 years ago committed by GitHub
parent bba8b31e1d
commit 1f16815f94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,8 +1,8 @@
local Device = require("device") local Device = require("device")
local Screen = Device.screen local Screen = Device.screen
local S = require("ui/data/strings")
local optionsutil = require("ui/data/optionsutil") local optionsutil = require("ui/data/optionsutil")
local _ = require("gettext") local _ = require("gettext")
local C_ = _.pgettext
-- Get font size numbers as a table of strings -- Get font size numbers as a table of strings
local tableOfNumbersToTableOfStrings = function(numbers) local tableOfNumbersToTableOfStrings = function(numbers)
@ -21,8 +21,8 @@ local CreOptions = {
options = { options = {
{ {
name = "rotation_mode", name = "rotation_mode",
name_text = S.SCREEN_MODE, name_text = _("Rotation"),
toggle = {S.LANDSCAPE_ROTATED, S.PORTRAIT, S.LANDSCAPE, S.PORTRAIT_ROTATED}, toggle = {C_("Rotation", "⤹ 90°"), C_("Rotation", "↑ 0°"), C_("Rotation", "⤸ 90°"), C_("Rotation", "↓ 180°")},
alternate = false, alternate = false,
values = {Screen.ORIENTATION_LANDSCAPE_ROTATED, Screen.ORIENTATION_PORTRAIT, Screen.ORIENTATION_LANDSCAPE, Screen.ORIENTATION_PORTRAIT_ROTATED}, values = {Screen.ORIENTATION_LANDSCAPE_ROTATED, Screen.ORIENTATION_PORTRAIT, Screen.ORIENTATION_LANDSCAPE, Screen.ORIENTATION_PORTRAIT_ROTATED},
args = {Screen.ORIENTATION_LANDSCAPE_ROTATED, Screen.ORIENTATION_PORTRAIT, Screen.ORIENTATION_LANDSCAPE, Screen.ORIENTATION_PORTRAIT_ROTATED}, args = {Screen.ORIENTATION_LANDSCAPE_ROTATED, Screen.ORIENTATION_PORTRAIT, Screen.ORIENTATION_LANDSCAPE, Screen.ORIENTATION_PORTRAIT_ROTATED},
@ -33,8 +33,8 @@ local CreOptions = {
}, },
{ {
name = "visible_pages", name = "visible_pages",
name_text = S.DUAL_PAGES, name_text = _("Dual Pages"),
toggle = {S.OFF, S.ON}, toggle = {_("off"), _("on")},
values = {1, 2}, values = {1, 2},
default_value = 1, default_value = 1,
args = {1, 2}, args = {1, 2},
@ -63,7 +63,7 @@ Note that this may not be ensured under some conditions: in scroll mode, when a
options = { options = {
{ {
name = "h_page_margins", name = "h_page_margins",
name_text = S.H_PAGE_MARGINS, name_text = _("L/R Margins"),
buttonprogress = true, buttonprogress = true,
fine_tune = true, fine_tune = true,
values = { values = {
@ -96,8 +96,8 @@ Note that this may not be ensured under some conditions: in scroll mode, when a
}, },
{ {
name = "sync_t_b_page_margins", name = "sync_t_b_page_margins",
name_text = S.SYNC_T_B_PAGE_MARGINS, name_text = _("Sync T/B Margins"),
toggle = {S.OFF, S.ON}, toggle = {_("off"), _("on")},
values = {0, 1}, values = {0, 1},
default_value = 0, default_value = 0,
event = "SyncPageTopBottomMargins", event = "SyncPageTopBottomMargins",
@ -113,7 +113,7 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m
}, },
{ {
name = "t_page_margin", name = "t_page_margin",
name_text = S.T_PAGE_MARGIN, name_text = _("Top Margin"),
buttonprogress = true, buttonprogress = true,
fine_tune = true, fine_tune = true,
values = { values = {
@ -146,7 +146,7 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m
}, },
{ {
name = "b_page_margin", name = "b_page_margin",
name_text = S.B_PAGE_MARGIN, name_text = _("Bottom Margin"),
buttonprogress = true, buttonprogress = true,
fine_tune = true, fine_tune = true,
values = { values = {
@ -185,8 +185,8 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m
options = { options = {
{ {
name = "view_mode", name = "view_mode",
name_text = S.VIEW_MODE, name_text = _("View Mode"),
toggle = {S.VIEW_PAGE, S.VIEW_SCROLL}, toggle = {_("page"), _("continuous")},
values = {0, 1}, values = {0, 1},
default_value = 0, default_value = 0,
args = {"page", "scroll"}, args = {"page", "scroll"},
@ -198,8 +198,8 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m
}, },
{ {
name = "block_rendering_mode", name = "block_rendering_mode",
name_text = S.BLOCK_RENDERING_MODE, name_text = _("Render Mode"),
toggle = {S.LEGACY, S.FLAT, S.BOOK, S.WEB}, toggle = {_("legacy"), _("flat"), _("book"), _("web")},
values = {0, 1, 2, 3}, values = {0, 1, 2, 3},
default_value = 2, default_value = 2,
args = {0, 1, 2, 3}, args = {0, 1, 2, 3},
@ -214,12 +214,12 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m
}, },
{ {
name = "render_dpi", name = "render_dpi",
name_text = S.ZOOM_DPI, name_text = _("Zoom (dpi)"),
more_options = true, more_options = true,
more_options_param = { more_options_param = {
value_hold_step = 20, value_hold_step = 20,
}, },
toggle = {S.OFF, "48", "96¹¹", "167", "212", "300"}, toggle = {_("off"), "48", "96¹¹", "167", "212", "300"},
values = {0, 48, 96, 167, 212, 300}, values = {0, 48, 96, 167, 212, 300},
default_value = 96, default_value = 96,
args = {0, 48, 96, 167, 212, 300}, args = {0, 48, 96, 167, 212, 300},
@ -234,7 +234,7 @@ Note that your selected font size is not affected by this setting.]]),
}, },
{ {
name = "line_spacing", name = "line_spacing",
name_text = S.LINE_SPACING, name_text = _("Line Spacing"),
buttonprogress = true, buttonprogress = true,
values = { values = {
DCREREADER_CONFIG_LINE_SPACE_PERCENT_X_TINY, DCREREADER_CONFIG_LINE_SPACE_PERCENT_X_TINY,
@ -301,9 +301,9 @@ Note that your selected font size is not affected by this setting.]]),
}, },
{ {
name = "font_fine_tune", name = "font_fine_tune",
name_text = S.FONT_SIZE, name_text = _("Font Size"),
toggle = Device:isTouchDevice() and {S.DECREASE, S.INCREASE} or nil, toggle = Device:isTouchDevice() and {_("decrease"), _("increase")} or nil,
item_text = not Device:isTouchDevice() and {S.DECREASE, S.INCREASE} or nil, item_text = not Device:isTouchDevice() and {_("decrease"), _("increase")} or nil,
more_options = true, more_options = true,
more_options_param = { more_options_param = {
value_min = 12, value_min = 12,
@ -329,7 +329,7 @@ Note that your selected font size is not affected by this setting.]]),
}, },
{ {
name = "word_spacing", name = "word_spacing",
name_text = S.WORD_SPACING, name_text = _("Word Spacing"),
more_options = true, more_options = true,
more_options_param = { more_options_param = {
name = "word_spacing", name = "word_spacing",
@ -349,7 +349,7 @@ Note that your selected font size is not affected by this setting.]]),
right_hold_step = 10, right_hold_step = 10,
event = "SetWordSpacing", event = "SetWordSpacing",
}, },
toggle = {S.SMALL, S.MEDIUM, S.LARGE}, toggle = {_("small"), _("medium"), _("large")},
values = { values = {
DCREREADER_CONFIG_WORD_SPACING_SMALL, DCREREADER_CONFIG_WORD_SPACING_SMALL,
DCREREADER_CONFIG_WORD_SPACING_MEDIUM, DCREREADER_CONFIG_WORD_SPACING_MEDIUM,
@ -371,7 +371,7 @@ Note that your selected font size is not affected by this setting.]]),
}, },
{ {
name = "word_expansion", name = "word_expansion",
name_text = S.WORD_EXPANSION, name_text = _("Word Expansion"),
more_options = true, more_options = true,
more_options_param = { more_options_param = {
value_min = 0, value_min = 0,
@ -383,7 +383,7 @@ Note that your selected font size is not affected by this setting.]]),
info_text = _([[Set max word expansion as a % of the font size.]]), info_text = _([[Set max word expansion as a % of the font size.]]),
event = "SetWordExpansion", event = "SetWordExpansion",
}, },
toggle = {S.NONE, S.SOME, S.MORE}, toggle = {_("none"), _("some"), _("more")},
values = { values = {
DCREREADER_CONFIG_WORD_EXPANSION_NONE, DCREREADER_CONFIG_WORD_EXPANSION_NONE,
DCREREADER_CONFIG_WORD_EXPANSION_SOME, DCREREADER_CONFIG_WORD_EXPANSION_SOME,
@ -410,8 +410,8 @@ Note that your selected font size is not affected by this setting.]]),
options = { options = {
{ {
name = "font_weight", name = "font_weight",
name_text = S.FONT_WEIGHT, name_text = _("Font Weight"),
toggle = {S.REGULAR, S.BOLD}, toggle = {_("regular"), _("bold")},
values = {0, 1}, values = {0, 1},
default_value = 0, default_value = 0,
args = {0, 1}, args = {0, 1},
@ -420,7 +420,7 @@ Note that your selected font size is not affected by this setting.]]),
}, },
{ {
name = "font_gamma", name = "font_gamma",
name_text = S.CONTRAST, name_text = _("Contrast"),
buttonprogress = true, buttonprogress = true,
default_value = 15, -- gamma = 1.0 default_value = 15, -- gamma = 1.0
default_pos = 2, default_pos = 2,
@ -446,8 +446,8 @@ Note that your selected font size is not affected by this setting.]]),
}, },
{ {
name = "font_hinting", name = "font_hinting",
name_text = S.FONT_HINT, name_text = _("Font Hinting"),
toggle = {S.OFF, S.NATIVE, S.AUTO}, toggle = {_("off"), _("native"), _("auto")},
values = {0, 1, 2}, values = {0, 1, 2},
default_value = 2, default_value = 2,
args = {0, 1, 2}, args = {0, 1, 2},
@ -461,8 +461,8 @@ Note that your selected font size is not affected by this setting.]]),
}, },
{ {
name = "font_kerning", name = "font_kerning",
name_text = S.FONT_KERNING, name_text = _("Font Kerning"),
toggle = {S.OFF, S.FAST, S.GOOD, S.BEST}, toggle = {_("off"), _("fast"), _("good"), _("best")},
values = {0, 1, 2, 3}, values = {0, 1, 2, 3},
default_value = 3, default_value = 3,
args = {0, 1, 2, 3}, args = {0, 1, 2, 3},
@ -484,8 +484,8 @@ Note that your selected font size is not affected by this setting.]]),
options = { options = {
{ {
name = "status_line", name = "status_line",
name_text = S.ALT_STATUS_BAR, name_text = _("Alt Status Bar"),
toggle = {S.OFF, S.ON}, toggle = {_("off"), _("on")},
values = {1, 0}, values = {1, 0},
default_value = 1, -- Note that 1 means KOReader (bottom) status bar only default_value = 1, -- Note that 1 means KOReader (bottom) status bar only
args = {1, 0}, args = {1, 0},
@ -498,8 +498,8 @@ Whether enabled or disabled, KOReader's own status bar at the bottom of the scre
}, },
{ {
name = "embedded_css", name = "embedded_css",
name_text = S.EMBEDDED_STYLE, name_text = _("Embedded Style"),
toggle = {S.OFF, S.ON}, toggle = {_("off"), _("on")},
values = {0, 1}, values = {0, 1},
default_value = 1, default_value = 1,
args = {false, true}, args = {false, true},
@ -511,8 +511,8 @@ Whether enabled or disabled, KOReader's own status bar at the bottom of the scre
}, },
{ {
name = "embedded_fonts", name = "embedded_fonts",
name_text = S.EMBEDDED_FONTS, name_text = _("Embedded Fonts"),
toggle = {S.OFF, S.ON}, toggle = {_("off"), _("on")},
values = {0, 1}, values = {0, 1},
default_value = 1, default_value = 1,
args = {false, true}, args = {false, true},
@ -527,8 +527,8 @@ Whether enabled or disabled, KOReader's own status bar at the bottom of the scre
}, },
{ {
name = "smooth_scaling", name = "smooth_scaling",
name_text = S.IMAGE_SCALING, name_text = _("Image Scaling"),
toggle = {S.FAST, S.BEST}, toggle = {_("fast"), _("best")},
values = {0, 1}, values = {0, 1},
default_value = 0, default_value = 0,
args = {false, true}, args = {false, true},
@ -540,8 +540,8 @@ Whether enabled or disabled, KOReader's own status bar at the bottom of the scre
}, },
{ {
name = "nightmode_images", name = "nightmode_images",
name_text = S.NIGHTMODE_IMAGES, name_text = _("Invert Images"),
toggle = {S.ON, S.OFF}, toggle = {_("on"), _("off")},
values = {1, 0}, values = {1, 0},
default_value = 1, default_value = 1,
args = {true, false}, args = {true, false},

@ -1,8 +1,8 @@
local BD = require("ui/bidi") local BD = require("ui/bidi")
local Device = require("device") local Device = require("device")
local S = require("ui/data/strings")
local optionsutil = require("ui/data/optionsutil") local optionsutil = require("ui/data/optionsutil")
local _ = require("gettext") local _ = require("gettext")
local C_ = _.pgettext
local Screen = Device.screen local Screen = Device.screen
-- The values used for Font Size are not actually font sizes, but kopt zoom levels. -- The values used for Font Size are not actually font sizes, but kopt zoom levels.
@ -27,8 +27,8 @@ local KoptOptions = {
options = { options = {
{ {
name = "rotation_mode", name = "rotation_mode",
name_text = S.SCREEN_MODE, name_text = _("Rotation"),
toggle = {S.LANDSCAPE_ROTATED, S.PORTRAIT, S.LANDSCAPE, S.PORTRAIT_ROTATED}, toggle = {C_("Rotation", "⤹ 90°"), C_("Rotation", "↑ 0°"), C_("Rotation", "⤸ 90°"), C_("Rotation", "↓ 180°")},
alternate = false, alternate = false,
values = {Screen.ORIENTATION_LANDSCAPE_ROTATED, Screen.ORIENTATION_PORTRAIT, Screen.ORIENTATION_LANDSCAPE, Screen.ORIENTATION_PORTRAIT_ROTATED}, values = {Screen.ORIENTATION_LANDSCAPE_ROTATED, Screen.ORIENTATION_PORTRAIT, Screen.ORIENTATION_LANDSCAPE, Screen.ORIENTATION_PORTRAIT_ROTATED},
args = {Screen.ORIENTATION_LANDSCAPE_ROTATED, Screen.ORIENTATION_PORTRAIT, Screen.ORIENTATION_LANDSCAPE, Screen.ORIENTATION_PORTRAIT_ROTATED}, args = {Screen.ORIENTATION_LANDSCAPE_ROTATED, Screen.ORIENTATION_PORTRAIT, Screen.ORIENTATION_LANDSCAPE, Screen.ORIENTATION_PORTRAIT_ROTATED},
@ -44,10 +44,10 @@ local KoptOptions = {
options = { options = {
{ {
name = "trim_page", name = "trim_page",
name_text = S.PAGE_CROP, name_text = _("Page Crop"),
-- manual=0, auto=1, semi-auto=2, none=3 -- manual=0, auto=1, semi-auto=2, none=3
-- ordered from least to max cropping done or possible -- ordered from least to max cropping done or possible
toggle = {S.NONE, S.AUTO, S.SEMIAUTO, S.MANUAL}, toggle = {_("none"), _("auto"), _("semi-auto"), _("manual")},
alternate = false, alternate = false,
values = {3, 1, 2, 0}, values = {3, 1, 2, 0},
default_value = DKOPTREADER_CONFIG_TRIM_PAGE, default_value = DKOPTREADER_CONFIG_TRIM_PAGE,
@ -66,8 +66,8 @@ In 'semi-auto' and 'manual' modes, you may need to define areas once on an odd p
}, },
{ {
name = "page_margin", name = "page_margin",
name_text = S.PAGE_MARGIN, name_text = _("Margin"),
toggle = {S.SMALL, S.MEDIUM, S.LARGE}, toggle = {_("small"), _("medium"), _("large")},
values = {0.05, 0.10, 0.25}, values = {0.05, 0.10, 0.25},
default_value = DKOPTREADER_CONFIG_PAGE_MARGIN, default_value = DKOPTREADER_CONFIG_PAGE_MARGIN,
event = "MarginUpdate", event = "MarginUpdate",
@ -232,8 +232,8 @@ left to right or reverse, top to bottom or reverse.]]),
options = { options = {
{ {
name = "page_scroll", name = "page_scroll",
name_text = S.VIEW_MODE, name_text = _("View Mode"),
toggle = {S.VIEW_PAGE, S.VIEW_SCROLL}, toggle = {_("page"), _("continuous")},
values = {0, 1}, values = {0, 1},
default_value = 1, default_value = 1,
event = "SetScrollMode", event = "SetScrollMode",
@ -244,8 +244,8 @@ left to right or reverse, top to bottom or reverse.]]),
}, },
{ {
name = "page_gap_height", name = "page_gap_height",
name_text = S.PAGE_GAP, name_text = _("Page Gap"),
toggle = {S.NONE, S.SMALL, S.MEDIUM, S.LARGE}, toggle = {_("none"), _("small"), _("medium"), _("large")},
values = {0, 8, 16, 32}, values = {0, 8, 16, 32},
default_value = 8, default_value = 8,
args = {0, 8, 16, 32}, args = {0, 8, 16, 32},
@ -258,8 +258,8 @@ left to right or reverse, top to bottom or reverse.]]),
}, },
{ {
name = "full_screen", name = "full_screen",
name_text = S.PROGRESS_BAR, name_text = _("Progress Bar"),
toggle = {S.OFF, S.ON}, toggle = {_("off"), _("on")},
values = {1, 0}, values = {1, 0},
default_value = 1, default_value = 1,
event = "SetFullScreen", event = "SetFullScreen",
@ -269,8 +269,8 @@ left to right or reverse, top to bottom or reverse.]]),
}, },
{ {
name = "line_spacing", name = "line_spacing",
name_text = S.LINE_SPACING, name_text = _("Line Spacing"),
toggle = {S.SMALL, S.MEDIUM, S.LARGE}, toggle = {_("small"), _("medium"), _("large")},
values = {1.0, 1.2, 1.4}, values = {1.0, 1.2, 1.4},
default_value = DKOPTREADER_CONFIG_LINE_SPACING, default_value = DKOPTREADER_CONFIG_LINE_SPACING,
advanced = true, advanced = true,
@ -283,7 +283,8 @@ left to right or reverse, top to bottom or reverse.]]),
}, },
{ {
name = "justification", name = "justification",
name_text = S.TEXT_ALIGN, --- @translators Text alignment. Options given as icons: left, right, center, justify.
name_text = _("Alignment"),
item_icons = { item_icons = {
"resources/icons/appbar.align.auto.png", "resources/icons/appbar.align.auto.png",
"resources/icons/appbar.align.left.png", "resources/icons/appbar.align.left.png",
@ -297,7 +298,13 @@ left to right or reverse, top to bottom or reverse.]]),
enabled_func = function(configurable) enabled_func = function(configurable)
return optionsutil.enableIfEquals(configurable, "text_wrap", 1) return optionsutil.enableIfEquals(configurable, "text_wrap", 1)
end, end,
labels = {S.AUTO, S.LEFT, S.CENTER, S.RIGHT, S.JUSTIFY}, labels = {
C_("Alignment", "auto"),
C_("Alignment", "left"),
C_("Alignment", "center"),
C_("Alignment", "right"),
C_("Alignment", "justify"),
},
name_text_hold_callback = optionsutil.showValues, name_text_hold_callback = optionsutil.showValues,
help_text = _([[In reflow mode, sets the text alignment. help_text = _([[In reflow mode, sets the text alignment.
The first option ("auto") tries to automatically align reflowed text as it is in the original document.]]), The first option ("auto") tries to automatically align reflowed text as it is in the original document.]]),
@ -325,9 +332,9 @@ The first option ("auto") tries to automatically align reflowed text as it is in
}, },
{ {
name = "font_fine_tune", name = "font_fine_tune",
name_text = S.FONT_SIZE, name_text = _("Font Size"),
toggle = Device:isTouchDevice() and {S.DECREASE, S.INCREASE} or nil, toggle = Device:isTouchDevice() and {_("decrease"), _("increase")} or nil,
item_text = not Device:isTouchDevice() and {S.DECREASE, S.INCREASE} or nil, item_text = not Device:isTouchDevice() and {_("decrease"), _("increase")} or nil,
values = {-0.05, 0.05}, values = {-0.05, 0.05},
default_value = 0.05, default_value = 0.05,
event = "FineTuningFontSize", event = "FineTuningFontSize",
@ -348,8 +355,8 @@ The first option ("auto") tries to automatically align reflowed text as it is in
}, },
{ {
name = "word_spacing", name = "word_spacing",
name_text = S.WORD_GAP, name_text = _("Word Gap"),
toggle = {S.SMALL, S.AUTO, S.LARGE}, toggle = {_("small"), _("auto"), _("large")},
values = DKOPTREADER_CONFIG_WORD_SPACINGS, values = DKOPTREADER_CONFIG_WORD_SPACINGS,
default_value = DKOPTREADER_CONFIG_DEFAULT_WORD_SPACING, default_value = DKOPTREADER_CONFIG_DEFAULT_WORD_SPACING,
enabled_func = function(configurable) enabled_func = function(configurable)
@ -360,8 +367,9 @@ The first option ("auto") tries to automatically align reflowed text as it is in
}, },
{ {
name = "text_wrap", name = "text_wrap",
name_text = S.REFLOW, --- @translators Reflow text.
toggle = {S.OFF, S.ON}, name_text = _("Reflow"),
toggle = {_("off"), _("on")},
values = {0, 1}, values = {0, 1},
default_value = DKOPTREADER_CONFIG_TEXT_WRAP, default_value = DKOPTREADER_CONFIG_TEXT_WRAP,
events = { events = {
@ -386,7 +394,7 @@ Some of the other settings are only available when reflow mode is enabled.]]),
options = { options = {
{ {
name = "contrast", name = "contrast",
name_text = S.CONTRAST, name_text = _("Contrast"),
buttonprogress = true, buttonprogress = true,
-- See https://github.com/koreader/koreader/issues/1299#issuecomment-65183895 -- See https://github.com/koreader/koreader/issues/1299#issuecomment-65183895
-- For pdf reflowing mode (kopt_contrast): -- For pdf reflowing mode (kopt_contrast):
@ -401,8 +409,8 @@ Some of the other settings are only available when reflow mode is enabled.]]),
}, },
{ {
name = "page_opt", name = "page_opt",
name_text = S.DEWATERMARK, name_text = _("Dewatermark"),
toggle = {S.OFF, S.ON}, toggle = {_("off"), _("on")},
values = {0, 1}, values = {0, 1},
default_value = 0, default_value = 0,
name_text_hold_callback = optionsutil.showValues, name_text_hold_callback = optionsutil.showValues,
@ -411,8 +419,8 @@ This can also be used to remove some gray background or to convert a grayscale o
}, },
{ {
name = "hw_dithering", name = "hw_dithering",
name_text = S.HW_DITHERING, name_text = _("Dithering"),
toggle = {S.OFF, S.ON}, toggle = {_("off"), _("on")},
values = {0, 1}, values = {0, 1},
default_value = 0, default_value = 0,
advanced = true, advanced = true,
@ -422,8 +430,8 @@ This can also be used to remove some gray background or to convert a grayscale o
}, },
{ {
name = "quality", name = "quality",
name_text = S.RENDER_QUALITY, name_text = C_("Quality", "Render Quality"),
toggle = {S.LOW, S.DEFAULT, S.HIGH}, toggle = {C_("Quality", "low"), C_("Quality", "default"), C_("Quality", "high")},
values={0.5, 1.0, 1.5}, values={0.5, 1.0, 1.5},
default_value = DKOPTREADER_CONFIG_RENDER_QUALITY, default_value = DKOPTREADER_CONFIG_RENDER_QUALITY,
advanced = true, advanced = true,
@ -440,7 +448,7 @@ This can also be used to remove some gray background or to convert a grayscale o
options = { options = {
{ {
name="doc_language", name="doc_language",
name_text = S.DOC_LANG, name_text = _("Document Language"),
toggle = DKOPTREADER_CONFIG_DOC_LANGS_TEXT, toggle = DKOPTREADER_CONFIG_DOC_LANGS_TEXT,
values = DKOPTREADER_CONFIG_DOC_LANGS_CODE, values = DKOPTREADER_CONFIG_DOC_LANGS_CODE,
default_value = DKOPTREADER_CONFIG_DOC_DEFAULT_LANG_CODE, default_value = DKOPTREADER_CONFIG_DOC_DEFAULT_LANG_CODE,
@ -451,8 +459,9 @@ This can also be used to remove some gray background or to convert a grayscale o
}, },
{ {
name = "forced_ocr", name = "forced_ocr",
name_text = S.FORCED_OCR, --- @translators If OCR is unclear, please see https://en.wikipedia.org/wiki/Optical_character_recognition
toggle = {S.OFF, S.ON}, name_text = _("Forced OCR"),
toggle = {_("off"), _("on")},
values = {0, 1}, values = {0, 1},
default_value = 0, default_value = 0,
advanced = true, advanced = true,
@ -461,11 +470,18 @@ This can also be used to remove some gray background or to convert a grayscale o
}, },
{ {
name = "writing_direction", name = "writing_direction",
name_text = S.WRITING_DIR, name_text = _("Writing Direction"),
enabled_func = function(configurable) enabled_func = function(configurable)
return optionsutil.enableIfEquals(configurable, "text_wrap", 1) return optionsutil.enableIfEquals(configurable, "text_wrap", 1)
end, end,
toggle = {S.LTR, S.RTL, S.TBRTL}, toggle = {
--- @translators LTR is left to right, which is the regular European writing direction.
_("LTR"),
--- @translators RTL is right to left, which is the regular writing direction in languages like Hebrew, Arabic, Persian and Urdu.
_("RTL"),
--- @translators TBRTL is top-to-bottom-right-to-left, which is a traditional Chinese/Japanese writing direction.
_("TBRTL"),
},
values = {0, 1, 2}, values = {0, 1, 2},
default_value = 0, default_value = 0,
name_text_hold_callback = optionsutil.showValues, name_text_hold_callback = optionsutil.showValues,
@ -473,8 +489,9 @@ This can also be used to remove some gray background or to convert a grayscale o
}, },
{ {
name = "defect_size", name = "defect_size",
name_text = S.DEFECT_SIZE, --- @translators The maximum size of a dust or ink speckle to be ignored instead of being considered a character.
toggle = {S.SMALL, S.MEDIUM, S.LARGE}, name_text = _("Reflow Speckle Ignore Size"),
toggle = {_("small"), _("medium"), _("large")},
values = {1.0, 3.0, 5.0}, values = {1.0, 3.0, 5.0},
default_value = DKOPTREADER_CONFIG_DEFECT_SIZE, default_value = DKOPTREADER_CONFIG_DEFECT_SIZE,
event = "DefectSizeUpdate", event = "DefectSizeUpdate",
@ -486,8 +503,8 @@ This can also be used to remove some gray background or to convert a grayscale o
}, },
{ {
name = "auto_straighten", name = "auto_straighten",
name_text = S.AUTO_STRAIGHTEN, name_text = _("Auto Straighten"),
toggle = {S.ZERO_DEG, S.FIVE_DEG, S.TEN_DEG}, toggle = {_("0 deg"), _("5 deg"), _("10 deg")},
values = {0, 5, 10}, values = {0, 5, 10},
default_value = DKOPTREADER_CONFIG_AUTO_STRAIGHTEN, default_value = DKOPTREADER_CONFIG_AUTO_STRAIGHTEN,
show = false, -- does not work (and slows rendering) show = false, -- does not work (and slows rendering)
@ -498,8 +515,8 @@ This can also be used to remove some gray background or to convert a grayscale o
}, },
{ {
name = "detect_indent", name = "detect_indent",
name_text = S.INDENTATION, name_text = _("Indentation"),
toggle = {S.OFF, S.ON}, toggle = {_("off"), _("on")},
values = {0, 1}, values = {0, 1},
default_value = DKOPTREADER_CONFIG_DETECT_INDENT, default_value = DKOPTREADER_CONFIG_DETECT_INDENT,
show = false, -- does not work show = false, -- does not work
@ -510,7 +527,7 @@ This can also be used to remove some gray background or to convert a grayscale o
}, },
{ {
name = "max_columns", name = "max_columns",
name_text = S.DOCUMENT_COLUMNS, name_text = _("Document Columns"),
item_icons = { item_icons = {
"resources/icons/appbar.column.one.png", "resources/icons/appbar.column.one.png",
"resources/icons/appbar.column.two.png", "resources/icons/appbar.column.two.png",

@ -1,106 +0,0 @@
local _ = require("gettext")
local C_ = _.pgettext
local S = {}
S.SCREEN_MODE = _("Rotation")
S.DUAL_PAGES = _("Dual Pages")
S.PAGE_CROP = _("Page Crop")
S.FULL_SCREEN = _("Full Screen")
S.ZOOM_DPI = _("Zoom (dpi)")
S.PAGE_MARGIN = _("Margin")
S.H_PAGE_MARGINS = _("L/R Margins")
S.T_PAGE_MARGIN = _("Top Margin")
S.B_PAGE_MARGIN = _("Bottom Margin")
S.SYNC_T_B_PAGE_MARGINS = _("Sync T/B Margins")
S.LINE_SPACING = _("Line Spacing")
S.DOCUMENT_COLUMNS = _("Document Columns")
-- @translators Text alignment. Options given as icons: left, right, center, justify.
S.TEXT_ALIGN = _("Alignment")
S.FONT_SIZE = _("Font Size")
S.CONTRAST = _("Contrast")
-- @translators Reflow text.
S.REFLOW = _("Reflow")
S.DEWATERMARK = _("Dewatermark")
S.DOC_LANG = _("Document Language")
S.VERTICAL_TEXT = _("Vertical Text")
S.WORD_GAP = _("Word Gap")
-- @translators The maximum size of a dust or ink speckle to be ignored instead of being considered a character.
S.DEFECT_SIZE = _("Reflow Speckle Ignore Size")
S.RENDER_QUALITY = _("Render Quality")
S.AUTO_STRAIGHTEN = _("Auto Straighten")
S.INDENTATION = _("Indentation")
S.FONT_WEIGHT = _("Font Weight")
S.GAMMA = _("Gamma")
S.FONT_HINT = _("Font Hinting")
S.FONT_KERNING = _("Font Kerning")
S.WORD_SPACING = _("Word Spacing")
S.WORD_EXPANSION = _("Word Expansion")
S.VIEW_MODE = _("View Mode")
S.EMBEDDED_STYLE = _("Embedded Style")
S.EMBEDDED_FONTS = _("Embedded Fonts")
S.BLOCK_RENDERING_MODE = _("Render Mode")
S.WRITING_DIR = _("Writing Direction")
S.PROGRESS_BAR = _("Progress Bar")
S.ALT_STATUS_BAR = _("Alt Status Bar")
-- @translators If OCR is unclear, please see https://en.wikipedia.org/wiki/Optical_character_recognition
S.FORCED_OCR = _("Forced OCR")
S.HW_DITHERING = _("Dithering")
S.INVERSE_READING_ORDER = _("Inverse Order")
S.IMAGE_SCALING = _("Image Scaling")
S.NIGHTMODE_IMAGES = _("Invert Images")
S.PAGE_GAP = _("Page Gap")
S.ON = _("on")
S.OFF = _("off")
S.AUTO = _("auto")
S.MANUAL = _("manual")
S.SEMIAUTO = _("semi-auto")
S.NONE = _("none")
S.SMALL = _("small")
S.MEDIUM = _("medium")
S.LARGE = _("large")
S.SOME = _("some")
S.MORE = _("more")
S.DECREASE = _("decrease")
S.INCREASE = _("increase")
S.LIGHTEST = _("lightest")
S.LIGHTER = _("lighter")
S.DEFAULT = _("default")
S.DARKER = _("darker")
S.NATIVE = _("native")
S.FAST = _("fast")
S.GOOD = _("good")
S.BEST = _("best")
S.ENHANCED = _("enhanced")
S.LOW = _("low")
S.HIGH = _("high")
S.ZERO_DEG = _("0 deg")
S.FIVE_DEG = _("5 deg")
S.TEN_DEG = _("10 deg")
S.PORTRAIT = C_("Rotation", "↑ 0°")
S.LANDSCAPE = C_("Rotation", "⤸ 90°")
S.PORTRAIT_ROTATED = C_("Rotation", "↓ 180°")
S.LANDSCAPE_ROTATED = C_("Rotation", "⤹ 90°")
S.REGULAR = _("regular")
S.BOLD = _("bold")
S.VIEW_SCROLL = _("continuous")
S.VIEW_PAGE = _("page")
-- @translators LTR is left to right, which is the regular European writing direction.
S.LTR = _("LTR")
-- @translators RTL is right to left, which is the regular writing direction in languages like Hebrew, Arabic, Persian and Urdu.
S.RTL = _("RTL")
-- @translators TBRTL is top-to-bottom-right-to-left, which is a traditional Chinese/Japanese writing direction.
S.TBRTL = _("TBRTL")
-- @translators TBLTR is top-to-bottom-left-to-right, which is a traditional Chinese/Japanese writing direction.
S.TBLTR = _("TBLTR")
S.LEFT = _("left")
S.CENTER = _("center")
S.RIGHT = _("right")
S.JUSTIFY = _("justify")
S.LEGACY = _("legacy")
S.FLAT = _("flat")
S.BOOK = _("book")
S.WEB = _("web")
return S

@ -1,10 +1,10 @@
local _ = require("gettext")
local Device = require("device") local Device = require("device")
local Event = require("ui/event") local Event = require("ui/event")
local FileManager = require("apps/filemanager/filemanager") local FileManager = require("apps/filemanager/filemanager")
local UIManager = require("ui/uimanager") local UIManager = require("ui/uimanager")
local _ = require("gettext")
local C_ = _.pgettext
local Screen = Device.screen local Screen = Device.screen
local S = require("ui/data/strings")
return { return {
text = _("Rotation"), text = _("Rotation"),
@ -63,7 +63,7 @@ When unchecked, the default rotation of the file browser and the default/saved r
if FileManager.instance then if FileManager.instance then
table.insert(rotation_table, { table.insert(rotation_table, {
text_func = function() text_func = function()
local text = S.LANDSCAPE_ROTATED local text = C_("Rotation", "⤹ 90°")
if G_reader_settings:readSetting("fm_rotation_mode") == Screen.ORIENTATION_LANDSCAPE_ROTATED then if G_reader_settings:readSetting("fm_rotation_mode") == Screen.ORIENTATION_LANDSCAPE_ROTATED then
text = text .. "" text = text .. ""
end end
@ -83,7 +83,7 @@ When unchecked, the default rotation of the file browser and the default/saved r
}) })
table.insert(rotation_table, { table.insert(rotation_table, {
text_func = function() text_func = function()
local text = S.PORTRAIT local text = C_("Rotation", "↑ 0°")
if G_reader_settings:readSetting("fm_rotation_mode") == Screen.ORIENTATION_PORTRAIT then if G_reader_settings:readSetting("fm_rotation_mode") == Screen.ORIENTATION_PORTRAIT then
text = text .. "" text = text .. ""
end end
@ -103,7 +103,7 @@ When unchecked, the default rotation of the file browser and the default/saved r
}) })
table.insert(rotation_table, { table.insert(rotation_table, {
text_func = function() text_func = function()
local text = S.LANDSCAPE local text = C_("Rotation", "⤸ 90°")
if G_reader_settings:readSetting("fm_rotation_mode") == Screen.ORIENTATION_LANDSCAPE then if G_reader_settings:readSetting("fm_rotation_mode") == Screen.ORIENTATION_LANDSCAPE then
text = text .. "" text = text .. ""
end end
@ -123,7 +123,7 @@ When unchecked, the default rotation of the file browser and the default/saved r
}) })
table.insert(rotation_table, { table.insert(rotation_table, {
text_func = function() text_func = function()
local text = S.PORTRAIT_ROTATED local text = C_("Rotation", "↓ 180°")
if G_reader_settings:readSetting("fm_rotation_mode") == Screen.ORIENTATION_PORTRAIT_ROTATED then if G_reader_settings:readSetting("fm_rotation_mode") == Screen.ORIENTATION_PORTRAIT_ROTATED then
text = text .. "" text = text .. ""
end end

Loading…
Cancel
Save