Skip to content

Commit

Permalink
i18n: more string annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoweny committed Jun 30, 2020
1 parent 25a694b commit bf99132
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gui/builtinAdditionPanes/commandView.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def refreshContents(self, fit):
self.fits.sort(key=self.fitSort)
stuff.extend(self.fits)
if not stuff:
stuff = [DummyEntry("Drag a fit to this area")]
stuff = [DummyEntry(_t("Drag a fit to this area"))]
self.update(stuff)

def click(self, event):
Expand Down
13 changes: 7 additions & 6 deletions gui/builtinAdditionPanes/fighterView.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@


FIGHTER_ORDER = ('Light Fighter', 'Heavy Fighter', 'Support Fighter')
_t = wx.GetTranslation


class FighterViewDrop(wx.DropTarget):
Expand All @@ -58,7 +59,7 @@ class FighterView(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, style=wx.TAB_TRAVERSAL)
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.labels = ["Light", "Heavy", "Support"]
self.labels = [("Light", _t("Light")), ("Heavy", _t("Heavy")), ("Support", _t("Support"))]

mainSizer = wx.BoxSizer(wx.VERTICAL)

Expand All @@ -68,18 +69,18 @@ def __init__(self, parent):
textSizer = wx.BoxSizer(wx.HORIZONTAL)
textSizer.AddStretchSpacer()

for x in self.labels:
lbl = wx.StaticText(self, wx.ID_ANY, x.capitalize())
for attr, label in self.labels:
lbl = wx.StaticText(self, wx.ID_ANY, label)
textSizer.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5)

lbl = wx.StaticText(self, wx.ID_ANY, "0")
setattr(self, "label%sUsed" % (x.capitalize()), lbl)
setattr(self, "label%sUsed" % attr, lbl)
textSizer.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5)

textSizer.Add(wx.StaticText(self, wx.ID_ANY, "/"), 0, wx.ALIGN_CENTER)

lbl = wx.StaticText(self, wx.ID_ANY, "0")
setattr(self, "label%sTotal" % (x.capitalize()), lbl)
setattr(self, "label%sTotal" % attr, lbl)
textSizer.Add(lbl, 0, wx.ALIGN_CENTER)
textSizer.AddStretchSpacer()

Expand All @@ -100,7 +101,7 @@ def fitChanged(self, event):
fit = sFit.getFit(activeFitID)

if fit:
for x in self.labels:
for x, _ in self.labels:
if fit.isStructure:
slot = getattr(FittingSlot, "FS_{}".format(x.upper()))
else:
Expand Down
6 changes: 4 additions & 2 deletions gui/builtinAdditionPanes/implantView.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
from service.fit import Fit
from service.market import Market

_t = wx.GetTranslation


class ImplantViewDrop(wx.DropTarget):
def __init__(self, dropFn, *args, **kwargs):
Expand Down Expand Up @@ -62,8 +64,8 @@ def __init__(self, parent):

radioSizer = wx.BoxSizer(wx.HORIZONTAL)
radioSizer.AddStretchSpacer()
self.rbFit = wx.RadioButton(self, id=wx.ID_ANY, label="Use Fit-specific Implants", style=wx.RB_GROUP)
self.rbChar = wx.RadioButton(self, id=wx.ID_ANY, label="Use Character Implants")
self.rbFit = wx.RadioButton(self, id=wx.ID_ANY, label=_t("Use Fit-specific Implants"), style=wx.RB_GROUP)
self.rbChar = wx.RadioButton(self, id=wx.ID_ANY, label=_t("Use Character Implants"))
radioSizer.Add(self.rbFit, 0, wx.ALL, 5)
radioSizer.Add(self.rbChar, 0, wx.ALL, 5)
radioSizer.AddStretchSpacer()
Expand Down
2 changes: 1 addition & 1 deletion gui/builtinAdditionPanes/projectedView.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def refreshContents(self, fit):
stuff.extend(self.drones)
stuff.extend(self.fighters)
if not stuff:
stuff = [DummyEntry('Drag an item or fit, or use right-click menu for wormhole effects')]
stuff = [DummyEntry(_t('Drag an item or fit, or use right-click menu for wormhole effects'))]
self.update(stuff)

def get(self, row):
Expand Down
3 changes: 2 additions & 1 deletion gui/builtinMarketBrowser/marketTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from logbook import Logger

pyfalog = Logger(__name__)
_t = wx.GetTranslation


class MarketTree(wx.TreeCtrl):
Expand Down Expand Up @@ -33,7 +34,7 @@ def __init__(self, parent, marketBrowser):

# Add recently used modules node
rumIconId = self.addImage("market_small", "gui")
self.AppendItem(self.root, "Recently Used Items", rumIconId, data=RECENTLY_USED_MODULES)
self.AppendItem(self.root, _t("Recently Used Items"), rumIconId, data=RECENTLY_USED_MODULES)

# Bind our lookup method to when the tree gets expanded
self.Bind(wx.EVT_TREE_ITEM_EXPANDING, self.expandLookup)
Expand Down
2 changes: 1 addition & 1 deletion gui/esiFittings.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def __init__(self, parent):

mainSizer.Add(hSizer, 0, wx.EXPAND, 5)

self.exportChargesCb = wx.CheckBox(self, wx.ID_ANY, 'Export Loaded Charges', wx.DefaultPosition, wx.DefaultSize, 0)
self.exportChargesCb = wx.CheckBox(self, wx.ID_ANY, _t('Export Loaded Charges'), wx.DefaultPosition, wx.DefaultSize, 0)
self.exportChargesCb.SetValue(EsiSettings.getInstance().get('exportCharges'))
self.exportChargesCb.Bind(wx.EVT_CHECKBOX, self.OnChargeExportChange)
mainSizer.Add(self.exportChargesCb, 0, 0, 5)
Expand Down

0 comments on commit bf99132

Please sign in to comment.