kosync - new string methods (#6089)

reviewable/pr6092/r1
Robert 4 years ago committed by GitHub
parent 72c9ec2aa0
commit b4f3f177ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,6 +47,16 @@ local SYNC_STRATEGY = {
DEFAULT_BACKWARD = 3,
}
local function getNameStrategy(type)
if type == 1 then
return _("Prompt")
elseif type == 2 then
return _("Auto")
else
return _("Disable")
end
end
local function showSyncedMessage()
UIManager:show(InfoMessage:new{
text = _("Progress has been synchronized."),
@ -162,9 +172,10 @@ function KOSync:addToMainMenu(menu_items)
enabled_func = function() return self.kosync_auto_sync end,
sub_item_table = {
{
text = _("Sync to latest record >>>>"),
enabled = false,
},
text_func = function()
return T(_("Sync to latest record (%1)"), getNameStrategy(self.kosync_whisper_forward))
end,
sub_item_table = {
{
text = _("Auto"),
checked_func = function()
@ -192,10 +203,13 @@ function KOSync:addToMainMenu(menu_items)
self:setWhisperForward(SYNC_STRATEGY.DISABLE)
end,
},
{
text = _("Sync to a previous record <<<<"),
enabled = false,
}
},
{
text_func = function()
return T(_("Sync to a previous record (%1)"), getNameStrategy(self.kosync_whisper_backward))
end,
sub_item_table = {
{
text = _("Auto"),
checked_func = function()
@ -223,6 +237,8 @@ function KOSync:addToMainMenu(menu_items)
self:setWhisperBackward(SYNC_STRATEGY.DISABLE)
end,
},
}
},
},
},
{

Loading…
Cancel
Save