From 1f16815f94c4748e48b703154608a47e29bd86de Mon Sep 17 00:00:00 2001 From: jperon Date: Sun, 29 Nov 2020 10:18:59 +0100 Subject: [PATCH] [chore] Get rid of ui/data/strings.lua (#6921) As suggested [here](https://github.com/koreader/koreader/pull/6885#issuecomment-734865881) --- frontend/ui/data/creoptions.lua | 82 +++++++------- frontend/ui/data/koptoptions.lua | 103 ++++++++++------- frontend/ui/data/strings.lua | 106 ------------------ .../elements/screen_rotation_menu_table.lua | 12 +- 4 files changed, 107 insertions(+), 196 deletions(-) delete mode 100644 frontend/ui/data/strings.lua diff --git a/frontend/ui/data/creoptions.lua b/frontend/ui/data/creoptions.lua index fc3f13f54..de1f5855f 100644 --- a/frontend/ui/data/creoptions.lua +++ b/frontend/ui/data/creoptions.lua @@ -1,8 +1,8 @@ local Device = require("device") local Screen = Device.screen -local S = require("ui/data/strings") local optionsutil = require("ui/data/optionsutil") local _ = require("gettext") +local C_ = _.pgettext -- Get font size numbers as a table of strings local tableOfNumbersToTableOfStrings = function(numbers) @@ -21,8 +21,8 @@ local CreOptions = { options = { { name = "rotation_mode", - name_text = S.SCREEN_MODE, - toggle = {S.LANDSCAPE_ROTATED, S.PORTRAIT, S.LANDSCAPE, S.PORTRAIT_ROTATED}, + name_text = _("Rotation"), + toggle = {C_("Rotation", "⤹ 90°"), C_("Rotation", "↑ 0°"), C_("Rotation", "⤸ 90°"), C_("Rotation", "↓ 180°")}, alternate = false, 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}, @@ -33,8 +33,8 @@ local CreOptions = { }, { name = "visible_pages", - name_text = S.DUAL_PAGES, - toggle = {S.OFF, S.ON}, + name_text = _("Dual Pages"), + toggle = {_("off"), _("on")}, values = {1, 2}, default_value = 1, args = {1, 2}, @@ -63,7 +63,7 @@ Note that this may not be ensured under some conditions: in scroll mode, when a options = { { name = "h_page_margins", - name_text = S.H_PAGE_MARGINS, + name_text = _("L/R Margins"), buttonprogress = true, fine_tune = true, 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_text = S.SYNC_T_B_PAGE_MARGINS, - toggle = {S.OFF, S.ON}, + name_text = _("Sync T/B Margins"), + toggle = {_("off"), _("on")}, values = {0, 1}, default_value = 0, 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_text = S.T_PAGE_MARGIN, + name_text = _("Top Margin"), buttonprogress = true, fine_tune = true, values = { @@ -146,7 +146,7 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m }, { name = "b_page_margin", - name_text = S.B_PAGE_MARGIN, + name_text = _("Bottom Margin"), buttonprogress = true, fine_tune = true, values = { @@ -185,8 +185,8 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m options = { { name = "view_mode", - name_text = S.VIEW_MODE, - toggle = {S.VIEW_PAGE, S.VIEW_SCROLL}, + name_text = _("View Mode"), + toggle = {_("page"), _("continuous")}, values = {0, 1}, default_value = 0, 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_text = S.BLOCK_RENDERING_MODE, - toggle = {S.LEGACY, S.FLAT, S.BOOK, S.WEB}, + name_text = _("Render Mode"), + toggle = {_("legacy"), _("flat"), _("book"), _("web")}, values = {0, 1, 2, 3}, default_value = 2, 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_text = S.ZOOM_DPI, + name_text = _("Zoom (dpi)"), more_options = true, more_options_param = { 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}, default_value = 96, 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_text = S.LINE_SPACING, + name_text = _("Line Spacing"), buttonprogress = true, values = { 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_text = S.FONT_SIZE, - toggle = Device:isTouchDevice() and {S.DECREASE, S.INCREASE} or nil, - item_text = not Device:isTouchDevice() and {S.DECREASE, S.INCREASE} or nil, + name_text = _("Font Size"), + toggle = Device:isTouchDevice() and {_("decrease"), _("increase")} or nil, + item_text = not Device:isTouchDevice() and {_("decrease"), _("increase")} or nil, more_options = true, more_options_param = { value_min = 12, @@ -329,7 +329,7 @@ Note that your selected font size is not affected by this setting.]]), }, { name = "word_spacing", - name_text = S.WORD_SPACING, + name_text = _("Word Spacing"), more_options = true, more_options_param = { name = "word_spacing", @@ -349,7 +349,7 @@ Note that your selected font size is not affected by this setting.]]), right_hold_step = 10, event = "SetWordSpacing", }, - toggle = {S.SMALL, S.MEDIUM, S.LARGE}, + toggle = {_("small"), _("medium"), _("large")}, values = { DCREREADER_CONFIG_WORD_SPACING_SMALL, 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_text = S.WORD_EXPANSION, + name_text = _("Word Expansion"), more_options = true, more_options_param = { 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.]]), event = "SetWordExpansion", }, - toggle = {S.NONE, S.SOME, S.MORE}, + toggle = {_("none"), _("some"), _("more")}, values = { DCREREADER_CONFIG_WORD_EXPANSION_NONE, DCREREADER_CONFIG_WORD_EXPANSION_SOME, @@ -410,8 +410,8 @@ Note that your selected font size is not affected by this setting.]]), options = { { name = "font_weight", - name_text = S.FONT_WEIGHT, - toggle = {S.REGULAR, S.BOLD}, + name_text = _("Font Weight"), + toggle = {_("regular"), _("bold")}, values = {0, 1}, default_value = 0, args = {0, 1}, @@ -420,7 +420,7 @@ Note that your selected font size is not affected by this setting.]]), }, { name = "font_gamma", - name_text = S.CONTRAST, + name_text = _("Contrast"), buttonprogress = true, default_value = 15, -- gamma = 1.0 default_pos = 2, @@ -446,8 +446,8 @@ Note that your selected font size is not affected by this setting.]]), }, { name = "font_hinting", - name_text = S.FONT_HINT, - toggle = {S.OFF, S.NATIVE, S.AUTO}, + name_text = _("Font Hinting"), + toggle = {_("off"), _("native"), _("auto")}, values = {0, 1, 2}, default_value = 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_text = S.FONT_KERNING, - toggle = {S.OFF, S.FAST, S.GOOD, S.BEST}, + name_text = _("Font Kerning"), + toggle = {_("off"), _("fast"), _("good"), _("best")}, values = {0, 1, 2, 3}, default_value = 3, args = {0, 1, 2, 3}, @@ -484,8 +484,8 @@ Note that your selected font size is not affected by this setting.]]), options = { { name = "status_line", - name_text = S.ALT_STATUS_BAR, - toggle = {S.OFF, S.ON}, + name_text = _("Alt Status Bar"), + toggle = {_("off"), _("on")}, values = {1, 0}, default_value = 1, -- Note that 1 means KOReader (bottom) status bar only 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_text = S.EMBEDDED_STYLE, - toggle = {S.OFF, S.ON}, + name_text = _("Embedded Style"), + toggle = {_("off"), _("on")}, values = {0, 1}, default_value = 1, 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_text = S.EMBEDDED_FONTS, - toggle = {S.OFF, S.ON}, + name_text = _("Embedded Fonts"), + toggle = {_("off"), _("on")}, values = {0, 1}, default_value = 1, 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_text = S.IMAGE_SCALING, - toggle = {S.FAST, S.BEST}, + name_text = _("Image Scaling"), + toggle = {_("fast"), _("best")}, values = {0, 1}, default_value = 0, 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_text = S.NIGHTMODE_IMAGES, - toggle = {S.ON, S.OFF}, + name_text = _("Invert Images"), + toggle = {_("on"), _("off")}, values = {1, 0}, default_value = 1, args = {true, false}, diff --git a/frontend/ui/data/koptoptions.lua b/frontend/ui/data/koptoptions.lua index ec176a864..00ef3962e 100644 --- a/frontend/ui/data/koptoptions.lua +++ b/frontend/ui/data/koptoptions.lua @@ -1,8 +1,8 @@ local BD = require("ui/bidi") local Device = require("device") -local S = require("ui/data/strings") local optionsutil = require("ui/data/optionsutil") local _ = require("gettext") +local C_ = _.pgettext local Screen = Device.screen -- The values used for Font Size are not actually font sizes, but kopt zoom levels. @@ -27,8 +27,8 @@ local KoptOptions = { options = { { name = "rotation_mode", - name_text = S.SCREEN_MODE, - toggle = {S.LANDSCAPE_ROTATED, S.PORTRAIT, S.LANDSCAPE, S.PORTRAIT_ROTATED}, + name_text = _("Rotation"), + toggle = {C_("Rotation", "⤹ 90°"), C_("Rotation", "↑ 0°"), C_("Rotation", "⤸ 90°"), C_("Rotation", "↓ 180°")}, alternate = false, 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}, @@ -44,10 +44,10 @@ local KoptOptions = { options = { { name = "trim_page", - name_text = S.PAGE_CROP, + name_text = _("Page Crop"), -- manual=0, auto=1, semi-auto=2, none=3 -- 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, values = {3, 1, 2, 0}, 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_text = S.PAGE_MARGIN, - toggle = {S.SMALL, S.MEDIUM, S.LARGE}, + name_text = _("Margin"), + toggle = {_("small"), _("medium"), _("large")}, values = {0.05, 0.10, 0.25}, default_value = DKOPTREADER_CONFIG_PAGE_MARGIN, event = "MarginUpdate", @@ -232,8 +232,8 @@ left to right or reverse, top to bottom or reverse.]]), options = { { name = "page_scroll", - name_text = S.VIEW_MODE, - toggle = {S.VIEW_PAGE, S.VIEW_SCROLL}, + name_text = _("View Mode"), + toggle = {_("page"), _("continuous")}, values = {0, 1}, default_value = 1, event = "SetScrollMode", @@ -244,8 +244,8 @@ left to right or reverse, top to bottom or reverse.]]), }, { name = "page_gap_height", - name_text = S.PAGE_GAP, - toggle = {S.NONE, S.SMALL, S.MEDIUM, S.LARGE}, + name_text = _("Page Gap"), + toggle = {_("none"), _("small"), _("medium"), _("large")}, values = {0, 8, 16, 32}, default_value = 8, args = {0, 8, 16, 32}, @@ -258,8 +258,8 @@ left to right or reverse, top to bottom or reverse.]]), }, { name = "full_screen", - name_text = S.PROGRESS_BAR, - toggle = {S.OFF, S.ON}, + name_text = _("Progress Bar"), + toggle = {_("off"), _("on")}, values = {1, 0}, default_value = 1, event = "SetFullScreen", @@ -269,8 +269,8 @@ left to right or reverse, top to bottom or reverse.]]), }, { name = "line_spacing", - name_text = S.LINE_SPACING, - toggle = {S.SMALL, S.MEDIUM, S.LARGE}, + name_text = _("Line Spacing"), + toggle = {_("small"), _("medium"), _("large")}, values = {1.0, 1.2, 1.4}, default_value = DKOPTREADER_CONFIG_LINE_SPACING, advanced = true, @@ -283,7 +283,8 @@ left to right or reverse, top to bottom or reverse.]]), }, { name = "justification", - name_text = S.TEXT_ALIGN, + --- @translators Text alignment. Options given as icons: left, right, center, justify. + name_text = _("Alignment"), item_icons = { "resources/icons/appbar.align.auto.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) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) 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, 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.]]), @@ -325,9 +332,9 @@ The first option ("auto") tries to automatically align reflowed text as it is in }, { name = "font_fine_tune", - name_text = S.FONT_SIZE, - toggle = Device:isTouchDevice() and {S.DECREASE, S.INCREASE} or nil, - item_text = not Device:isTouchDevice() and {S.DECREASE, S.INCREASE} or nil, + name_text = _("Font Size"), + toggle = Device:isTouchDevice() and {_("decrease"), _("increase")} or nil, + item_text = not Device:isTouchDevice() and {_("decrease"), _("increase")} or nil, values = {-0.05, 0.05}, default_value = 0.05, event = "FineTuningFontSize", @@ -348,8 +355,8 @@ The first option ("auto") tries to automatically align reflowed text as it is in }, { name = "word_spacing", - name_text = S.WORD_GAP, - toggle = {S.SMALL, S.AUTO, S.LARGE}, + name_text = _("Word Gap"), + toggle = {_("small"), _("auto"), _("large")}, values = DKOPTREADER_CONFIG_WORD_SPACINGS, default_value = DKOPTREADER_CONFIG_DEFAULT_WORD_SPACING, 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 = S.REFLOW, - toggle = {S.OFF, S.ON}, + --- @translators Reflow text. + name_text = _("Reflow"), + toggle = {_("off"), _("on")}, values = {0, 1}, default_value = DKOPTREADER_CONFIG_TEXT_WRAP, events = { @@ -386,7 +394,7 @@ Some of the other settings are only available when reflow mode is enabled.]]), options = { { name = "contrast", - name_text = S.CONTRAST, + name_text = _("Contrast"), buttonprogress = true, -- See https://github.com/koreader/koreader/issues/1299#issuecomment-65183895 -- 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_text = S.DEWATERMARK, - toggle = {S.OFF, S.ON}, + name_text = _("Dewatermark"), + toggle = {_("off"), _("on")}, values = {0, 1}, default_value = 0, 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_text = S.HW_DITHERING, - toggle = {S.OFF, S.ON}, + name_text = _("Dithering"), + toggle = {_("off"), _("on")}, values = {0, 1}, default_value = 0, 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_text = S.RENDER_QUALITY, - toggle = {S.LOW, S.DEFAULT, S.HIGH}, + name_text = C_("Quality", "Render Quality"), + toggle = {C_("Quality", "low"), C_("Quality", "default"), C_("Quality", "high")}, values={0.5, 1.0, 1.5}, default_value = DKOPTREADER_CONFIG_RENDER_QUALITY, advanced = true, @@ -440,7 +448,7 @@ This can also be used to remove some gray background or to convert a grayscale o options = { { name="doc_language", - name_text = S.DOC_LANG, + name_text = _("Document Language"), toggle = DKOPTREADER_CONFIG_DOC_LANGS_TEXT, values = DKOPTREADER_CONFIG_DOC_LANGS_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_text = S.FORCED_OCR, - toggle = {S.OFF, S.ON}, + --- @translators If OCR is unclear, please see https://en.wikipedia.org/wiki/Optical_character_recognition + name_text = _("Forced OCR"), + toggle = {_("off"), _("on")}, values = {0, 1}, default_value = 0, 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_text = S.WRITING_DIR, + name_text = _("Writing Direction"), enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) 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}, default_value = 0, 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_text = S.DEFECT_SIZE, - toggle = {S.SMALL, S.MEDIUM, S.LARGE}, + --- @translators The maximum size of a dust or ink speckle to be ignored instead of being considered a character. + name_text = _("Reflow Speckle Ignore Size"), + toggle = {_("small"), _("medium"), _("large")}, values = {1.0, 3.0, 5.0}, default_value = DKOPTREADER_CONFIG_DEFECT_SIZE, 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_text = S.AUTO_STRAIGHTEN, - toggle = {S.ZERO_DEG, S.FIVE_DEG, S.TEN_DEG}, + name_text = _("Auto Straighten"), + toggle = {_("0 deg"), _("5 deg"), _("10 deg")}, values = {0, 5, 10}, default_value = DKOPTREADER_CONFIG_AUTO_STRAIGHTEN, 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_text = S.INDENTATION, - toggle = {S.OFF, S.ON}, + name_text = _("Indentation"), + toggle = {_("off"), _("on")}, values = {0, 1}, default_value = DKOPTREADER_CONFIG_DETECT_INDENT, 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_text = S.DOCUMENT_COLUMNS, + name_text = _("Document Columns"), item_icons = { "resources/icons/appbar.column.one.png", "resources/icons/appbar.column.two.png", diff --git a/frontend/ui/data/strings.lua b/frontend/ui/data/strings.lua deleted file mode 100644 index c4f790801..000000000 --- a/frontend/ui/data/strings.lua +++ /dev/null @@ -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 diff --git a/frontend/ui/elements/screen_rotation_menu_table.lua b/frontend/ui/elements/screen_rotation_menu_table.lua index c3694bfe4..9e06e6579 100644 --- a/frontend/ui/elements/screen_rotation_menu_table.lua +++ b/frontend/ui/elements/screen_rotation_menu_table.lua @@ -1,10 +1,10 @@ -local _ = require("gettext") local Device = require("device") local Event = require("ui/event") local FileManager = require("apps/filemanager/filemanager") local UIManager = require("ui/uimanager") +local _ = require("gettext") +local C_ = _.pgettext local Screen = Device.screen -local S = require("ui/data/strings") return { text = _("Rotation"), @@ -63,7 +63,7 @@ When unchecked, the default rotation of the file browser and the default/saved r if FileManager.instance then table.insert(rotation_table, { 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 text = text .. " ★" end @@ -83,7 +83,7 @@ When unchecked, the default rotation of the file browser and the default/saved r }) table.insert(rotation_table, { text_func = function() - local text = S.PORTRAIT + local text = C_("Rotation", "↑ 0°") if G_reader_settings:readSetting("fm_rotation_mode") == Screen.ORIENTATION_PORTRAIT then text = text .. " ★" end @@ -103,7 +103,7 @@ When unchecked, the default rotation of the file browser and the default/saved r }) table.insert(rotation_table, { text_func = function() - local text = S.LANDSCAPE + local text = C_("Rotation", "⤸ 90°") if G_reader_settings:readSetting("fm_rotation_mode") == Screen.ORIENTATION_LANDSCAPE then text = text .. " ★" end @@ -123,7 +123,7 @@ When unchecked, the default rotation of the file browser and the default/saved r }) table.insert(rotation_table, { 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 text = text .. " ★" end