more translate

This commit is contained in:
cuu
2018-12-01 20:04:36 +08:00
parent 152b2a8ac7
commit 0d7a527e97
7 changed files with 58 additions and 82 deletions

View File

@@ -20,6 +20,9 @@ from UI.confirm_page import ConfirmPage
from UI.download import Download
from UI.download_process_page import DownloadProcessPage
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from UI.info_page_list_item import InfoPageListItem
from libs.roundrects import aa_round_rect
from libs.DBUS import is_wifi_connected_now
@@ -60,7 +63,7 @@ class UpdateDownloadPage(DownloadProcessPage):
print(filename)
os.system("rm -rf %s" % CmdClean(filename))
self._Screen._MsgBox.SetText("Download failed")
self._Screen._MsgBox.SetText(MyLangManager.Tr("DownloadFailed"))
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
return False
@@ -78,7 +81,7 @@ class UpdateDownloadPage(DownloadProcessPage):
self._URL = url
self._DST_DIR = dst_dir
else:
self._Screen._MsgBox.SetText("Invaid")
self._Screen._MsgBox.SetText(MyLangManager.Tr("Invaid"))
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
return
@@ -120,7 +123,7 @@ class UpdateConfirmPage(ConfirmPage):
if self._DownloadPage == None:
self._DownloadPage = UpdateDownloadPage()
self._DownloadPage._Screen = self._Screen
self._DownloadPage._Name = "Downloading..."
self._DownloadPage._Name = MyLangManager.Tr("Downloading")
self._DownloadPage.Init()
self._DownloadPage._MD5 = self._MD5
@@ -148,56 +151,6 @@ class UpdateConfirmPage(ConfirmPage):
self.Reset()
class InfoPageListItem(object):
_PosX = 0
_PosY = 0
_Width = 0
_Height = 30
_Labels = {}
_Icons = {}
_Fonts = {}
_LinkObj = None
def __init__(self):
self._Labels = {}
self._Icons = {}
self._Fonts = {}
def SetSmallText(self,text):
l = Label()
l._PosX = 40
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["small"])
self._Labels["Small"] = l
def Init(self,text):
#self._Fonts["normal"] = fonts["veramono12"]
l = Label()
l._PosX = 10
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["normal"])
self._Labels["Text"] = l
def Draw(self):
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
self._Labels["Text"].Draw()
if "Small" in self._Labels:
self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width-5
self._Labels["Small"]._PosY = self._PosY + (self._Height - self._Labels["Small"]._Height)/2
self._Labels["Small"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
class UpdatePage(Page):
_Icons = {}
_FootMsg = ["Nav.","Check Update","","Back",""]
@@ -256,7 +209,7 @@ class UpdatePage(Page):
self.GenList()
def CheckUpdate(self):
self._Screen._MsgBox.SetText("Checking update...")
self._Screen._MsgBox.SetText(MyLangManager.Tr("CheckingUpdate"))
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
@@ -303,7 +256,7 @@ class UpdatePage(Page):
self._Screen.SwapAndShow()
else:
self._Screen.Draw()
self._Screen._MsgBox.SetText("Launcher is up to date")
self._Screen._MsgBox.SetText(MyLangManager.Tr("LauncherIsUpToDate"))
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
pygame.time.delay(765)
@@ -334,12 +287,12 @@ class UpdatePage(Page):
self._Screen.SwapAndShow()
else:
self._Screen.Draw()
self._Screen._MsgBox.SetText("Checking update failed")
self._Screen._MsgBox.SetText(MyLangManager.Tr("CheckingUpdateFailed"))
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
else:
self._Screen.Draw()
self._Screen._MsgBox.SetText("Please Check your Wi-Fi connection")
self._Screen._MsgBox.SetText(MyLangManager.Tr("CheckWifiConnection"))
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
@@ -360,7 +313,7 @@ class APIOBJ(object):
self._UpdatePage = UpdatePage()
self._UpdatePage._Screen = main_screen
self._UpdatePage._Name ="Update"
self._UpdatePage._Name =MyLangManager.Tr("Update")
self._UpdatePage.Init()
def API(self,main_screen):