add gettext to all reader widgets

pull/39/head
Qingping Hou 11 years ago
parent f36279ed53
commit 3602c61b1f

@ -1,7 +1,7 @@
require "ui/widget/notification"
ReaderBookmark = InputContainer:new{
bm_menu_title = "Bookmarks",
bm_menu_title = _("Bookmarks"),
bookmarks = nil,
}
@ -10,7 +10,7 @@ function ReaderBookmark:init()
self.key_events = {
ShowToc = {
{ "B" },
doc = "show bookmarks" },
doc = _("show bookmarks") },
}
end
self.ui.menu:registerToMainMenu(self)

@ -50,7 +50,7 @@ ReaderConfig = InputContainer:new{}
function ReaderConfig:init()
if Device:hasKeyboard() then
self.key_events = {
ShowConfigMenu = { { "AA" }, doc = "show config dialog" },
ShowConfigMenu = { { "AA" }, doc = _("show config dialog") },
}
end
if Device:isTouchDevice() then

@ -31,7 +31,7 @@ function ReaderMenu:init()
if Device:hasKeyboard() then
self.key_events = {
ShowMenu = { { _("Menu") }, doc = _("show menu") },
ShowMenu = { { "Menu" }, doc = _("show menu") },
}
end
end

@ -14,16 +14,16 @@ function ReaderPanning:init()
self.key_events = {
-- these will all generate the same event, just with different arguments
MoveUp = {
{ "Up" }, doc = "move visible area up",
{ "Up" }, doc = _("move visible area up"),
event = "Panning", args = {0, -1} },
MoveDown = {
{ "Down" }, doc = "move visible area down",
{ "Down" }, doc = _("move visible area down"),
event = "Panning", args = {0, 1} },
MoveLeft = {
{ "Left" }, doc = "move visible area left",
{ "Left" }, doc = _("move visible area left"),
event = "Panning", args = {-1, 0} },
MoveRight = {
{ "Right" }, doc = "move visible area right",
{ "Right" }, doc = _("move visible area right"),
event = "Panning", args = {1, 0} },
}
end

@ -18,44 +18,44 @@ function ReaderRolling:init()
self.key_events = {
GotoNextView = {
{ Input.group.PgFwd },
doc = "go to next view",
doc = _("go to next view"),
event = "GotoViewRel", args = 1
},
GotoPrevView = {
{ Input.group.PgBack },
doc = "go to previous view",
doc = _("go to previous view"),
event = "GotoViewRel", args = -1
},
MoveUp = {
{ "Up" },
doc = "move view up",
doc = _("move view up"),
event = "Panning", args = {0, -1}
},
MoveDown = {
{ "Down" },
doc = "move view down",
doc = _("move view down"),
event = "Panning", args = {0, 1}
},
GotoFirst = {
{"1"}, doc = "go to start", event = "GotoPercent", args = 0},
Goto11 = {
{"2"}, doc = "go to 11%", event = "GotoPercent", args = 11},
Goto22 = {
{"3"}, doc = "go to 22%", event = "GotoPercent", args = 22},
Goto33 = {
{"4"}, doc = "go to 33%", event = "GotoPercent", args = 33},
Goto44 = {
{"5"}, doc = "go to 44%", event = "GotoPercent", args = 44},
Goto55 = {
{"6"}, doc = "go to 55%", event = "GotoPercent", args = 55},
Goto66 = {
{"7"}, doc = "go to 66%", event = "GotoPercent", args = 66},
Goto77 = {
{"8"}, doc = "go to 77%", event = "GotoPercent", args = 77},
Goto88 = {
{"9"}, doc = "go to 88%", event = "GotoPercent", args = 88},
GotoLast = {
{"0"}, doc = "go to end", event = "GotoPercent", args = 100},
GotoFirst = {
{"1"}, doc = _("go to start"), event = "GotoPercent", args = 0},
Goto11 = {
{"2"}, doc = _("go to 11%"), event = "GotoPercent", args = 11},
Goto22 = {
{"3"}, doc = _("go to 22%"), event = "GotoPercent", args = 22},
Goto33 = {
{"4"}, doc = _("go to 33%"), event = "GotoPercent", args = 33},
Goto44 = {
{"5"}, doc = _("go to 44%"), event = "GotoPercent", args = 44},
Goto55 = {
{"6"}, doc = _("go to 55%"), event = "GotoPercent", args = 55},
Goto66 = {
{"7"}, doc = _("go to 66%"), event = "GotoPercent", args = 66},
Goto77 = {
{"8"}, doc = _("go to 77%"), event = "GotoPercent", args = 77},
Goto88 = {
{"9"}, doc = _("go to 88%"), event = "GotoPercent", args = 88},
GotoLast = {
{"0"}, doc = _("go to end"), event = "GotoPercent", args = 100},
}
end
@ -82,7 +82,7 @@ function ReaderRolling:initGesListener()
GestureRange:new{
ges = "tap",
range = Geom:new{
x = 0,
x = 0,
y = Screen:getHeight()/4,
w = Screen:getWidth()/4,
h = 5*Screen:getHeight()/8,

@ -7,8 +7,14 @@ function ReaderRotation:init()
if Device:hasKeyboard() then
self.key_events = {
-- these will all generate the same event, just with different arguments
RotateLeft = { {"J"}, doc = "rotate left by 90 degrees", event = "Rotate", args = -90 },
RotateRight = { {"K"}, doc = "rotate right by 90 degrees", event = "Rotate", args = 90 },
RotateLeft = {
{"J"},
doc = _("rotate left by 90 degrees"),
event = "Rotate", args = -90 },
RotateRight = {
{"K"},
doc = _("rotate right by 90 degrees"),
event = "Rotate", args = 90 },
}
end
if Device:isTouchDevice() then

@ -1,5 +1,5 @@
ReaderTypeset = InputContainer:new{
css_menu_title = "Set render style",
css_menu_title = _("Set render style"),
css = nil,
internal_css = true,
}
@ -40,13 +40,13 @@ end
function ReaderTypeset:genStyleSheetMenu()
local file_list = {
{
text = "clear all external styles",
text = _("clear all external styles"),
callback = function()
self:setStyleSheet(nil)
end
},
{
text = "Auto",
text = _("Auto"),
callback = function()
self:setStyleSheet(self.ui.document.default_css)
end

@ -3,7 +3,6 @@ require "ui/reader/readerfooter"
require "ui/reader/readerdogear"
ReaderView = OverlapGroup:new{
_name = "ReaderView",
document = nil,
-- single page state

@ -12,42 +12,42 @@ function ReaderZooming:init()
self.key_events = {
ZoomIn = {
{ "Shift", Input.group.PgFwd },
doc = "zoom in",
doc = _("zoom in"),
event = "Zoom", args = "in"
},
ZoomOut = {
{ "Shift", Input.group.PgBack },
doc = "zoom out",
doc = _("zoom out"),
event = "Zoom", args = "out"
},
ZoomToFitPage = {
{ "A" },
doc = "zoom to fit page",
doc = _("zoom to fit page"),
event = "SetZoomMode", args = "page"
},
ZoomToFitContent = {
{ "Shift", "A" },
doc = "zoom to fit content",
doc = _("zoom to fit content"),
event = "SetZoomMode", args = "content"
},
ZoomToFitPageWidth = {
{ "S" },
doc = "zoom to fit page width",
doc = _("zoom to fit page width"),
event = "SetZoomMode", args = "pagewidth"
},
ZoomToFitContentWidth = {
{ "Shift", "S" },
doc = "zoom to fit content width",
doc = _("zoom to fit content width"),
event = "SetZoomMode", args = "contentwidth"
},
ZoomToFitPageHeight = {
{ "D" },
doc = "zoom to fit page height",
doc = _("zoom to fit page height"),
event = "SetZoomMode", args = "pageheight"
},
ZoomToFitContentHeight = {
{ "Shift", "D" },
doc = "zoom to fit content height",
doc = _("zoom to fit content height"),
event = "SetZoomMode", args = "contentheight"
},
}
@ -232,30 +232,30 @@ end
function ReaderZooming:addToMainMenu(tab_item_table)
if self.ui.document.info.has_pages then
table.insert(tab_item_table.typeset, {
text = "Switch zoom mode",
text = _("Switch zoom mode"),
sub_item_table = {
{
text = "Zoom to fit content width",
text = _("Zoom to fit content width"),
callback = self:genSetZoomModeCallBack("contentwidth")
},
{
text = "Zoom to fit content height",
text = _("Zoom to fit content height"),
callback = self:genSetZoomModeCallBack("contentheight")
},
{
text = "Zoom to fit page width",
text = _("Zoom to fit page width"),
callback = self:genSetZoomModeCallBack("pagewidth")
},
{
text = "Zoom to fit page height",
text = _("Zoom to fit page height"),
callback = self:genSetZoomModeCallBack("pageheight")
},
{
text = "Zoom to fit content",
text = _("Zoom to fit content"),
callback = self:genSetZoomModeCallBack("content")
},
{
text = "Zoom to fit page",
text = _("Zoom to fit page"),
callback = self:genSetZoomModeCallBack("page")
},
}

@ -24,7 +24,8 @@ it works using data gathered from a document interface
ReaderUI = InputContainer:new{
key_events = {
Close = { {"Home"}, doc = "close document", event = "Close" },
Close = { { "Home" },
doc = _("close document"), event = "Close" },
},
active_widgets = {},
@ -52,8 +53,8 @@ function ReaderUI:init()
end
if Device:hasKeyboard() then
self.key_events.Back = {
{ "Back" }, doc = "close document",
self.key_events.Back = {
{ "Back" }, doc = _("close document"),
event = "Close" }
end
@ -102,7 +103,7 @@ function ReaderUI:init()
if self.document.info.has_pages then
-- for page specific controller
-- if needed, insert a paging container
local pager = ReaderPaging:new{
dialog = self.dialog,

Loading…
Cancel
Save