i18n/zh_CN: update zh_CN translation for lots of StatsViews

(cherry picked from commit bdac2f825fba27000c87f20de8e09e61ae1376d2)
This commit is contained in:
zhaoweny
2020-06-19 22:17:21 -04:00
committed by blitzmann
parent 343f4a5196
commit 2d3a661442
12 changed files with 434 additions and 85 deletions

View File

@@ -97,7 +97,7 @@ class AdditionsPane(TogglePanel):
self.notebook.SetSelection(self.PANES.index(name), focus=focus)
def getName(self, idx):
return _(self.PANES[idx])
return self.PANES[idx]
def ToggleContent(self, event):
TogglePanel.ToggleContent(self, event)

View File

@@ -32,7 +32,7 @@ class CapacitorViewFull(StatsView):
self.parent = parent
def getHeaderText(self, fit):
return "Capacitor"
return _("Capacitor")
def getTextExtentW(self, text):
width, height = self.parent.GetTextExtent(text)
@@ -52,7 +52,7 @@ class CapacitorViewFull(StatsView):
sizerCapacitor.Add(baseBox, 0, wx.ALIGN_LEFT)
bitmap = BitmapLoader.getStaticBitmap("capacitorInfo_big", parent, "gui")
tooltip = wx.ToolTip("Capacitor stability")
tooltip = wx.ToolTip(_("Capacitor stability"))
bitmap.SetToolTip(tooltip)
baseBox.Add(bitmap, 0, wx.ALIGN_CENTER)
@@ -62,7 +62,7 @@ class CapacitorViewFull(StatsView):
hbox = wx.BoxSizer(wx.HORIZONTAL)
box.Add(hbox, 0, wx.ALIGN_LEFT)
hbox.Add(wx.StaticText(parent, wx.ID_ANY, "Total: "), 0, wx.ALIGN_LEFT | wx.LEFT, 3)
hbox.Add(wx.StaticText(parent, wx.ID_ANY, _("Total: ")), 0, wx.ALIGN_LEFT | wx.LEFT, 3)
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0")
setattr(self, "label%sCapacitorCapacity" % panel.capitalize(), lbl)
hbox.Add(lbl, 0, wx.ALIGN_LEFT)
@@ -72,11 +72,11 @@ class CapacitorViewFull(StatsView):
hbox = wx.BoxSizer(wx.HORIZONTAL)
box.Add(hbox, 0, wx.ALIGN_LEFT)
lbl = wx.StaticText(parent, wx.ID_ANY, "Lasts ")
lbl = wx.StaticText(parent, wx.ID_ANY, _("Lasts "))
hbox.Add(lbl, 0, wx.ALIGN_LEFT | wx.LEFT, 3)
setattr(self, "label%sCapacitorState" % panel.capitalize(), lbl)
lbl = wx.StaticText(parent, wx.ID_ANY, "0s")
lbl = wx.StaticText(parent, wx.ID_ANY, _("0s"))
setattr(self, "label%sCapacitorTime" % panel.capitalize(), lbl)
hbox.Add(lbl, 0, wx.ALIGN_LEFT)
@@ -85,7 +85,7 @@ class CapacitorViewFull(StatsView):
sizerCapacitor.Add(baseBox, 0, wx.ALIGN_CENTER_HORIZONTAL)
tooltip = wx.ToolTip("Extra stats")
tooltip = wx.ToolTip(_("Extra stats"))
bitmap = BitmapLoader.getStaticBitmap("capacitorRecharge_big", parent, "gui")
bitmap.SetToolTip(tooltip)
baseBox.Add(bitmap, 0, wx.ALIGN_CENTER)
@@ -166,7 +166,7 @@ class CapacitorViewFull(StatsView):
else:
t = "%ds" % capState
s = "Stable: " if capStable else "Lasts "
s = _("Stable: ") if capStable else _("Lasts ")
getattr(self, lblNameTime % panel).SetLabel(t)
getattr(self, lblNameState % panel).SetLabel(s)

View File

@@ -38,7 +38,7 @@ class FirepowerViewFull(StatsView):
self._cachedValues = []
def getHeaderText(self, fit):
return "Firepower"
return _("Firepower")
def getTextExtentW(self, text):
width, height = self.parent.GetTextExtent(text)
@@ -71,7 +71,7 @@ class FirepowerViewFull(StatsView):
box = wx.BoxSizer(wx.VERTICAL)
baseBox.Add(box, 0, wx.ALIGN_CENTER)
box.Add(wx.StaticText(parent, wx.ID_ANY, damageType.capitalize()), 0, wx.ALIGN_LEFT)
box.Add(wx.StaticText(parent, wx.ID_ANY, _(damageType).capitalize()), 0, wx.ALIGN_LEFT)
hbox = wx.BoxSizer(wx.HORIZONTAL)
box.Add(hbox, 1, wx.ALIGN_CENTER)
@@ -95,14 +95,14 @@ class FirepowerViewFull(StatsView):
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0")
setattr(self, "label%sVolleyTotal" % panel.capitalize(), lbl)
gridS.Add(wx.StaticText(parent, wx.ID_ANY, " Volley: "), 0, wx.ALL | wx.ALIGN_RIGHT)
gridS.Add(wx.StaticText(parent, wx.ID_ANY, _(" Volley: ")), 0, wx.ALL | wx.ALIGN_RIGHT)
gridS.Add(lbl, 0, wx.ALIGN_LEFT)
self._cachedValues.append(0)
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0")
setattr(self, "label%sDpsTotal" % panel.capitalize(), lbl)
gridS.Add(wx.StaticText(parent, wx.ID_ANY, " DPS: "), 0, wx.ALL | wx.ALIGN_RIGHT)
gridS.Add(wx.StaticText(parent, wx.ID_ANY, _(" DPS: ")), 0, wx.ALL | wx.ALIGN_RIGHT)
self._cachedValues.append(0)
@@ -110,7 +110,7 @@ class FirepowerViewFull(StatsView):
image = BitmapLoader.getBitmap("mining_small", "gui")
self.miningyield = wx.BitmapButton(contentPanel, -1, image)
self.miningyield.SetToolTip(wx.ToolTip("Click to toggle to Mining Yield "))
self.miningyield.SetToolTip(wx.ToolTip(_("Click to toggle to Mining Yield ")))
self.miningyield.Bind(wx.EVT_BUTTON, self.switchToMiningYieldView)
sizerFirepower.Add(self.miningyield, 0, wx.ALIGN_LEFT)

View File

@@ -35,7 +35,7 @@ class MiningYieldViewFull(StatsView):
self._cachedValues = []
def getHeaderText(self, fit):
return "Mining Yield"
return _("Mining Yield")
def getTextExtentW(self, text):
width, height = self.parent.GetTextExtent(text)
@@ -64,7 +64,7 @@ class MiningYieldViewFull(StatsView):
box = wx.BoxSizer(wx.VERTICAL)
baseBox.Add(box, 0, wx.ALIGN_CENTER)
box.Add(wx.StaticText(parent, wx.ID_ANY, miningType.capitalize()), 0, wx.ALIGN_LEFT)
box.Add(wx.StaticText(parent, wx.ID_ANY, _(miningType).capitalize()), 0, wx.ALIGN_LEFT)
hbox = wx.BoxSizer(wx.HORIZONTAL)
box.Add(hbox, 1, wx.ALIGN_CENTER)
@@ -85,7 +85,7 @@ class MiningYieldViewFull(StatsView):
box = wx.BoxSizer(wx.VERTICAL)
baseBox.Add(box, 0, wx.EXPAND)
box.Add(wx.StaticText(parent, wx.ID_ANY, "Total"), 0, wx.ALIGN_LEFT)
box.Add(wx.StaticText(parent, wx.ID_ANY, _("Total")), 0, wx.ALIGN_LEFT)
hbox = wx.BoxSizer(wx.HORIZONTAL)
box.Add(hbox, 1, wx.EXPAND)
@@ -98,7 +98,7 @@ class MiningYieldViewFull(StatsView):
image = BitmapLoader.getBitmap("turret_small", "gui")
firepower = wx.BitmapButton(contentPanel, -1, image)
firepower.SetToolTip(wx.ToolTip("Click to toggle to Firepower View"))
firepower.SetToolTip(wx.ToolTip(_("Click to toggle to Firepower View")))
firepower.Bind(wx.EVT_BUTTON, self.switchToFirepowerView)
sizerMiningYield.Add(firepower, 0, wx.ALIGN_LEFT)

View File

@@ -62,7 +62,7 @@ class OutgoingViewFull(StatsView):
self._cachedValues = []
def getHeaderText(self, fit):
return "Remote Reps"
return _("Remote Reps")
def getTextExtentW(self, text):
width, height = self.parent.GetTextExtent(text)

View File

@@ -61,7 +61,7 @@ class OutgoingViewMinimal(StatsView):
self._cachedValues = []
def getHeaderText(self, fit):
return "Remote Reps"
return _("Remote Reps")
def getTextExtentW(self, text):
width, height = self.parent.GetTextExtent(text)

View File

@@ -35,7 +35,7 @@ class PriceViewFull(StatsView):
self.settings = MarketPriceSettings.getInstance()
def getHeaderText(self, fit):
return "Price"
return _("Price")
def populatePanel(self, contentPanel, headerPanel):
contentSizer = contentPanel.GetSizer()

View File

@@ -38,7 +38,7 @@ class RechargeViewFull(StatsView):
self.mainFrame.Bind(GE.EFFECTIVE_HP_TOGGLED, self.toggleEffective)
def getHeaderText(self, fit):
return "Recharge rates"
return _("Recharge rates")
def getTextExtentW(self, text):
width, height = self.parent.GetTextExtent(text)
@@ -70,10 +70,10 @@ class RechargeViewFull(StatsView):
# Add an empty label first for correct alignment.
sizerTankStats.Add(wx.StaticText(contentPanel, wx.ID_ANY, ""), 0)
toolTipText = {
"shieldPassive": "Passive shield recharge",
"shieldActive": "Active shield boost",
"armorActive": "Armor repair amount",
"hullActive": "Hull repair amount"}
"shieldPassive": _("Passive shield recharge"),
"shieldActive": _("Active shield boost"),
"armorActive": _("Armor repair amount"),
"hullActive": _("Hull repair amount")}
for tankType in ("shieldPassive", "shieldActive", "armorActive", "hullActive"):
bitmap = BitmapLoader.getStaticBitmap("%s_big" % tankType, contentPanel, "gui")
tooltip = wx.ToolTip(toolTipText[tankType])
@@ -81,8 +81,8 @@ class RechargeViewFull(StatsView):
sizerTankStats.Add(bitmap, 0, wx.ALIGN_CENTER)
toolTipText = {
"reinforced": "Reinforced",
"sustained": "Sustained"}
"reinforced": _("Reinforced"),
"sustained": _("Sustained")}
for stability in ("reinforced", "sustained"):
bitmap = BitmapLoader.getStaticBitmap("regen%s_big" % stability.capitalize(), contentPanel, "gui")
tooltip = wx.ToolTip(toolTipText[stability])

View File

@@ -42,7 +42,7 @@ class ResistancesViewFull(StatsView):
self.mainFrame.Bind(GE.EFFECTIVE_HP_TOGGLED, self.ehpSwitch)
def getHeaderText(self, fit):
return "Resistances"
return _("Resistances")
def getTextExtentW(self, text):
width, height = self.parent.GetTextExtent(text)
@@ -79,8 +79,12 @@ class ResistancesViewFull(StatsView):
# Add an empty label, then the rest.
sizerResistances.Add(wx.StaticText(contentPanel, wx.ID_ANY), wx.GBPosition(row, col), wx.GBSpan(1, 1))
col += 1
toolTipText = {"em": "Electromagnetic resistance", "thermal": "Thermal resistance",
"kinetic": "Kinetic resistance", "explosive": "Explosive resistance"}
toolTipText = {
"em" : _("Electromagnetic resistance"),
"thermal" : _("Thermal resistance"),
"kinetic" : _("Kinetic resistance"),
"explosive": _("Explosive resistance")
}
for damageType in ("em", "thermal", "kinetic", "explosive"):
bitmap = BitmapLoader.getStaticBitmap("%s_big" % damageType, contentPanel, "gui")
tooltip = wx.ToolTip(toolTipText[damageType])
@@ -88,7 +92,7 @@ class ResistancesViewFull(StatsView):
sizerResistances.Add(bitmap, wx.GBPosition(row, col), wx.GBSpan(1, 1), wx.ALIGN_CENTER)
col += 1
self.stEHPs = wx.Button(contentPanel, style=wx.BU_EXACTFIT, label="EHP")
self.stEHPs.SetToolTip(wx.ToolTip("Click to toggle between effective HP and raw HP"))
self.stEHPs.SetToolTip(wx.ToolTip(_("Click to toggle between effective HP and raw HP")))
self.stEHPs.Bind(wx.EVT_BUTTON, self.toggleEHP)
@@ -102,8 +106,12 @@ class ResistancesViewFull(StatsView):
gaugeColours = (((38, 133, 198), (52, 86, 98)), ((198, 38, 38), (83, 65, 67)), ((163, 163, 163), (74, 90, 93)),
((198, 133, 38), (81, 83, 67)))
toolTipText = {"shield": "Shield resistance", "armor": "Armor resistance", "hull": "Hull resistance",
"damagePattern": "Incoming damage pattern"}
toolTipText = {
"shield" : _("Shield resistance"),
"armor" : _("Armor resistance"),
"hull" : _("Hull resistance"),
"damagePattern": _("Incoming damage pattern")
}
for tankType in ("shield", "armor", "hull", "separator", "damagePattern"):
if tankType != "separator":
bitmap = BitmapLoader.getStaticBitmap("%s_big" % tankType, contentPanel, "gui")
@@ -156,7 +164,7 @@ class ResistancesViewFull(StatsView):
row += 1
col = 0
self.stEHPs.SetToolTip(wx.ToolTip("Click to toggle between effective HP and raw HP"))
self.stEHPs.SetToolTip(wx.ToolTip(_("Click to toggle between effective HP and raw HP")))
def toggleEHP(self, event):
wx.PostEvent(self.mainFrame, GE.EffectiveHpToggled(effective=self.stEHPs.GetLabel() == "HP"))
@@ -200,7 +208,7 @@ class ResistancesViewFull(StatsView):
rrFactor = fit.ehp[tankType] / fit.hp[tankType]
lbl.SetLabel(formatAmount(ehp[tankType], 3, 0, 9))
lbl.SetToolTip(
wx.ToolTip("%s: %d\nResist Multiplier: x%.2f" % (tankType.capitalize(), ehp[tankType], rrFactor)))
wx.ToolTip("%s: %d\nResist Multiplier: x%.2f" % (tankType.capitalize(), ehp[tankType], rrFactor)))
else:
lbl.SetLabel("0")

View File

@@ -79,7 +79,7 @@ class ResourcesViewFull(StatsView):
self.headerPanel.Layout()
def getHeaderText(self, fit):
return "Resources"
return _("Resources")
def getTextExtentW(self, text):
width, height = self.parent.GetTextExtent(text)
@@ -105,8 +105,13 @@ class ResourcesViewFull(StatsView):
base = sizerResources
sizer.AddStretchSpacer()
# Turrets & launcher hardslots display
tooltipText = {"turret": "Turret hardpoints", "launcher": "Launcher hardpoints", "drones": "Drones active",
"fighter": "Fighter squadrons active", "calibration": "Calibration"}
tooltipText = {
"turret" : _("Turret hardpoints"),
"launcher" : _("Launcher hardpoints"),
"drones" : _("Drones active"),
"fighter" : _("Fighter squadrons active"),
"calibration": _("Calibration")
}
for type_ in ("turret", "launcher", "drones", "fighter", "calibration"):
box = wx.BoxSizer(wx.HORIZONTAL)
@@ -118,8 +123,10 @@ class ResourcesViewFull(StatsView):
sizer.Add(box, 0, wx.ALIGN_CENTER)
suffix = {'turret': 'Hardpoints', 'launcher': 'Hardpoints', 'drones': 'Active', 'fighter': 'Tubes',
'calibration': 'Points'}
suffix = {
'turret' : 'Hardpoints', 'launcher': 'Hardpoints', 'drones': 'Active', 'fighter': 'Tubes',
'calibration': 'Points'
}
lbl = wx.StaticText(parent, wx.ID_ANY, "0")
setattr(self, "label%sUsed%s%s" % (panel.capitalize(), type_.capitalize(), suffix[type_].capitalize()), lbl)
box.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5)
@@ -140,8 +147,14 @@ class ResourcesViewFull(StatsView):
gauge_font = wx.Font(fonts.NORMAL, wx.SWISS, wx.NORMAL, wx.NORMAL, False)
# PG, Cpu & drone stuff
tooltipText = {"cpu": "CPU", "pg": "PowerGrid", "droneBay": "Drone bay", "fighterBay": "Fighter bay",
"droneBandwidth": "Drone bandwidth", "cargoBay": "Cargo bay"}
tooltipText = {
"cpu" : _("CPU"),
"pg" : _("PowerGrid"),
"droneBay" : _("Drone bay"),
"fighterBay" : _("Fighter bay"),
"droneBandwidth": _("Drone bandwidth"),
"cargoBay" : _("Cargo bay")
}
for i, group in enumerate((("cpu", "pg"), ("cargoBay", "droneBay", "fighterBay", "droneBandwidth"))):
main = wx.BoxSizer(wx.VERTICAL)
base.Add(main, 1, wx.ALIGN_CENTER)

View File

@@ -33,7 +33,7 @@ class TargetingMiscViewMinimal(StatsView):
self._cachedValues = []
def getHeaderText(self, fit):
return "Targeting && Misc"
return _("Targeting && Misc")
def getTextExtentW(self, text):
width, height = self.parent.GetTextExtent(text)
@@ -55,11 +55,11 @@ class TargetingMiscViewMinimal(StatsView):
gridTargetingMisc.Add(gridTargeting, 0, wx.ALIGN_LEFT | wx.ALL, 5)
labels = (("Targets", "Targets", ""),
("Range", "Range", "km"),
("Scan res.", "ScanRes", "mm"),
("Sensor str.", "SensorStr", ""),
("Drone range", "CtrlRange", "km"))
labels = ((_("Targets"), "Targets", ""),
(_("Range"), "Range", "km"),
(_("Scan res."), "ScanRes", "mm"),
(_("Sensor str."), "SensorStr", ""),
(_("Drone range"), "CtrlRange", "km"))
for header, labelShort, unit in labels:
gridTargeting.Add(wx.StaticText(contentPanel, wx.ID_ANY, "%s: " % header), 0, wx.ALIGN_LEFT)
@@ -79,11 +79,11 @@ class TargetingMiscViewMinimal(StatsView):
gridMisc.AddGrowableCol(1)
gridTargetingMisc.Add(gridMisc, 0, wx.ALIGN_LEFT | wx.ALL, 5)
labels = (("Speed", "Speed", "m/s"),
("Align time", "AlignTime", "s"),
("Signature", "SigRadius", "m"),
("Warp Speed", "WarpSpeed", "AU/s"),
("Cargo", "Cargo", "m\u00B3"))
labels = ((_("Speed"), "Speed", "m/s"),
(_("Align time"), "AlignTime", "s"),
(_("Signature"), "SigRadius", "m"),
(_("Warp Speed"), "WarpSpeed", "AU/s"),
(_("Cargo"), "Cargo", "m\u00B3"))
for header, labelShort, unit in labels:
gridMisc.Add(wx.StaticText(contentPanel, wx.ID_ANY, "%s: " % header), 0, wx.ALIGN_LEFT)
@@ -105,23 +105,23 @@ class TargetingMiscViewMinimal(StatsView):
"jamChance": lambda: fit.jamChance}
cargoNamesOrder = OrderedDict((
("fleetHangarCapacity", "Fleet hangar"),
("shipMaintenanceBayCapacity", "Maintenance bay"),
("specialAmmoHoldCapacity", "Ammo hold"),
("specialFuelBayCapacity", "Fuel bay"),
("specialShipHoldCapacity", "Ship hold"),
("specialSmallShipHoldCapacity", "Small ship hold"),
("specialMediumShipHoldCapacity", "Medium ship hold"),
("specialLargeShipHoldCapacity", "Large ship hold"),
("specialIndustrialShipHoldCapacity", "Industrial ship hold"),
("specialOreHoldCapacity", "Ore hold"),
("specialMineralHoldCapacity", "Mineral hold"),
("specialMaterialBayCapacity", "Material bay"),
("specialGasHoldCapacity", "Gas hold"),
("specialSalvageHoldCapacity", "Salvage hold"),
("specialCommandCenterHoldCapacity", "Command center hold"),
("specialPlanetaryCommoditiesHoldCapacity", "Planetary goods hold"),
("specialQuafeHoldCapacity", "Quafe hold")))
("fleetHangarCapacity", _("Fleet hangar")),
("shipMaintenanceBayCapacity", _("Maintenance bay")),
("specialAmmoHoldCapacity", _("Ammo hold")),
("specialFuelBayCapacity", _("Fuel bay")),
("specialShipHoldCapacity", _("Ship hold")),
("specialSmallShipHoldCapacity", _("Small ship hold")),
("specialMediumShipHoldCapacity", _("Medium ship hold")),
("specialLargeShipHoldCapacity", _("Large ship hold")),
("specialIndustrialShipHoldCapacity", _("Industrial ship hold")),
("specialOreHoldCapacity", _("Ore hold")),
("specialMineralHoldCapacity", _("Mineral hold")),
("specialMaterialBayCapacity", _("Material bay")),
("specialGasHoldCapacity", _("Gas hold")),
("specialSalvageHoldCapacity", _("Salvage hold")),
("specialCommandCenterHoldCapacity", _("Command center hold")),
("specialPlanetaryCommoditiesHoldCapacity", _("Planetary goods hold")),
("specialQuafeHoldCapacity", _("Quafe hold"))))
cargoValues = {
"main": lambda: fit.ship.getModifiedItemAttr("capacity"),