i18n: annotate string literals in gui/builtinPreferenceViews

This commit is contained in:
zhaoweny
2020-06-21 16:06:43 +08:00
parent 7cd7d475db
commit 29ec297acb
11 changed files with 186 additions and 155 deletions

View File

@@ -8,9 +8,11 @@ import gui.mainFrame
from service.settings import NetworkSettings
from service.network import Network
_t = wx.GetTranslation
class PFNetworkPref(PreferenceView):
title = "Network"
title = _t("Network")
def populatePanel(self, panel):
@@ -29,23 +31,23 @@ class PFNetworkPref(PreferenceView):
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
self.cbEnableNetwork = wx.CheckBox(panel, wx.ID_ANY, "Enable Network", wx.DefaultPosition, wx.DefaultSize, 0)
self.cbEnableNetwork = wx.CheckBox(panel, wx.ID_ANY, _t("Enable Network"), wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbEnableNetwork, 0, wx.ALL | wx.EXPAND, 5)
subSizer = wx.BoxSizer(wx.VERTICAL)
self.cbEve = wx.CheckBox(panel, wx.ID_ANY, "EVE Servers (API && CREST import)", wx.DefaultPosition,
self.cbEve = wx.CheckBox(panel, wx.ID_ANY, _t("EVE Servers (API && CREST import)"), wx.DefaultPosition,
wx.DefaultSize, 0)
subSizer.Add(self.cbEve, 0, wx.ALL | wx.EXPAND, 5)
self.cbPricing = wx.CheckBox(panel, wx.ID_ANY, "Pricing updates", wx.DefaultPosition, wx.DefaultSize, 0)
self.cbPricing = wx.CheckBox(panel, wx.ID_ANY, _t("Pricing updates"), wx.DefaultPosition, wx.DefaultSize, 0)
subSizer.Add(self.cbPricing, 0, wx.ALL | wx.EXPAND, 5)
self.cbPyfaUpdate = wx.CheckBox(panel, wx.ID_ANY, "Pyfa Update checks", wx.DefaultPosition, wx.DefaultSize, 0)
self.cbPyfaUpdate = wx.CheckBox(panel, wx.ID_ANY, _t("Pyfa Update checks"), wx.DefaultPosition, wx.DefaultSize, 0)
subSizer.Add(self.cbPyfaUpdate, 0, wx.ALL | wx.EXPAND, 5)
mainSizer.Add(subSizer, 0, wx.LEFT | wx.EXPAND, 30)
proxyTitle = wx.StaticText(panel, wx.ID_ANY, "Proxy settings", wx.DefaultPosition, wx.DefaultSize, 0)
proxyTitle = wx.StaticText(panel, wx.ID_ANY, _t("Proxy settings"), wx.DefaultPosition, wx.DefaultSize, 0)
proxyTitle.Wrap(-1)
proxyTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
@@ -79,11 +81,11 @@ class PFNetworkPref(PreferenceView):
ptypeSizer = wx.BoxSizer(wx.HORIZONTAL)
self.stPType = wx.StaticText(panel, wx.ID_ANY, "Mode:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stPType = wx.StaticText(panel, wx.ID_ANY, _t("Mode:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stPType.Wrap(-1)
ptypeSizer.Add(self.stPType, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.chProxyTypeChoices = ["No proxy", "Auto-detected proxy settings", "Manual proxy settings"]
self.chProxyTypeChoices = [_t("No proxy"), _t("Auto-detected proxy settings"), _t("Manual proxy settings")]
self.chProxyType = wx.Choice(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.chProxyTypeChoices, 0)
self.chProxyType.SetSelection(self.nMode)
@@ -97,7 +99,7 @@ class PFNetworkPref(PreferenceView):
fgAddrSizer.SetFlexibleDirection(wx.BOTH)
fgAddrSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)
self.stPSetAddr = wx.StaticText(panel, wx.ID_ANY, "Addr:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stPSetAddr = wx.StaticText(panel, wx.ID_ANY, _t("Addr:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stPSetAddr.Wrap(-1)
fgAddrSizer.Add(self.stPSetAddr, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
@@ -105,7 +107,7 @@ class PFNetworkPref(PreferenceView):
fgAddrSizer.Add(self.editProxySettingsAddr, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
self.stPSetPort = wx.StaticText(panel, wx.ID_ANY, "Port:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stPSetPort = wx.StaticText(panel, wx.ID_ANY, _t("Port:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stPSetPort.Wrap(-1)
fgAddrSizer.Add(self.stPSetPort, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
@@ -117,14 +119,14 @@ class PFNetworkPref(PreferenceView):
mainSizer.Add(fgAddrSizer, 0, wx.EXPAND, 5)
# proxy auth information: login and pass
self.stPSetLogin = wx.StaticText(panel, wx.ID_ANY, "Username:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stPSetLogin = wx.StaticText(panel, wx.ID_ANY, _t("Username:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stPSetLogin.Wrap(-1)
self.editProxySettingsLogin = wx.TextCtrl(panel, wx.ID_ANY, self.nAuth[0], wx.DefaultPosition, wx.DefaultSize,
0)
self.stPSetPassword = wx.StaticText(panel, wx.ID_ANY, "Password:", wx.DefaultPosition, wx.DefaultSize, 0)
0)
self.stPSetPassword = wx.StaticText(panel, wx.ID_ANY, _t("Password:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stPSetPassword.Wrap(-1)
self.editProxySettingsPassword = wx.TextCtrl(panel, wx.ID_ANY, self.nAuth[1], wx.DefaultPosition,
wx.DefaultSize, wx.TE_PASSWORD)
wx.DefaultSize, wx.TE_PASSWORD)
pAuthSizer = wx.BoxSizer(wx.HORIZONTAL)
pAuthSizer.Add(self.stPSetLogin, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
pAuthSizer.Add(self.editProxySettingsLogin, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
@@ -132,15 +134,15 @@ class PFNetworkPref(PreferenceView):
pAuthSizer.Add(self.editProxySettingsPassword, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
mainSizer.Add(pAuthSizer, 0, wx.EXPAND, 5)
self.stPSAutoDetected = wx.StaticText(panel, wx.ID_ANY, "Auto-detected: ", wx.DefaultPosition, wx.DefaultSize,
0)
self.stPSAutoDetected = wx.StaticText(panel, wx.ID_ANY, _t("Auto-detected: "), wx.DefaultPosition, wx.DefaultSize,
0)
self.stPSAutoDetected.Wrap(-1)
mainSizer.Add(self.stPSAutoDetected, 0, wx.ALL, 5)
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
btnSizer.AddStretchSpacer()
self.btnApply = wx.Button(panel, wx.ID_ANY, "Apply Proxy Settings", wx.DefaultPosition, wx.DefaultSize, 0)
self.btnApply = wx.Button(panel, wx.ID_ANY, _t("Apply Proxy Settings"), wx.DefaultPosition, wx.DefaultSize, 0)
btnSizer.Add(self.btnApply, 0, wx.ALL, 5)
@@ -154,7 +156,7 @@ class PFNetworkPref(PreferenceView):
else:
txt = "None"
self.stPSAutoDetected.SetLabel("Auto-detected: " + txt)
self.stPSAutoDetected.SetLabel(_t("Auto-detected: ") + txt)
self.stPSAutoDetected.Disable()
self.chProxyType.Bind(wx.EVT_CHOICE, self.OnCHProxyTypeSelect)