Merge pull request #2204 from zhaoweny/i18n

i18n: annotate Preferences, update zh_CN translations
This commit is contained in:
Ryan Holmes
2020-06-24 09:48:47 -04:00
committed by GitHub
92 changed files with 2127 additions and 780 deletions

View File

@@ -32,7 +32,7 @@ from gui.contextMenu import ContextMenu
from service.const import GraphCacheCleanupReason
from service.fit import Fit
from .stylePickers import ColorPickerPopup, LightnessPickerPopup, LineStylePickerPopup
_t = wx.GetTranslation
class BaseWrapperList(gui.display.Display):
@@ -302,7 +302,7 @@ class SourceWrapperList(BaseWrapperList):
selection = self.getSelectedWrappers()
mainItem = self.getWrapper(clickedPos)
itemContext = None if mainItem is None else 'Fit'
itemContext = None if mainItem is None else _t('Fit')
menu = ContextMenu.getMenu(self, mainItem, selection, ('graphFitList', itemContext), ('graphFitListMisc', itemContext))
if menu:
self.PopupMenu(menu)
@@ -355,7 +355,7 @@ class TargetWrapperList(BaseWrapperList):
selection = self.getSelectedWrappers()
mainItem = self.getWrapper(clickedPos)
itemContext = None if mainItem is None else 'Target'
itemContext = None if mainItem is None else _t('Target')
menu = ContextMenu.getMenu(self, mainItem, selection, ('graphTgtList', itemContext), ('graphTgtListMisc', itemContext))
if menu:
self.PopupMenu(menu)

View File

@@ -29,7 +29,7 @@ from gui.contextMenu import ContextMenu
from gui.utils.staticHelpers import DragDropHelper
from service.fit import Fit
from service.market import Market
_t = wx.GetTranslation
class BoosterViewDrop(wx.DropTarget):
def __init__(self, dropFn, *args, **kwargs):
@@ -212,7 +212,7 @@ class BoosterView(d.Display):
else:
if booster in self.original:
mainBooster = booster
itemContext = None if mainBooster is None else "Booster"
itemContext = None if mainBooster is None else _t("Booster")
menu = ContextMenu.getMenu(self, mainBooster, selection, ("boosterItem", itemContext), ("boosterItemMisc", itemContext))
if menu:
self.PopupMenu(menu)

View File

@@ -30,6 +30,7 @@ from gui.contextMenu import ContextMenu
from gui.utils.staticHelpers import DragDropHelper
from service.fit import Fit
_t = wx.GetTranslation
class DummyItem:
@@ -197,7 +198,7 @@ class CommandView(d.Display):
pass
contexts = []
if mainCommandFit is not None:
contexts.append(('commandFit', 'Command Fit'))
contexts.append(('commandFit', _t('Command Fit')))
contexts.append(('commandView',))
menu = ContextMenu.getMenu(self, mainCommandFit, selection, *contexts)
if menu:

View File

@@ -41,7 +41,7 @@ from service.market import Market
pyfalog = Logger(__name__)
_t = wx.GetTranslation
class DummyItem:
def __init__(self, txt):
@@ -303,7 +303,7 @@ class ProjectedView(d.Display):
if isinstance(mainItem, EosModule):
modSrcContext = 'projectedModule'
modItemContext = 'Projected Item'
modItemContext = _t('Projected Item')
modFullContext = (modSrcContext, modItemContext)
contexts.append(modFullContext)
if mainItem.charge is not None:
@@ -313,17 +313,17 @@ class ProjectedView(d.Display):
contexts.append(chargeFullContext)
elif isinstance(mainItem, EosDrone):
srcContext = 'projectedDrone'
itemContext = 'Projected Item'
itemContext = _t('Projected Item')
droneFullContext = (srcContext, itemContext)
contexts.append(droneFullContext)
elif isinstance(mainItem, EosFighter):
srcContext = 'projectedFighter'
itemContext = 'Projected Item'
itemContext = _t('Projected Item')
fighterFullContext = (srcContext, itemContext)
contexts.append(fighterFullContext)
else:
fitSrcContext = 'projectedFit'
fitItemContext = 'Projected Item'
fitItemContext = _t('Projected Item')
fitFullContext = (fitSrcContext, fitItemContext)
contexts.append(fitFullContext)
contexts.append(('projected',))

View File

@@ -1,44 +1,46 @@
import wx
import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from gui.utils.clipboard import toClipboard
from service.fit import Fit
from service.port.eft import exportDrones, exportFighters, exportCargo, exportImplants, exportBoosters
from service.port.eft import exportBoosters, exportCargo, exportDrones, exportFighters, exportImplants
viewSpecMap = {
'droneItemMisc': ('Drones', lambda cw: cw.drones, exportDrones),
'fighterItemMisc': ('Fighters', lambda cw: cw.fighters, exportFighters),
'cargoItemMisc': ('Cargo Items', lambda cw: cw.cargo, exportCargo),
'implantItemMisc': ('Implants', lambda cw: cw.implants, exportImplants),
'implantItemMiscChar': ('Implants', lambda cw: cw.implants, exportImplants),
'boosterItemMisc': ('Boosters', lambda cw: cw.boosters, exportBoosters)}
_t = wx.GetTranslation
class AdditionsExportAll(ContextMenuUnconditional):
visibilitySetting = 'additionsCopyPaste'
def __init__(self):
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.viewSpecMap = {
'droneItemMisc': (_t('Drones'), lambda cw: cw.drones, exportDrones),
'fighterItemMisc': (_t('Fighters'), lambda cw: cw.fighters, exportFighters),
'cargoItemMisc': (_t('Cargo Items'), lambda cw: cw.cargo, exportCargo),
'implantItemMisc': (_t('Implants'), lambda cw: cw.implants, exportImplants),
'implantItemMiscChar': (_t('Implants'), lambda cw: cw.implants, exportImplants),
'boosterItemMisc': (_t('Boosters'), lambda cw: cw.boosters, exportBoosters)
}
def display(self, callingWindow, srcContext):
if srcContext not in viewSpecMap:
if srcContext not in self.viewSpecMap:
return False
fit = Fit.getInstance().getFit(self.mainFrame.getActiveFit())
if fit is None:
return False
if not viewSpecMap[srcContext][1](callingWindow):
if not self.viewSpecMap[srcContext][1](callingWindow):
return False
self.srcContext = srcContext
return True
def getText(self, callingWindow, itmContext):
return 'Copy All {}'.format(viewSpecMap[self.srcContext][0])
return _t('Copy All {}').format(self.viewSpecMap[self.srcContext][0])
def activate(self, callingWindow, fullContext, i):
items = viewSpecMap[self.srcContext][1](callingWindow)
export = viewSpecMap[self.srcContext][2](items)
items = self.viewSpecMap[self.srcContext][1](callingWindow)
export = self.viewSpecMap[self.srcContext][2](items)
if export:
toClipboard(export)

View File

@@ -1,28 +1,30 @@
import wx
import gui.mainFrame
from gui.contextMenu import ContextMenuSelection
from gui.utils.clipboard import toClipboard
from service.fit import Fit
from service.port.eft import exportDrones, exportFighters, exportCargo, exportImplants, exportBoosters
from service.port.eft import exportBoosters, exportCargo, exportDrones, exportFighters, exportImplants
viewSpecMap = {
'droneItemMisc': ('Drones', exportDrones),
'fighterItemMisc': ('Fighters', exportFighters),
'cargoItemMisc': ('Cargo Items', exportCargo),
'implantItemMisc': ('Implants', exportImplants),
'implantItemMiscChar': ('Implants', exportImplants),
'boosterItemMisc': ('Boosters', exportBoosters)}
_t = wx.GetTranslation
class AdditionsExportAll(ContextMenuSelection):
visibilitySetting = 'additionsCopyPaste'
def __init__(self):
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.viewSpecMap = {
'droneItemMisc': (_t('Drones'), exportDrones),
'fighterItemMisc': (_t('Fighters'), exportFighters),
'cargoItemMisc': (_t('Cargo Items'), exportCargo),
'implantItemMisc': (_t('Implants'), exportImplants),
'implantItemMiscChar': (_t('Implants'), exportImplants),
'boosterItemMisc': (_t('Boosters'), exportBoosters)
}
def display(self, callingWindow, srcContext, selection):
if srcContext not in viewSpecMap:
if srcContext not in self.viewSpecMap:
return False
if not selection:
return False
@@ -34,10 +36,10 @@ class AdditionsExportAll(ContextMenuSelection):
return True
def getText(self, callingWindow, itmContext, selection):
return 'Copy Selected {}'.format(viewSpecMap[self.srcContext][0])
return _t('Copy Selected {}').format(self.viewSpecMap[self.srcContext][0])
def activate(self, callingWindow, fullContext, selection, i):
export = viewSpecMap[self.srcContext][1](selection)
export = self.viewSpecMap[self.srcContext][1](selection)
if export:
toClipboard(export)

View File

@@ -1,3 +1,5 @@
import wx
import gui.mainFrame
from gui import fitCommands as cmd
from gui.contextMenu import ContextMenuUnconditional
@@ -5,25 +7,25 @@ from gui.utils.clipboard import fromClipboard
from service.fit import Fit
from service.port.eft import parseAdditions
viewSpecMap = {
'droneItemMisc': ('Drones', lambda i: i.isDrone, cmd.GuiImportLocalDronesCommand),
'fighterItemMisc': ('Fighters', lambda i: i.isFighter, cmd.GuiImportLocalFightersCommand),
'cargoItemMisc': ('Cargo Items', lambda i: not i.isAbyssal, cmd.GuiImportCargosCommand),
'implantItemMisc': ('Implants', lambda i: i.isImplant, cmd.GuiImportImplantsCommand),
'implantItemMiscChar': ('Implants', lambda i: i.isImplant, cmd.GuiImportImplantsCommand),
'boosterItemMisc': ('Boosters', lambda i: i.isBooster, cmd.GuiImportBoostersCommand)}
_t = wx.GetTranslation
class AdditionsImport(ContextMenuUnconditional):
visibilitySetting = 'additionsCopyPaste'
def __init__(self):
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.viewSpecMap = {
'droneItemMisc': (_t('Drones'), lambda i: i.isDrone, cmd.GuiImportLocalDronesCommand),
'fighterItemMisc': (_t('Fighters'), lambda i: i.isFighter, cmd.GuiImportLocalFightersCommand),
'cargoItemMisc': (_t('Cargo Items'), lambda i: not i.isAbyssal, cmd.GuiImportCargosCommand),
'implantItemMisc': (_t('Implants'), lambda i: i.isImplant, cmd.GuiImportImplantsCommand),
'implantItemMiscChar': (_t('Implants'), lambda i: i.isImplant, cmd.GuiImportImplantsCommand),
'boosterItemMisc': (_t('Boosters'), lambda i: i.isBooster, cmd.GuiImportBoostersCommand)
}
def display(self, callingWindow, srcContext):
if srcContext not in viewSpecMap:
if srcContext not in self.viewSpecMap:
return False
fit = Fit.getInstance().getFit(self.mainFrame.getActiveFit())
if fit is None:
@@ -35,16 +37,16 @@ class AdditionsImport(ContextMenuUnconditional):
return True
def getText(self, callingWindow, itmContext):
return 'Paste {}'.format(viewSpecMap[self.srcContext][0])
return _t('Paste {}').format(self.viewSpecMap[self.srcContext][0])
def activate(self, callingWindow, fullContext, i):
text = fromClipboard()
items = parseAdditions(text)
filterFunc = viewSpecMap[self.srcContext][1]
filterFunc = self.viewSpecMap[self.srcContext][1]
items = [(i.ID, a) for i, a in items if filterFunc(i)]
if not items:
return
command = viewSpecMap[self.srcContext][2]
command = self.viewSpecMap[self.srcContext][2]
self.mainFrame.command.Submit(command(self.mainFrame.getActiveFit(), items))

View File

@@ -6,9 +6,10 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
_t = wx.GetTranslation
class AmmoToDmgPattern(ContextMenuSingle):
visibilitySetting = 'ammoPattern'
def __init__(self):
@@ -28,7 +29,7 @@ class AmmoToDmgPattern(ContextMenuSingle):
return False
def getText(self, callingWindow, itmContext, mainItem):
return "Set {} as Damage Pattern".format(itmContext if itmContext is not None else "Item")
return _t("Set {} as Damage Pattern").format(itmContext if itmContext is not None else _t("Item"))
def activate(self, callingWindow, fullContext, mainItem, i):
fitID = self.mainFrame.getActiveFit()

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
@@ -6,6 +7,8 @@ from gui import fitCommands as cmd
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
_t = wx.GetTranslation
class BoosterSideEffects(ContextMenuSingle):
@@ -28,7 +31,7 @@ class BoosterSideEffects(ContextMenuSingle):
return False
def getText(self, callingWindow, itmContext, mainItem):
return "Side Effects"
return _t("Side Effects")
def addEffect(self, menu, ability):
label = ability.name
@@ -67,7 +70,7 @@ class BoosterSideEffects(ContextMenuSingle):
if booster in fit.boosters:
index = fit.boosters.index(booster)
self.mainFrame.command.Submit(cmd.GuiToggleBoosterSideEffectStateCommand(
fitID=fitID, position=index, effectID=effect.effectID))
fitID=fitID, position=index, effectID=effect.effectID))
BoosterSideEffects.register()

View File

@@ -1,8 +1,12 @@
import wx
import gui.fitCommands as cmd
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
_t = wx.GetTranslation
class AddToCargo(ContextMenuSingle):
@@ -26,7 +30,7 @@ class AddToCargo(ContextMenuSingle):
return True
def getText(self, callingWindow, itmContext, mainItem):
return "Add {} to Cargo".format(itmContext)
return _t("Add {} to Cargo").format(itmContext)
def activate(self, callingWindow, fullContext, mainItem, i):
fitID = self.mainFrame.getActiveFit()

View File

@@ -1,7 +1,11 @@
import wx
import gui.fitCommands as cmd
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
_t = wx.GetTranslation
class AddToCargoAmmo(ContextMenuSingle):
@@ -21,7 +25,7 @@ class AddToCargoAmmo(ContextMenuSingle):
return True
def getText(self, callingWindow, itmContext, mainItem):
return "Add {0} to Cargo (x1000)".format(itmContext)
return _t("Add {0} to Cargo (x1000)").format(itmContext)
def activate(self, callingWindow, fullContext, mainItem, i):
fitID = self.mainFrame.getActiveFit()

View File

@@ -7,9 +7,10 @@ from gui.contextMenu import ContextMenuUnconditional
from service.fit import Fit
from service.market import Market
_t = wx.GetTranslation
class AddCommandFit(ContextMenuUnconditional):
# Get list of items that define a command fit
sMkt = Market.getInstance()
grp = sMkt.getGroup(1770) # Command burst group
@@ -47,7 +48,7 @@ class AddCommandFit(ContextMenuUnconditional):
return True
def getText(self, callingWindow, itmContext):
return "Command Fits"
return _t("Command Fits")
def addFit(self, menu, fit, includeShip=False):
label = fit.name if not includeShip else "({}) {}".format(fit.ship.item.name, fit.name)

View File

@@ -35,8 +35,8 @@ class ChangeDamagePattern(ContextMenuUnconditional):
# Order here is important: patterns with duplicate names from the latter will overwrite
# patterns from the former
self.patterns = sorted(
chain(builtinPatterns, userPatterns),
key=lambda p: p.fullName not in ["Uniform", "Selected Ammo"])
chain(builtinPatterns, userPatterns),
key=lambda p: p.fullName not in ["Uniform", "Selected Ammo"])
self.patternEventMap = {}
self.items = (OrderedDict(), OrderedDict())

View File

@@ -1,9 +1,13 @@
import wx
import gui.fitCommands as cmd
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from gui.fitCommands.helpers import droneStackLimit
from service.fit import Fit
_t = wx.GetTranslation
class DroneAddStack(ContextMenuSingle):
@@ -33,14 +37,14 @@ class DroneAddStack(ContextMenuSingle):
return True
def getText(self, callingWindow, itmContext, mainItem):
return 'Add {} to Drone Bay{}'.format(
itmContext, '' if self.amount == 1 else ' (x{})'.format(self.amount))
return _t('Add {} to Drone Bay{}').format(
itmContext, '' if self.amount == 1 else ' (x{})'.format(self.amount))
def activate(self, callingWindow, fullContext, mainItem, i):
command = cmd.GuiAddLocalDroneCommand(
fitID=self.mainFrame.getActiveFit(),
itemID=int(mainItem.ID),
amount=self.amount)
fitID=self.mainFrame.getActiveFit(),
itemID=int(mainItem.ID),
amount=self.amount)
if self.mainFrame.command.Submit(command):
self.mainFrame.additionsPane.select('Drones', focus=False)

View File

@@ -8,6 +8,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
_t = wx.GetTranslation
class DroneSplitStack(ContextMenuSingle):
@@ -24,7 +26,7 @@ class DroneSplitStack(ContextMenuSingle):
return mainItem.amount > 1
def getText(self, callingWindow, itmContext, mainItem):
return "Split {} Stack".format(itmContext)
return _t("Split {} Stack").format(itmContext)
def activate(self, callingWindow, fullContext, mainItem, i):
with DroneStackSplit(self.mainFrame, mainItem.amount) as dlg:
@@ -41,7 +43,7 @@ class DroneSplitStack(ContextMenuSingle):
if mainItem in fit.drones:
position = fit.drones.index(mainItem)
self.mainFrame.command.Submit(cmd.GuiSplitLocalDroneStackCommand(
fitID=fitID, position=position, amount=int(cleanInput)))
fitID=fitID, position=position, amount=int(cleanInput)))
DroneSplitStack.register()

View File

@@ -10,6 +10,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from service.market import Market
_t = wx.GetTranslation
class Group:
@@ -32,9 +34,7 @@ class Entry:
self.shortName = shortName
class AddEnvironmentEffect(ContextMenuUnconditional):
# CCP doesn't currently provide a mapping between the general Environment, and the specific environment effect
# (which can be random when going into Abyssal space). This is how we currently define it:
# environment type: specific type name prefix
@@ -53,7 +53,7 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
return srcContext == "projected"
def getText(self, callingWindow, itmContext):
return "Add Environmental Effect"
return _t("Add Environmental Effect")
def _addGroup(self, parentMenu, name):
id = ContextMenuUnconditional.nextID()
@@ -103,8 +103,8 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
def getData(self):
data = Group()
data.groups['Wormhole'] = self.getEffectBeacons(
'Black Hole', 'Cataclysmic Variable', 'Magnetar',
'Pulsar', 'Red Giant', 'Wolf Rayet')
'Black Hole', 'Cataclysmic Variable', 'Magnetar',
'Pulsar', 'Red Giant', 'Wolf Rayet')
data.groups['Sansha Incursion'] = self.getEffectBeacons('Sansha Incursion')
data.groups['Triglavian Invasion'] = self.getEffectBeacons('Triglavian Invasion')
data.groups['Triglavian Invasion'].groups['Destructible Beacons'] = self.getDestructibleBeacons()
@@ -165,8 +165,8 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
environments = {x.ID: x for x in sMkt.getGroup("Abyssal Environment").items}
items = chain(
sMkt.getGroup("MassiveEnvironments").items,
sMkt.getGroup("Non-Interactable Object").items)
sMkt.getGroup("MassiveEnvironments").items,
sMkt.getGroup("Non-Interactable Object").items)
for beacon in items:
if not beacon.isType('projected'):
continue
@@ -210,4 +210,5 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
data.sort()
return data
AddEnvironmentEffect.register()

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
@@ -6,6 +7,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from service.fit import Fit
_t = wx.GetTranslation
class FactorReload(ContextMenuUnconditional):
@@ -20,7 +23,7 @@ class FactorReload(ContextMenuUnconditional):
return self.mainFrame.getActiveFit() is not None
def getText(self, callingWindow, itmContext):
return "Factor in Reload Time"
return _t("Factor in Reload Time")
def activate(self, callingWindow, fullContext, i):
fitIDs = Fit.getInstance().toggleFactorReload()

View File

@@ -1,12 +1,15 @@
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
from gui import fitCommands as cmd
from gui.fitCommands.helpers import getSimilarFighters
from gui.contextMenu import ContextMenuCombined
from gui.fitCommands.helpers import getSimilarFighters
from service.fit import Fit
_t = wx.GetTranslation
class FighterAbilities(ContextMenuCombined):
@@ -27,7 +30,7 @@ class FighterAbilities(ContextMenuCombined):
return True
def getText(self, callingWindow, itmContext, mainItem, selection):
return "Abilities"
return _t("Abilities")
def addAbility(self, menu, ability):
label = ability.name
@@ -78,10 +81,10 @@ class FighterAbilities(ContextMenuCombined):
if fighter in container:
positions.append(container.index(fighter))
self.mainFrame.command.Submit(command(
fitID=fitID,
mainPosition=mainPosition,
positions=positions,
effectID=ability.effectID))
fitID=fitID,
mainPosition=mainPosition,
positions=positions,
effectID=ability.effectID))
FighterAbilities.register()

View File

@@ -1,9 +1,12 @@
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
_t = wx.GetTranslation
class AddBrowsedFits(ContextMenuUnconditional):
@@ -16,7 +19,7 @@ class AddBrowsedFits(ContextMenuUnconditional):
return True
def getText(self, callingWindow, itmContext):
return 'Add Fit...'
return _t('Add Fit...')
def activate(self, callingWindow, fullContext, i):
from gui.fitBrowserLite import FitBrowserLiteDialog
@@ -24,7 +27,8 @@ class AddBrowsedFits(ContextMenuUnconditional):
'projected': 'Add Projected Fits',
'commandView': 'Add Command Fits',
'graphFitList': 'Add Fits to Graph',
'graphTgtList': 'Add Targets to Graph'}
'graphTgtList': 'Add Targets to Graph'
}
excludedFitIDs = callingWindow.getExistingFitIDs()
with FitBrowserLiteDialog(self.mainFrame, title=titles[fullContext[0]], excludedFitIDs=excludedFitIDs) as dlg:
if dlg.ShowModal() == wx.ID_OK:

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
@@ -6,6 +7,8 @@ from gui.builtinViews.emptyView import BlankPage
from gui.contextMenu import ContextMenuUnconditional
from service.fit import Fit
_t = wx.GetTranslation
class AddCurrentlyOpenFit(ContextMenuUnconditional):
@@ -23,7 +26,7 @@ class AddCurrentlyOpenFit(ContextMenuUnconditional):
return True
def getText(self, callingWindow, itmContext):
return 'Add Currently Open Fit'
return _t('Add Currently Open Fit')
def getSubMenu(self, callingWindow, context, rootMenu, i, pitem):
self.fitLookup = {}

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
@@ -6,6 +7,8 @@ from graphs.wrapper import BaseWrapper
from gui.builtinShipBrowser.events import FitSelected
from gui.contextMenu import ContextMenuSingle
_t = wx.GetTranslation
class OpenFitInNewTab(ContextMenuSingle):
@@ -31,7 +34,7 @@ class OpenFitInNewTab(ContextMenuSingle):
return True
def getText(self, callingWindow, itmContext, mainItem):
return "Open Fit in New Tab"
return _t("Open Fit in New Tab")
def activate(self, callingWindow, fullContext, mainItem, i):
if isinstance(mainItem, BaseWrapper):

View File

@@ -8,6 +8,7 @@ from eos.const import FitSystemSecurity
from gui.contextMenu import ContextMenuUnconditional
from service.fit import Fit
_t = wx.GetTranslation
optionMap = OrderedDict((
('High Security', FitSystemSecurity.HISEC),
@@ -34,7 +35,7 @@ class FitSystemSecurityMenu(ContextMenuUnconditional):
return True
def getText(self, callingWindow, itmContext):
return "Citadel System Security"
return _t("Citadel System Security")
def addOption(self, menu, optionLabel):
id = ContextMenuUnconditional.nextID()
@@ -60,8 +61,8 @@ class FitSystemSecurityMenu(ContextMenuUnconditional):
optionLabel = self.optionIds[event.Id]
optionValue = optionMap[optionLabel]
self.mainFrame.command.Submit(cmd.GuiChangeFitSystemSecurityCommand(
fitID=self.mainFrame.getActiveFit(),
secStatus=optionValue))
fitID=self.mainFrame.getActiveFit(),
secStatus=optionValue))
FitSystemSecurityMenu.register()

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
@@ -6,6 +7,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from service.settings import GraphSettings
_t = wx.GetTranslation
class GraphDmgApplyProjectedMenu(ContextMenuUnconditional):
@@ -17,7 +20,7 @@ class GraphDmgApplyProjectedMenu(ContextMenuUnconditional):
return srcContext == 'dmgStatsGraph'
def getText(self, callingWindow, itmContext):
return 'Apply Projected Items'
return _t('Apply Projected Items')
def activate(self, callingWindow, fullContext, i):
self.settings.set('applyProjected', not self.settings.get('applyProjected'))

View File

@@ -1,6 +1,5 @@
from collections import OrderedDict
# noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
@@ -9,6 +8,10 @@ from gui.contextMenu import ContextMenuUnconditional
from service.const import GraphDpsDroneMode
from service.settings import GraphSettings
# noinspection PyPackageRequirements
_t = wx.GetTranslation
class GraphDmgDroneModeMenu(ContextMenuUnconditional):
@@ -20,7 +23,7 @@ class GraphDmgDroneModeMenu(ContextMenuUnconditional):
return srcContext == 'dmgStatsGraph'
def getText(self, callingWindow, itmContext):
return 'Drone Mode'
return _t('Drone Mode')
def handleModeSwitch(self, event):
option = self.idOptionMap[event.Id]

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
@@ -6,6 +7,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from service.settings import GraphSettings
_t = wx.GetTranslation
class GraphDmgIgnoreResistsMenu(ContextMenuUnconditional):
@@ -17,7 +20,7 @@ class GraphDmgIgnoreResistsMenu(ContextMenuUnconditional):
return srcContext == 'dmgStatsGraph'
def getText(self, callingWindow, itmContext):
return 'Ignore Target Resists'
return _t('Ignore Target Resists')
def activate(self, callingWindow, fullContext, i):
self.settings.set('ignoreResists', not self.settings.get('ignoreResists'))

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
@@ -6,6 +7,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from service.settings import GraphSettings
_t = wx.GetTranslation
class GraphIgnoreDcrMenu(ContextMenuUnconditional):
@@ -17,7 +20,7 @@ class GraphIgnoreDcrMenu(ContextMenuUnconditional):
return srcContext in ('dmgStatsGraph', 'remoteRepsGraph', 'ewarStatsGraph')
def getText(self, callingWindow, itmContext):
return 'Ignore Drone Control Range'
return _t('Ignore Drone Control Range')
def activate(self, callingWindow, fullContext, i):
self.settings.set('ignoreDCR', not self.settings.get('ignoreDCR'))

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
@@ -7,6 +8,8 @@ from gui.contextMenu import ContextMenuSingle
from service.ammo import Ammo
from service.market import Market
_t = wx.GetTranslation
class GraphFitAmmoPicker(ContextMenuSingle):
@@ -23,7 +26,7 @@ class GraphFitAmmoPicker(ContextMenuSingle):
return True
def getText(self, callingWindow, itmContext, mainItem):
return 'Plot with Different Ammo...'
return _t('Plot with Different Ammo...')
def activate(self, callingWindow, fullContext, mainItem, i):
AmmoPickerFrame.openOne(callingWindow, mainItem.item, forceReopen=True)
@@ -73,7 +76,6 @@ class AmmoPickerFrame(AuxiliaryDialog):
class AmmoPickerContents(wx.ScrolledCanvas):
indent = 15
def __init__(self, parent, fit):

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
@@ -6,6 +7,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from service.settings import GraphSettings
_t = wx.GetTranslation
class GraphIgnoreLockRangeMenu(ContextMenuUnconditional):
@@ -17,7 +20,7 @@ class GraphIgnoreLockRangeMenu(ContextMenuUnconditional):
return srcContext in ('dmgStatsGraph', 'remoteRepsGraph', 'ewarStatsGraph')
def getText(self, callingWindow, itmContext):
return 'Ignore Lock Range'
return _t('Ignore Lock Range')
def activate(self, callingWindow, fullContext, i):
self.settings.set('ignoreLockRange', not self.settings.get('ignoreLockRange'))

View File

@@ -1,11 +1,13 @@
# noinspection PyPackageRequirements
import wx
from gui.contextMenu import ContextMenuUnconditional
from service.market import Market
from service.implantSet import ImplantSets as UserImplantSets
from service.precalcImplantSet import PrecalcedImplantSets
_t = wx.GetTranslation
class ImplantSetApply(ContextMenuUnconditional):
@@ -20,7 +22,7 @@ class ImplantSetApply(ContextMenuUnconditional):
return srcContext in ("implantItemMisc", "implantEditor")
def getText(self, callingWindow, context):
return "Apply Implant Set"
return _t("Apply Implant Set")
def _addSeparator(self, m, text):
id_ = ContextMenuUnconditional.nextID()

View File

@@ -4,6 +4,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from service.fit import Fit
_t = wx.GetTranslation
class ImplantSetSave(ContextMenuUnconditional):
@@ -22,7 +24,7 @@ class ImplantSetSave(ContextMenuUnconditional):
return True
def getText(self, callingWindow, context):
return 'Save as New Implant Set'
return _t('Save as New Implant Set')
def activate(self, callingWindow, fullContext, i):
with NameDialog(self.mainFrame, '') as dlg:
@@ -40,13 +42,13 @@ ImplantSetSave.register()
class NameDialog(wx.Dialog):
def __init__(self, parent, value):
super().__init__(parent, title='New Implant Set', style=wx.DEFAULT_DIALOG_STYLE)
super().__init__(parent, title=_t('New Implant Set'), style=wx.DEFAULT_DIALOG_STYLE)
self.SetMinSize((346, 156))
bSizer1 = wx.BoxSizer(wx.VERTICAL)
bSizer2 = wx.BoxSizer(wx.VERTICAL)
text = wx.StaticText(self, wx.ID_ANY, 'Enter a name for your new Implant Set:')
text = wx.StaticText(self, wx.ID_ANY, _t('Enter a name for your new Implant Set:'))
bSizer2.Add(text, 0)
bSizer1.Add(bSizer2, 0, wx.ALL, 10)

View File

@@ -1,6 +1,5 @@
import re
# noinspection PyPackageRequirements
import wx
import gui.fitCommands as cmd
@@ -12,6 +11,10 @@ from eos.saveddata.fit import Fit as es_Fit
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
# noinspection PyPackageRequirements
_t = wx.GetTranslation
class ChangeItemAmount(ContextMenuSingle):
@@ -28,7 +31,7 @@ class ChangeItemAmount(ContextMenuSingle):
return True
def getText(self, callingWindow, itmContext, mainItem):
return "Change {0} Quantity".format(itmContext)
return _t("Change {0} Quantity").format(itmContext)
def activate(self, callingWindow, fullContext, mainItem, i):
fitID = self.mainFrame.getActiveFit()
@@ -54,30 +57,30 @@ class ChangeItemAmount(ContextMenuSingle):
if isinstance(mainItem, es_Cargo):
self.mainFrame.command.Submit(cmd.GuiChangeCargoAmountCommand(
fitID=fitID, itemID=mainItem.itemID, amount=cleanInput))
fitID=fitID, itemID=mainItem.itemID, amount=cleanInput))
elif isinstance(mainItem, Drone):
if srcContext == "projectedDrone":
self.mainFrame.command.Submit(cmd.GuiChangeProjectedDroneAmountCommand(
fitID=fitID, itemID=mainItem.itemID, amount=cleanInput))
fitID=fitID, itemID=mainItem.itemID, amount=cleanInput))
else:
if mainItem in fit.drones:
position = fit.drones.index(mainItem)
self.mainFrame.command.Submit(cmd.GuiChangeLocalDroneAmountCommand(
fitID=fitID, position=position, amount=cleanInput))
fitID=fitID, position=position, amount=cleanInput))
elif isinstance(mainItem, es_Fit):
self.mainFrame.command.Submit(cmd.GuiChangeProjectedFitAmountCommand(
fitID=fitID, projectedFitID=mainItem.ID, amount=cleanInput))
fitID=fitID, projectedFitID=mainItem.ID, amount=cleanInput))
elif isinstance(mainItem, es_Fighter):
if srcContext == "projectedFighter":
if mainItem in fit.projectedFighters:
position = fit.projectedFighters.index(mainItem)
self.mainFrame.command.Submit(cmd.GuiChangeProjectedFighterAmountCommand(
fitID=fitID, position=position, amount=cleanInput))
fitID=fitID, position=position, amount=cleanInput))
else:
if mainItem in fit.fighters:
position = fit.fighters.index(mainItem)
self.mainFrame.command.Submit(cmd.GuiChangeLocalFighterAmountCommand(
fitID=fitID, position=position, amount=cleanInput))
fitID=fitID, position=position, amount=cleanInput))
ChangeItemAmount.register()
@@ -86,13 +89,13 @@ ChangeItemAmount.register()
class AmountChanger(wx.Dialog):
def __init__(self, parent, value, limits=None):
super().__init__(parent, title="Change Amount", style=wx.DEFAULT_DIALOG_STYLE)
super().__init__(parent, title=_t("Change Amount"), style=wx.DEFAULT_DIALOG_STYLE)
self.SetMinSize((346, 156))
bSizer1 = wx.BoxSizer(wx.VERTICAL)
bSizer2 = wx.BoxSizer(wx.VERTICAL)
text = wx.StaticText(self, wx.ID_ANY, "New Amount:" if limits is None else "New Amount ({}-{})".format(*limits))
text = wx.StaticText(self, wx.ID_ANY, _t("New Amount:") if limits is None else _t("New Amount ({}-{})").format(*limits))
bSizer2.Add(text, 0)
bSizer1.Add(bSizer2, 0, wx.ALL, 10)

View File

@@ -1,10 +1,13 @@
import wx
import gui.fitCommands as cmd
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
_t = wx.GetTranslation
class FillWithItem(ContextMenuSingle):
visibilitySetting = 'moduleFill'
def __init__(self):
@@ -26,12 +29,12 @@ class FillWithItem(ContextMenuSingle):
return True
def getText(self, callingWindow, itmContext, mainItem):
return "Fill With Module"
return _t("Fill With Module")
def activate(self, callingWindow, fullContext, mainItem, i):
self.mainFrame.command.Submit(cmd.GuiFillWithNewLocalModulesCommand(
fitID=self.mainFrame.getActiveFit(),
itemID=int(mainItem.ID)))
fitID=self.mainFrame.getActiveFit(),
itemID=int(mainItem.ID)))
FillWithItem.register()

View File

@@ -1,7 +1,11 @@
import wx
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from service.market import Market
_t = wx.GetTranslation
class JumpToMarketItem(ContextMenuSingle):
def __init__(self):
@@ -37,7 +41,7 @@ class JumpToMarketItem(ContextMenuSingle):
return doit
def getText(self, callingWindow, itmContext, mainItem):
return "{0} Market Group".format(itmContext if itmContext is not None else "Item")
return _t("{0} Market Group").format(itmContext if itmContext is not None else _t("Item"))
def activate(self, callingWindow, fullContext, mainItem, i):
srcContext = fullContext[0]

View File

@@ -1,11 +1,14 @@
import wx
import gui.fitCommands as cmd
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
_t = wx.GetTranslation
class ProjectItem(ContextMenuSingle):
visibilitySetting = 'project'
def __init__(self):
@@ -28,7 +31,7 @@ class ProjectItem(ContextMenuSingle):
return mainItem.isType("projected")
def getText(self, callingWindow, itmContext, mainItem):
return "Project {0} onto Fit".format(itmContext)
return _t("Project {0} onto Fit").format(itmContext)
def activate(self, callingWindow, fullContext, mainItem, i):
fitID = self.mainFrame.getActiveFit()

View File

@@ -1,6 +1,5 @@
import re
# noinspection PyPackageRequirements
import wx
import gui.fitCommands as cmd
@@ -12,6 +11,10 @@ from gui.contextMenu import ContextMenuCombined
from gui.fitCommands.helpers import getSimilarFighters, getSimilarModPositions
from service.fit import Fit
# noinspection PyPackageRequirements
_t = wx.GetTranslation
class ChangeItemProjectionRange(ContextMenuCombined):
@@ -28,7 +31,7 @@ class ChangeItemProjectionRange(ContextMenuCombined):
return True
def getText(self, callingWindow, itmContext, mainItem, selection):
return 'Change {} Range'.format(itmContext)
return _t('Change {} Range').format(itmContext)
def activate(self, callingWindow, fullContext, mainItem, selection, i):
fitID = self.mainFrame.getActiveFit()
@@ -63,7 +66,7 @@ class ChangeItemProjectionRange(ContextMenuCombined):
fit = Fit.getInstance().getFit(fitID)
items = getSimilarFighters(fit.projectedFighters, mainItem)
self.mainFrame.command.Submit(cmd.GuiChangeProjectedItemsProjectionRangeCommand(
fitID=fitID, items=items, projectionRange=newRange))
fitID=fitID, items=items, projectionRange=newRange))
ChangeItemProjectionRange.register()

View File

@@ -12,6 +12,8 @@ from gui.contextMenu import ContextMenuCombined
from gui.fitCommands.helpers import getSimilarFighters, getSimilarModPositions
from service.fit import Fit
_t = wx.GetTranslation
class RemoveItem(ContextMenuCombined):
@@ -20,13 +22,13 @@ class RemoveItem(ContextMenuCombined):
def display(self, callingWindow, srcContext, mainItem, selection):
if srcContext not in (
"fittingModule", "droneItem",
"implantItem", "boosterItem",
"projectedModule", "cargoItem",
"projectedFit", "projectedDrone",
"fighterItem", "projectedFighter",
"commandFit", "graphFitList",
"graphTgtList"
"fittingModule", "droneItem",
"implantItem", "boosterItem",
"projectedModule", "cargoItem",
"projectedFit", "projectedDrone",
"fighterItem", "projectedFighter",
"commandFit", "graphFitList",
"graphTgtList"
):
return False
@@ -37,9 +39,9 @@ class RemoveItem(ContextMenuCombined):
return True
def getText(self, callingWindow, itmContext, mainItem, selection):
return 'Remove {}{}'.format(
itmContext if itmContext is not None else 'Item',
' Stack' if self.srcContext in ('droneItem', 'projectedDrone', 'cargoItem', 'projectedFit') else '')
return _t('Remove {}{}').format(
itmContext if itmContext is not None else _t('Item'),
_t(' Stack') if self.srcContext in ('droneItem', 'projectedDrone', 'cargoItem', 'projectedFit') else '')
def activate(self, callingWindow, fullContext, mainItem, selection, i):
handlerMap = {
@@ -55,7 +57,8 @@ class RemoveItem(ContextMenuCombined):
'projectedFighter': self.__handleProjectedItem,
'commandFit': self.__handleCommandFit,
'graphFitList': self.__handleGraphItem,
'graphTgtList': self.__handleGraphItem}
'graphTgtList': self.__handleGraphItem
}
srcContext = fullContext[0]
handler = handlerMap.get(srcContext)
if handler is None:
@@ -73,7 +76,7 @@ class RemoveItem(ContextMenuCombined):
if mod in fit.modules:
positions.append(fit.modules.index(mod))
self.mainFrame.command.Submit(cmd.GuiRemoveLocalModuleCommand(
fitID=fitID, positions=positions))
fitID=fitID, positions=positions))
def __handleDrone(self, callingWindow, mainItem, selection):
fitID = self.mainFrame.getActiveFit()
@@ -83,7 +86,7 @@ class RemoveItem(ContextMenuCombined):
if drone in fit.drones:
positions.append(fit.drones.index(drone))
self.mainFrame.command.Submit(cmd.GuiRemoveLocalDronesCommand(
fitID=fitID, positions=positions, amount=math.inf))
fitID=fitID, positions=positions, amount=math.inf))
def __handleFighter(self, callingWindow, mainItem, selection):
fitID = self.mainFrame.getActiveFit()
@@ -97,7 +100,7 @@ class RemoveItem(ContextMenuCombined):
if fighter in fit.fighters:
positions.append(fit.fighters.index(fighter))
self.mainFrame.command.Submit(cmd.GuiRemoveLocalFightersCommand(
fitID=fitID, positions=positions))
fitID=fitID, positions=positions))
def __handleImplant(self, callingWindow, mainItem, selection):
fitID = self.mainFrame.getActiveFit()
@@ -107,7 +110,7 @@ class RemoveItem(ContextMenuCombined):
if implant in fit.implants:
positions.append(fit.implants.index(implant))
self.mainFrame.command.Submit(cmd.GuiRemoveImplantsCommand(
fitID=fitID, positions=positions))
fitID=fitID, positions=positions))
def __handleBooster(self, callingWindow, mainItem, selection):
fitID = self.mainFrame.getActiveFit()
@@ -117,19 +120,19 @@ class RemoveItem(ContextMenuCombined):
if booster in fit.boosters:
positions.append(fit.boosters.index(booster))
self.mainFrame.command.Submit(cmd.GuiRemoveBoostersCommand(
fitID=fitID, positions=positions))
fitID=fitID, positions=positions))
def __handleCargo(self, callingWindow, mainItem, selection):
fitID = self.mainFrame.getActiveFit()
itemIDs = [c.itemID for c in selection]
self.mainFrame.command.Submit(cmd.GuiRemoveCargosCommand(
fitID=fitID, itemIDs=itemIDs))
fitID=fitID, itemIDs=itemIDs))
def __handleProjectedItem(self, callingWindow, mainItem, selection):
fitID = self.mainFrame.getActiveFit()
if isinstance(mainItem, EosFit):
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedItemsCommand(
fitID=fitID, items=selection, amount=math.inf))
fitID=fitID, items=selection, amount=math.inf))
elif isinstance(mainItem, EosModule):
if wx.GetMouseState().GetModifiers() in (wx.MOD_ALT, wx.MOD_CONTROL):
fit = Fit.getInstance().getFit(fitID)
@@ -138,10 +141,10 @@ class RemoveItem(ContextMenuCombined):
else:
items = selection
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedItemsCommand(
fitID=fitID, items=items, amount=math.inf))
fitID=fitID, items=items, amount=math.inf))
elif isinstance(mainItem, EosDrone):
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedItemsCommand(
fitID=fitID, items=selection, amount=math.inf))
fitID=fitID, items=selection, amount=math.inf))
elif isinstance(mainItem, EosFighter):
if wx.GetMouseState().GetModifiers() in (wx.MOD_ALT, wx.MOD_CONTROL):
fit = Fit.getInstance().getFit(fitID)
@@ -149,16 +152,16 @@ class RemoveItem(ContextMenuCombined):
else:
items = selection
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedItemsCommand(
fitID=fitID, items=items, amount=math.inf))
fitID=fitID, items=items, amount=math.inf))
else:
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedItemsCommand(
fitID=fitID, items=selection, amount=math.inf))
fitID=fitID, items=selection, amount=math.inf))
def __handleCommandFit(self, callingWindow, mainItem, selection):
fitID = self.mainFrame.getActiveFit()
commandFitIDs = [cf.ID for cf in selection]
self.mainFrame.command.Submit(cmd.GuiRemoveCommandFitsCommand(
fitID=fitID, commandFitIDs=commandFitIDs))
fitID=fitID, commandFitIDs=commandFitIDs))
def __handleGraphItem(self, callingWindow, mainItem, selection):
callingWindow.removeWrappers(selection)

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
@@ -6,6 +7,8 @@ from gui.contextMenu import ContextMenuSingle
from gui.itemStats import ItemStatsFrame
from service.fit import Fit
_t = wx.GetTranslation
class ItemStats(ContextMenuSingle):
def __init__(self):
@@ -13,16 +16,16 @@ class ItemStats(ContextMenuSingle):
def display(self, callingWindow, srcContext, mainItem):
if srcContext not in (
"marketItemGroup", "marketItemMisc",
"fittingModule", "fittingCharge",
"fittingShip", "baseShip",
"cargoItem", "droneItem",
"implantItem", "boosterItem",
"skillItem", "projectedModule",
"projectedDrone", "projectedCharge",
"itemStats", "fighterItem",
"implantItemChar", "projectedFighter",
"fittingMode"
"marketItemGroup", "marketItemMisc",
"fittingModule", "fittingCharge",
"fittingShip", "baseShip",
"cargoItem", "droneItem",
"implantItem", "boosterItem",
"skillItem", "projectedModule",
"projectedDrone", "projectedCharge",
"itemStats", "fighterItem",
"implantItemChar", "projectedFighter",
"fittingMode"
):
return False
@@ -32,7 +35,7 @@ class ItemStats(ContextMenuSingle):
return True
def getText(self, callingWindow, itmContext, mainItem):
return "{} Stats".format(itmContext if itmContext is not None else "Item")
return _t("{} Stats").format(itmContext if itmContext is not None else _t("Item"))
def activate(self, callingWindow, fullContext, mainItem, i):
srcContext = fullContext[0]

View File

@@ -1,16 +1,18 @@
# noinspection PyPackageRequirements
import wx
import gui.fitCommands as cmd
import gui.mainFrame
from gui.contextMenu import ContextMenuCombined
from gui.fitCommands.helpers import getSimilarModPositions, getSimilarFighters
from gui.fitCommands.helpers import getSimilarFighters, getSimilarModPositions
from service.fit import Fit
from service.market import Market
_t = wx.GetTranslation
class ChangeItemToVariation(ContextMenuCombined):
visibilitySetting = 'metaSwap'
def __init__(self):
@@ -18,15 +20,15 @@ class ChangeItemToVariation(ContextMenuCombined):
def display(self, callingWindow, srcContext, mainItem, selection):
if self.mainFrame.getActiveFit() is None or srcContext not in (
'fittingModule',
'droneItem',
'fighterItem',
'boosterItem',
'implantItem',
'cargoItem',
'projectedModule',
'projectedDrone',
'projectedFighter'
'fittingModule',
'droneItem',
'fighterItem',
'boosterItem',
'implantItem',
'cargoItem',
'projectedModule',
'projectedDrone',
'projectedFighter'
):
return False
@@ -44,7 +46,7 @@ class ChangeItemToVariation(ContextMenuCombined):
return True
def getText(self, callingWindow, itmContext, mainItem, selection):
return 'Variations'
return _t('Variations')
def getSubMenu(self, callingWindow, context, mainItem, selection, rootMenu, i, pitem):
self.moduleLookup = {}
@@ -60,7 +62,8 @@ class ChangeItemToVariation(ContextMenuCombined):
# We want deadspace before officer mods
5: 6, 6: 5,
# For structures we want t1-t2-faction
54: 52, 52: 54}
54: 52, 52: 54
}
metaGroup = sMkt.getMetaGroupByItem(x)
return remap.get(metaGroup.ID, metaGroup.ID) if metaGroup is not None else 0
@@ -86,8 +89,8 @@ class ChangeItemToVariation(ContextMenuCombined):
# Do not show abyssal items
items = list(
i for i in self.mainVariations
if sMkt.getMetaGroupByItem(i) is None or sMkt.getMetaGroupByItem(i).ID != 15)
i for i in self.mainVariations
if sMkt.getMetaGroupByItem(i) is None or sMkt.getMetaGroupByItem(i).ID != 15)
# Sort items by metalevel, and group within that metalevel
# Sort all items by name first
items.sort(key=lambda x: x.name)
@@ -143,7 +146,8 @@ class ChangeItemToVariation(ContextMenuCombined):
'boosterItem': self.__handleBooster,
'projectedModule': self.__handleProjectedModule,
'projectedDrone': self.__handleProjectedDrone,
'projectedFighter': self.__handleProjectedFighter}
'projectedFighter': self.__handleProjectedFighter
}
handler = handlerMap.get(context)
if handler is None:
return
@@ -169,7 +173,7 @@ class ChangeItemToVariation(ContextMenuCombined):
if modVariations == self.mainVariations:
positions.append(fit.modules.index(mod))
self.mainFrame.command.Submit(cmd.GuiChangeLocalModuleMetasCommand(
fitID=fitID, positions=positions, newItemID=varItem.ID))
fitID=fitID, positions=positions, newItemID=varItem.ID))
def __handleDrone(self, varItem):
fitID = self.mainFrame.getActiveFit()
@@ -186,7 +190,7 @@ class ChangeItemToVariation(ContextMenuCombined):
if droneVariations == self.mainVariations:
positions.append(fit.drones.index(drone))
self.mainFrame.command.Submit(cmd.GuiChangeLocalDroneMetasCommand(
fitID=fitID, positions=positions, newItemID=varItem.ID))
fitID=fitID, positions=positions, newItemID=varItem.ID))
def __handleFighter(self, varItem):
fitID = self.mainFrame.getActiveFit()
@@ -207,7 +211,7 @@ class ChangeItemToVariation(ContextMenuCombined):
if fighterVariations == self.mainVariations:
positions.append(fit.fighters.index(fighter))
self.mainFrame.command.Submit(cmd.GuiChangeLocalFighterMetasCommand(
fitID=fitID, positions=positions, newItemID=varItem.ID))
fitID=fitID, positions=positions, newItemID=varItem.ID))
def __handleCargo(self, varItem):
fitID = self.mainFrame.getActiveFit()
@@ -221,7 +225,7 @@ class ChangeItemToVariation(ContextMenuCombined):
if cargoVariations == self.mainVariations:
itemIDs.append(cargo.itemID)
self.mainFrame.command.Submit(cmd.GuiChangeCargoMetasCommand(
fitID=fitID, itemIDs=itemIDs, newItemID=varItem.ID))
fitID=fitID, itemIDs=itemIDs, newItemID=varItem.ID))
def __handleImplant(self, varItem):
fitID = self.mainFrame.getActiveFit()
@@ -230,7 +234,7 @@ class ChangeItemToVariation(ContextMenuCombined):
if implant in fit.implants:
position = fit.implants.index(implant)
self.mainFrame.command.Submit(cmd.GuiChangeImplantMetaCommand(
fitID=fitID, position=position, newItemID=varItem.ID))
fitID=fitID, position=position, newItemID=varItem.ID))
def __handleBooster(self, varItem):
fitID = self.mainFrame.getActiveFit()
@@ -239,7 +243,7 @@ class ChangeItemToVariation(ContextMenuCombined):
if booster in fit.boosters:
position = fit.boosters.index(booster)
self.mainFrame.command.Submit(cmd.GuiChangeBoosterMetaCommand(
fitID=fitID, position=position, newItemID=varItem.ID))
fitID=fitID, position=position, newItemID=varItem.ID))
def __handleProjectedModule(self, varItem):
fitID = self.mainFrame.getActiveFit()
@@ -259,7 +263,7 @@ class ChangeItemToVariation(ContextMenuCombined):
if modVariations == self.mainVariations:
positions.append(fit.projectedModules.index(mod))
self.mainFrame.command.Submit(cmd.GuiChangeProjectedModuleMetasCommand(
fitID=fitID, positions=positions, newItemID=varItem.ID))
fitID=fitID, positions=positions, newItemID=varItem.ID))
def __handleProjectedDrone(self, varItem):
fitID = self.mainFrame.getActiveFit()
@@ -276,7 +280,7 @@ class ChangeItemToVariation(ContextMenuCombined):
if droneVariations == self.mainVariations:
itemIDs.append(drone.itemID)
self.mainFrame.command.Submit(cmd.GuiChangeProjectedDroneMetasCommand(
fitID=fitID, itemIDs=itemIDs, newItemID=varItem.ID))
fitID=fitID, itemIDs=itemIDs, newItemID=varItem.ID))
def __handleProjectedFighter(self, varItem):
fitID = self.mainFrame.getActiveFit()
@@ -297,7 +301,7 @@ class ChangeItemToVariation(ContextMenuCombined):
if fighterVariations == self.mainVariations:
positions.append(fit.projectedFighters.index(fighter))
self.mainFrame.command.Submit(cmd.GuiChangeProjectedFighterMetasCommand(
fitID=fitID, positions=positions, newItemID=varItem.ID))
fitID=fitID, positions=positions, newItemID=varItem.ID))
ChangeItemToVariation.register()

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.fitCommands as cmd
@@ -9,6 +10,8 @@ from gui.fitCommands.helpers import getSimilarModPositions
from service.ammo import Ammo
from service.fit import Fit
_t = wx.GetTranslation
class ChangeModuleAmmo(ContextMenuCombined):
@@ -34,7 +37,7 @@ class ChangeModuleAmmo(ContextMenuCombined):
return True
def getText(self, callingWindow, itmContext, mainItem, selection):
return 'Charge'
return _t('Charge')
def _getAmmo(self, mod):
if mod.itemID is None:
@@ -129,9 +132,9 @@ class ChangeModuleAmmo(ContextMenuCombined):
return
positions = getSimilarModPositions(modContainer, self.module)
self.mainFrame.command.Submit(command(
fitID=fitID,
positions=positions,
chargeItemID=charge.ID if charge is not None else None))
fitID=fitID,
positions=positions,
chargeItemID=charge.ID if charge is not None else None))
else:
if self.srcContext == 'fittingModule':
command = cmd.GuiChangeLocalModuleChargesCommand
@@ -148,9 +151,9 @@ class ChangeModuleAmmo(ContextMenuCombined):
if modCharges.issubset(self.mainCharges):
positions.append(position)
self.mainFrame.command.Submit(command(
fitID=fitID,
positions=positions,
chargeItemID=charge.ID if charge is not None else None))
fitID=fitID,
positions=positions,
chargeItemID=charge.ID if charge is not None else None))
ChangeModuleAmmo.register()

View File

@@ -1,11 +1,14 @@
import wx
import gui.fitCommands as cmd
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
_t = wx.GetTranslation
class FillWithModule(ContextMenuSingle):
visibilitySetting = 'moduleFill'
def __init__(self):
@@ -18,7 +21,7 @@ class FillWithModule(ContextMenuSingle):
return srcContext == "fittingModule"
def getText(self, callingWindow, itmContext, mainItem):
return "Fill With {0}".format(itmContext if itmContext is not None else "Module")
return _t("Fill With {0}").format(itmContext if itmContext is not None else _t("Module"))
def activate(self, callingWindow, fullContext, mainItem, i):
@@ -30,7 +33,7 @@ class FillWithModule(ContextMenuSingle):
if mainItem in fit.modules:
position = fit.modules.index(mainItem)
self.mainFrame.command.Submit(cmd.GuiFillWithClonedLocalModulesCommand(
fitID=fitID, position=position))
fitID=fitID, position=position))
FillWithModule.register()

View File

@@ -1,8 +1,12 @@
import wx
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from gui.utils.clipboard import toClipboard
from service.port.muta import renderMutant
_t = wx.GetTranslation
class ExportMutatedModule(ContextMenuSingle):
@@ -21,7 +25,7 @@ class ExportMutatedModule(ContextMenuSingle):
return True
def getText(self, callingWindow, itmContext, mainItem):
return 'Copy Module to Clipboard'
return _t('Copy Module to Clipboard')
def activate(self, callingWindow, fullContext, mainItem, i):
export = renderMutant(mainItem, prefix=' ')

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
@@ -6,6 +7,8 @@ from gui.contextMenu import ContextMenuSingle
from gui.fitCommands import GuiConvertMutatedLocalModuleCommand, GuiRevertMutatedLocalModuleCommand
from service.fit import Fit
_t = wx.GetTranslation
class ChangeModuleMutation(ContextMenuSingle):
@@ -27,7 +30,7 @@ class ChangeModuleMutation(ContextMenuSingle):
return True
def getText(self, callingWindow, itmContext, mainItem):
return "Apply Mutaplasmid" if not mainItem.isMutated else "Revert to {}".format(mainItem.baseItem.name)
return _t("Apply Mutaplasmid") if not mainItem.isMutated else _t("Revert to {}").format(mainItem.baseItem.name)
def getSubMenu(self, callingWindow, context, mainItem, rootMenu, i, pitem):
if mainItem.isMutated:
@@ -56,7 +59,7 @@ class ChangeModuleMutation(ContextMenuSingle):
if mod in fit.modules:
position = fit.modules.index(mod)
self.mainFrame.command.Submit(GuiConvertMutatedLocalModuleCommand(
fitID=fitID, position=position, mutaplasmid=mutaplasmid))
fitID=fitID, position=position, mutaplasmid=mutaplasmid))
def activate(self, callingWindow, fullContext, mainItem, i):
fitID = self.mainFrame.getActiveFit()
@@ -64,7 +67,7 @@ class ChangeModuleMutation(ContextMenuSingle):
if mainItem in fit.modules:
position = fit.modules.index(mainItem)
self.mainFrame.command.Submit(GuiRevertMutatedLocalModuleCommand(
fitID=fitID, position=position))
fitID=fitID, position=position))
def getBitmap(self, callingWindow, context, mainItem):
return None

View File

@@ -1,18 +1,20 @@
import math
# noinspection PyPackageRequirements
import wx
import eos.config
import gui.fitCommands as cmd
import gui.mainFrame
from eos.utils.spoolSupport import SpoolType, SpoolOptions
from eos.utils.spoolSupport import SpoolOptions, SpoolType
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
# noinspection PyPackageRequirements
_t = wx.GetTranslation
class ChangeModuleSpool(ContextMenuSingle):
visibilitySetting = 'spoolup'
def __init__(self):
@@ -32,7 +34,7 @@ class ChangeModuleSpool(ContextMenuSingle):
return self.mod.item.group.name in ("Precursor Weapon", "Mutadaptive Remote Armor Repairer")
def getText(self, callingWindow, itmContext, mainItem):
return "Spoolup Cycles"
return _t("Spoolup Cycles")
def getSubMenu(self, callingWindow, context, mainItem, rootMenu, i, pitem):
m = wx.Menu()
@@ -78,7 +80,7 @@ class ChangeModuleSpool(ContextMenuSingle):
# Show default only for current value and when not overriden
if not isNotDefault and cycle == cycleDefault:
text = "{} (default)".format(cycle)
text = _t("{} (default)").format(cycle)
# Always show current selection and stuff which we decided to show via the cycles function
elif cycle == cycleCurrent or cycle in cyclesToShow:
text = "{}".format(cycle)
@@ -93,7 +95,7 @@ class ChangeModuleSpool(ContextMenuSingle):
self.cycleMap[menuId] = cycle
self.resetId = ContextMenuSingle.nextID()
item = wx.MenuItem(m, self.resetId, "Reset")
item = wx.MenuItem(m, self.resetId, _t("Reset"))
bindmenu.Bind(wx.EVT_MENU, self.handleSpoolChange, item)
m.Append(item)
@@ -114,12 +116,12 @@ class ChangeModuleSpool(ContextMenuSingle):
if self.mod in fit.modules:
position = fit.modules.index(self.mod)
self.mainFrame.command.Submit(cmd.GuiChangeLocalModuleSpoolCommand(
fitID=fitID, position=position, spoolType=spoolType, spoolAmount=spoolAmount))
fitID=fitID, position=position, spoolType=spoolType, spoolAmount=spoolAmount))
elif self.context == 'projectedModule':
if self.mod in fit.projectedModules:
position = fit.projectedModules.index(self.mod)
self.mainFrame.command.Submit(cmd.GuiChangeProjectedModuleSpoolCommand(
fitID=fitID, position=position, spoolType=spoolType, spoolAmount=spoolAmount))
fitID=fitID, position=position, spoolType=spoolType, spoolAmount=spoolAmount))
ChangeModuleSpool.register()

View File

@@ -7,6 +7,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from service.settings import MarketPriceSettings
_t = wx.GetTranslation
class ItemGroupPrice(ContextMenuUnconditional, metaclass=ABCMeta):
@@ -14,11 +16,6 @@ class ItemGroupPrice(ContextMenuUnconditional, metaclass=ABCMeta):
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.settings = MarketPriceSettings.getInstance()
@property
@abstractmethod
def label(self):
raise NotImplementedError()
@property
@abstractmethod
def optionName(self):
@@ -27,9 +24,6 @@ class ItemGroupPrice(ContextMenuUnconditional, metaclass=ABCMeta):
def display(self, callingWindow, srcContext):
return srcContext in ("priceViewFull", "priceViewMinimal")
def getText(self, callingWindow, itmContext):
return self.label
def activate(self, callingWindow, fullContext, i):
self.settings.set(self.optionName, not self.settings.get(self.optionName))
fitID = self.mainFrame.getActiveFit()
@@ -40,22 +34,25 @@ class ItemGroupPrice(ContextMenuUnconditional, metaclass=ABCMeta):
class DronesPrice(ItemGroupPrice):
label = 'Drones'
optionName = 'drones'
def getText(self, callingWindow, itmContext):
return _t('Drones')
class CargoPrice(ItemGroupPrice):
label = 'Cargo'
optionName = 'cargo'
def getText(self, callingWindow, itmContext):
return _t('Cargo')
class ImplantBoosterPrice(ItemGroupPrice):
label = 'Implants && Boosters'
optionName = 'character'
def getText(self, callingWindow, itmContext):
return _t('Implants && Boosters')
DronesPrice.register()
CargoPrice.register()

View File

@@ -1,6 +1,5 @@
from collections import OrderedDict
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
@@ -10,6 +9,9 @@ from gui.contextMenu import ContextMenuCombined
from service.const import TargetResistMode
from service.settings import GraphSettings
# noinspection PyPackageRequirements
_t = wx.GetTranslation
optionMap = OrderedDict((
('Auto', TargetResistMode.auto),
@@ -36,7 +38,7 @@ class TargetWrapperResists(ContextMenuCombined):
return True
def getText(self, callingWindow, itmContext, mainItem, selection):
return 'Resist Mode'
return _t('Resist Mode')
def addOption(self, menu, optionLabel):
id = ContextMenuCombined.nextID()

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
@@ -6,6 +7,8 @@ from gui.builtinShipBrowser.events import Stage3Selected
from gui.contextMenu import ContextMenuUnconditional
from service.fit import Fit
_t = wx.GetTranslation
class JumpToShip(ContextMenuUnconditional):
@@ -29,7 +32,7 @@ class JumpToShip(ContextMenuUnconditional):
return False
def getText(self, callingWindow, itmContext):
return "Open in Fitting Browser"
return _t("Open in Fitting Browser")
def activate(self, callingWindow, fullContext, i):
fitID = self.mainFrame.getActiveFit()

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.fitCommands as cmd
@@ -6,6 +7,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from service.fit import Fit
_t = wx.GetTranslation
class ChangeShipTacticalMode(ContextMenuUnconditional):
@@ -26,7 +29,7 @@ class ChangeShipTacticalMode(ContextMenuUnconditional):
return srcContext == "fittingShip" and self.modes is not None
def getText(self, callingWindow, itmContext):
return "Tactical Mode"
return _t("Tactical Mode")
def addMode(self, menu, mode):
label = mode.item.name.rsplit()[-2]

View File

@@ -1,4 +1,5 @@
# noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
@@ -9,9 +10,10 @@ from gui.contextMenu import ContextMenuSingle
from service.character import Character
from service.fit import Fit
_t = wx.GetTranslation
class ChangeAffectingSkills(ContextMenuSingle):
visibilitySetting = 'changeAffectingSkills'
def __init__(self):
@@ -19,9 +21,9 @@ class ChangeAffectingSkills(ContextMenuSingle):
def display(self, callingWindow, srcContext, mainItem):
if srcContext not in (
"fittingModule", "fittingCharge",
"fittingShip", "droneItem",
"fighterItem"
"fittingModule", "fittingCharge",
"fittingShip", "droneItem",
"fighterItem"
):
return False
@@ -68,7 +70,7 @@ class ChangeAffectingSkills(ContextMenuSingle):
return len(self.skills) > 0
def getText(self, callingWindow, itmContext, mainItem):
return "Change %s Skills" % itmContext
return _t("Change %s Skills") % itmContext
def addSkill(self, rootMenu, skill, i):
if i < 0:

View File

@@ -1,7 +1,6 @@
from collections import OrderedDict
from itertools import chain
# noinspection PyPackageRequirements
import wx
import gui.mainFrame
@@ -10,6 +9,10 @@ from gui.contextMenu import ContextMenuUnconditional
from gui.utils.sorter import smartSort
from service.targetProfile import TargetProfile as svc_TargetProfile
# noinspection PyPackageRequirements
_t = wx.GetTranslation
class TargetProfileAdder(ContextMenuUnconditional):

View File

@@ -1,8 +1,12 @@
import wx
import gui.mainFrame
from graphs.wrapper import TargetWrapper
from gui.contextMenu import ContextMenuSingle
from gui.targetProfileEditor import TargetProfileEditor
_t = wx.GetTranslation
class TargetProfileEditorMenu(ContextMenuSingle):

View File

@@ -1,7 +1,6 @@
from collections import OrderedDict
from itertools import chain
# noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
@@ -11,6 +10,10 @@ from gui.utils.sorter import smartSort
from service.fit import Fit
from service.targetProfile import TargetProfile as svc_TargetProfile
# noinspection PyPackageRequirements
_t = wx.GetTranslation
class TargetProfileSwitcher(ContextMenuUnconditional):

View File

@@ -17,6 +17,8 @@ import gui.mainFrame
from gui.contextMenu import ContextMenu
from gui.bitmap_loader import BitmapLoader
_t = wx.GetTranslation
def formatOperator(operator, stackingGroup, preResAmount, postResAmount):
opMap = {
@@ -24,7 +26,8 @@ def formatOperator(operator, stackingGroup, preResAmount, postResAmount):
Operator.PREINCREASE: '+',
Operator.MULTIPLY: '*',
Operator.POSTINCREASE: '+',
Operator.FORCE: '\u2263'}
Operator.FORCE: '\u2263'
}
prefix = ''
if stackingGroup is not None:
prefix += 's'
@@ -61,17 +64,17 @@ class ItemAffectedBy(wx.Panel):
mainSizer.Add(self.m_staticline, 0, wx.EXPAND)
bSizer = wx.BoxSizer(wx.HORIZONTAL)
self.toggleExpandBtn = wx.ToggleButton(self, wx.ID_ANY, "Expand All", wx.DefaultPosition, wx.DefaultSize, 0)
self.toggleExpandBtn = wx.ToggleButton(self, wx.ID_ANY, _t("Expand All"), wx.DefaultPosition, wx.DefaultSize, 0)
bSizer.Add(self.toggleExpandBtn, 0, wx.ALIGN_CENTER_VERTICAL)
self.toggleNameBtn = wx.ToggleButton(self, wx.ID_ANY, "Toggle Names", wx.DefaultPosition, wx.DefaultSize, 0)
self.toggleNameBtn = wx.ToggleButton(self, wx.ID_ANY, _t("Toggle Names"), wx.DefaultPosition, wx.DefaultSize, 0)
bSizer.Add(self.toggleNameBtn, 0, wx.ALIGN_CENTER_VERTICAL)
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, "Toggle View", wx.DefaultPosition, wx.DefaultSize, 0)
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, _t("Toggle View"), wx.DefaultPosition, wx.DefaultSize, 0)
bSizer.Add(self.toggleViewBtn, 0, wx.ALIGN_CENTER_VERTICAL)
if stuff is not None:
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Refresh", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
self.refreshBtn = wx.Button(self, wx.ID_ANY, _t("Refresh"), wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
bSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL)
self.refreshBtn.Bind(wx.EVT_BUTTON, self.RefreshTree)

View File

@@ -11,6 +11,8 @@ from enum import IntEnum
from gui.builtinItemStatsViews.attributeGrouping import *
from service.const import GuiAttrGroup
_t = wx.GetTranslation
class AttributeView(IntEnum):
NORMAL = 1
@@ -25,7 +27,8 @@ class ItemParams(wx.Panel):
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.paramList = wx.lib.agw.hypertreelist.HyperTreeList(self, wx.ID_ANY, agwStyle=wx.TR_HIDE_ROOT | wx.TR_NO_LINES | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_HAS_BUTTONS)
self.paramList = wx.lib.agw.hypertreelist.HyperTreeList(self, wx.ID_ANY,
agwStyle=wx.TR_HIDE_ROOT | wx.TR_NO_LINES | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_HAS_BUTTONS)
self.paramList.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
mainSizer.Add(self.paramList, 1, wx.ALL | wx.EXPAND, 0)
@@ -38,25 +41,25 @@ class ItemParams(wx.Panel):
self.attrValues = {}
self._fetchValues()
self.paramList.AddColumn("Attribute")
self.paramList.AddColumn("Current Value")
self.paramList.AddColumn(_t("Attribute"))
self.paramList.AddColumn(_t("Current Value"))
if self.stuff is not None:
self.paramList.AddColumn("Base Value")
self.paramList.AddColumn(_t("Base Value"))
self.m_staticline = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
mainSizer.Add(self.m_staticline, 0, wx.EXPAND)
bSizer = wx.BoxSizer(wx.HORIZONTAL)
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, "View Raw Data", wx.DefaultPosition, wx.DefaultSize,
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, _t("View Raw Data"), wx.DefaultPosition, wx.DefaultSize,
0)
bSizer.Add(self.toggleViewBtn, 0, wx.ALIGN_CENTER_VERTICAL)
self.exportStatsBtn = wx.ToggleButton(self, wx.ID_ANY, "Export Item Stats", wx.DefaultPosition, wx.DefaultSize,
self.exportStatsBtn = wx.ToggleButton(self, wx.ID_ANY, _t("Export Item Stats"), wx.DefaultPosition, wx.DefaultSize,
0)
bSizer.Add(self.exportStatsBtn, 0, wx.ALIGN_CENTER_VERTICAL)
if stuff is not None:
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Refresh", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
self.refreshBtn = wx.Button(self, wx.ID_ANY, _t("Refresh"), wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
bSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL)
self.refreshBtn.Bind(wx.EVT_BUTTON, self.RefreshValues)
@@ -111,8 +114,8 @@ class ItemParams(wx.Panel):
exportFileName = self.item.name + " (" + str(self.item.ID) + ").csv"
with wx.FileDialog(
self, "Save CSV file", "", exportFileName,
"CSV files (*.csv)|*.csv", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT
self, _t("Save CSV file"), "", exportFileName,
_t("CSV files") + " (*.csv)|*.csv", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT
) as dlg:
if dlg.ShowModal() == wx.ID_CANCEL:
@@ -266,7 +269,7 @@ class ItemParams(wx.Panel):
for i in range(self.paramList.GetMainWindow().GetColumnCount()):
self.paramList.SetColumnWidth(i, wx.LIST_AUTOSIZE)
def GetData(self, attr, displayOveride = None):
def GetData(self, attr, displayOveride=None):
info = self.attrInfo.get(attr)
att = self.attrValues[attr]
@@ -285,7 +288,8 @@ class ItemParams(wx.Panel):
val = getattr(att, "value", None)
value = val if val is not None else att
if self.toggleView == AttributeView.NORMAL and ((attr not in GroupedAttributes and not (value or valueDefault)) or info is None or not info.published or attr in RequiredSkillAttrs):
if self.toggleView == AttributeView.NORMAL and (
(attr not in GroupedAttributes and not (value or valueDefault)) or info is None or not info.published or attr in RequiredSkillAttrs):
return None
if info and info.displayName and self.toggleView == AttributeView.NORMAL:

View File

@@ -7,6 +7,8 @@ from service.market import Market
from service.attribute import Attribute
from gui.utils.numberFormatter import formatAmount
_t = wx.GetTranslation
def defaultSort(item):
return (item.metaLevel or 0, item.name)
@@ -70,11 +72,11 @@ class ItemCompare(wx.Panel):
self.totalAttrsLabel = wx.StaticText(self, wx.ID_ANY, " ", wx.DefaultPosition, wx.DefaultSize, 0)
bSizer.Add(self.totalAttrsLabel, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, "Toggle view mode", wx.DefaultPosition,
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, _t("Toggle view mode"), wx.DefaultPosition,
wx.DefaultSize, 0)
bSizer.Add(self.toggleViewBtn, 0, wx.ALIGN_CENTER_VERTICAL)
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Refresh", wx.DefaultPosition, wx.DefaultSize,
self.refreshBtn = wx.Button(self, wx.ID_ANY, _t("Refresh"), wx.DefaultPosition, wx.DefaultSize,
wx.BU_EXACTFIT)
bSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL)
self.refreshBtn.Bind(wx.EVT_BUTTON, self.RefreshValues)
@@ -142,7 +144,7 @@ class ItemCompare(wx.Panel):
self.items = sorted(self.items, key=func, reverse=self.sortReverse)
self.paramList.InsertColumn(0, "Item")
self.paramList.InsertColumn(0, _t("Item"))
self.paramList.SetColumnWidth(0, 200)
for i, attr in enumerate(self.attrs.keys()):
@@ -150,7 +152,7 @@ class ItemCompare(wx.Panel):
self.paramList.InsertColumn(i + 1, name)
self.paramList.SetColumnWidth(i + 1, 120)
self.paramList.InsertColumn(len(self.attrs) + 1, "Price")
self.paramList.InsertColumn(len(self.attrs) + 1, _t("Price"))
self.paramList.SetColumnWidth(len(self.attrs) + 1, 60)
for item in self.items:
@@ -189,16 +191,16 @@ class ItemCompare(wx.Panel):
return "%s (%d)" % (attribute.name.capitalize(), value)
trans = {
"Inverse Absolute Percent" : (lambda: (1 - value) * 100, unitName),
"Inverse Absolute Percent": (lambda: (1 - value) * 100, unitName),
"Inversed Modifier Percent": (lambda: (1 - value) * 100, unitName),
"Modifier Percent" : (lambda: ("%+.2f" if ((value - 1) * 100) % 1 else "%+d") % ((value - 1) * 100), unitName),
"Volume" : (lambda: value, "m\u00B3"),
"Sizeclass" : (lambda: value, ""),
"Absolute Percent" : (lambda: (value * 100), unitName),
"Milliseconds" : (lambda: value / 1000.0, unitName),
"typeID" : (itemIDCallback, ""),
"groupID" : (groupIDCallback, ""),
"attributeID" : (attributeIDCallback, "")
"Modifier Percent": (lambda: ("%+.2f" if ((value - 1) * 100) % 1 else "%+d") % ((value - 1) * 100), unitName),
"Volume": (lambda: value, "m\u00B3"),
"Sizeclass": (lambda: value, ""),
"Absolute Percent": (lambda: (value * 100), unitName),
"Milliseconds": (lambda: value / 1000.0, unitName),
"typeID": (itemIDCallback, ""),
"groupID": (groupIDCallback, ""),
"attributeID": (attributeIDCallback, "")
}
override = trans.get(unitDisplayName)

View File

@@ -3,6 +3,8 @@ import wx
from gui.bitmap_loader import BitmapLoader
_t = wx.GetTranslation
class ItemDependents(wx.Panel):
def __init__(self, parent, stuff, item):
@@ -41,7 +43,7 @@ class ItemDependents(wx.Panel):
items = levelToItems[x]
items.sort(key=lambda x: x.name)
child = self.reqTree.AppendItem(parent, "Level {}".format(self.romanNb[int(x)]), sbIconId)
child = self.reqTree.AppendItem(parent, _t("Level {}").format(self.romanNb[int(x)]), sbIconId)
for item in items:
if item.iconID:

View File

@@ -4,6 +4,8 @@ import wx
import wx.html
import re
_t = wx.GetTranslation
class ItemDescription(wx.Panel):
def __init__(self, parent, stuff, item):
@@ -24,9 +26,9 @@ class ItemDescription(wx.Panel):
# Strip URLs
desc = re.sub("<( *)a(.*?)>(?P<inside>.*?)<( *)/( *)a( *)>", "\g<inside>", desc)
desc = "<body style='background-color: {}; color: {}'>{}</body>".format(
bgcolor.GetAsString(wx.C2S_CSS_SYNTAX),
fgcolor.GetAsString(wx.C2S_CSS_SYNTAX),
desc
bgcolor.GetAsString(wx.C2S_CSS_SYNTAX),
fgcolor.GetAsString(wx.C2S_CSS_SYNTAX),
desc
)
self.description.SetPage(desc)
@@ -38,7 +40,7 @@ class ItemDescription(wx.Panel):
self.description.Bind(wx.EVT_KEY_UP, self.onKeyUp)
self.popupMenu = wx.Menu()
copyItem = wx.MenuItem(self.popupMenu, 1, 'Copy')
copyItem = wx.MenuItem(self.popupMenu, 1, _t('Copy'))
self.popupMenu.Append(copyItem)
self.popupMenu.Bind(wx.EVT_MENU, self.menuClickHandler, copyItem)

View File

@@ -7,6 +7,7 @@ import wx
from .helpers import AutoListCtrl
_t = wx.GetTranslation
class ItemEffects(wx.Panel):
def __init__(self, parent, stuff, item):
@@ -26,12 +27,12 @@ class ItemEffects(wx.Panel):
def PopulateList(self):
self.effectList.InsertColumn(0, "Name")
self.effectList.InsertColumn(1, "Active")
self.effectList.InsertColumn(2, "Type")
self.effectList.InsertColumn(0, _t("Name"))
self.effectList.InsertColumn(1, _t("Active"))
self.effectList.InsertColumn(2, _t("Type"))
if config.debug:
self.effectList.InsertColumn(3, "Run Time")
self.effectList.InsertColumn(4, "ID")
self.effectList.InsertColumn(3, _t("Run Time"))
self.effectList.InsertColumn(4, _t("ID"))
# self.effectList.SetColumnWidth(0,385)
@@ -52,9 +53,9 @@ class ItemEffects(wx.Panel):
if effects[name].isImplemented:
if effects[name].activeByDefault:
activeByDefault = "Yes"
activeByDefault = _t("Yes")
else:
activeByDefault = "No"
activeByDefault = _t("No")
else:
activeByDefault = ""

View File

@@ -14,7 +14,7 @@ from .itemAttributes import ItemParams
pyfalog = Logger(__name__)
_t = wx.GetTranslation
class ItemMutatorPanel(wx.Panel):
@@ -48,13 +48,13 @@ class ItemMutatorPanel(wx.Panel):
mainSizer.Add(wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0, wx.EXPAND, 0)
footerSizer = wx.BoxSizer(wx.HORIZONTAL)
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Reset defaults", wx.DefaultPosition, wx.DefaultSize, 0)
self.refreshBtn = wx.Button(self, wx.ID_ANY, _t("Reset defaults"), wx.DefaultPosition, wx.DefaultSize, 0)
footerSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)
self.refreshBtn.Bind(wx.EVT_BUTTON, self.mutaList.resetMutatedValues)
self.randomBtn = wx.Button(self, wx.ID_ANY, "Random stats", wx.DefaultPosition, wx.DefaultSize, 0)
self.randomBtn = wx.Button(self, wx.ID_ANY, _t("Random stats"), wx.DefaultPosition, wx.DefaultSize, 0)
footerSizer.Add(self.randomBtn, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)
self.randomBtn.Bind(wx.EVT_BUTTON, self.mutaList.randomMutatedValues)
self.revertBtn = wx.Button(self, wx.ID_ANY, "Revert changes", wx.DefaultPosition, wx.DefaultSize, 0)
self.revertBtn = wx.Button(self, wx.ID_ANY, _t("Revert changes"), wx.DefaultPosition, wx.DefaultSize, 0)
footerSizer.Add(self.revertBtn, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)
self.revertBtn.Bind(wx.EVT_BUTTON, self.mutaList.revertChanges)
mainSizer.Add(footerSizer, 0, wx.ALL | wx.EXPAND, 5)

View File

@@ -2,7 +2,7 @@
import wx
from .helpers import AutoListCtrl
_t = wx.GetTranslation
class ItemProperties(wx.Panel):
def __init__(self, parent, stuff, item, context=None):
@@ -53,8 +53,8 @@ class ItemProperties(wx.Panel):
return
def PopulateList(self):
self.paramList.InsertColumn(0, "Attribute")
self.paramList.InsertColumn(1, "Current Value")
self.paramList.InsertColumn(0, _t("Attribute"))
self.paramList.InsertColumn(1, _t("Current Value"))
self.paramList.SetColumnWidth(0, 110)
self.paramList.SetColumnWidth(1, 1500)
self.paramList.setResizeColumn(0)
@@ -95,5 +95,5 @@ class ItemProperties(wx.Panel):
self.paramList.SortItems(lambda id1, id2: (idNameMap[id1] > idNameMap[id2]) - (idNameMap[id1] < idNameMap[id2]))
self.paramList.RefreshRows()
self.totalAttrsLabel.SetLabel("%d attributes. " % idCount)
self.totalAttrsLabel.SetLabel(_t("%d attribute.", "%d attributes.", idCount) % idCount)
self.Layout()

View File

@@ -3,6 +3,8 @@ import wx
# noinspection PyPackageRequirements
import wx.html
_t = wx.GetTranslation
class ItemTraits(wx.Panel):
def __init__(self, parent, stuff, item):
@@ -20,7 +22,7 @@ class ItemTraits(wx.Panel):
self.Layout()
self.popupMenu = wx.Menu()
copyItem = wx.MenuItem(self.popupMenu, 1, 'Copy')
copyItem = wx.MenuItem(self.popupMenu, 1, _t('Copy'))
self.popupMenu.Append(copyItem)
self.popupMenu.Bind(wx.EVT_MENU, self.menuClickHandler, copyItem)

View File

@@ -5,11 +5,13 @@ from gui.bitmap_loader import BitmapLoader
import gui.mainFrame
from service.settings import ContextMenuSettings
_t = wx.GetTranslation
class PFContextMenuPref(PreferenceView):
title = "Context Menus"
def populatePanel(self, panel):
self.title = _t("Context Menus")
self.settings = ContextMenuSettings.getInstance()
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
@@ -22,11 +24,11 @@ class PFContextMenuPref(PreferenceView):
mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)
self.stSubTitle = wx.StaticText(
panel, wx.ID_ANY,
'Disabling context menus can improve responsiveness.\n'
'You can hold {} key + right-click to show all menu items regardless of these settings.'.format(
'Command' if 'wxMac' in wx.PlatformInfo else 'Control'),
wx.DefaultPosition, wx.DefaultSize, 0)
panel, wx.ID_ANY,
_t('Disabling context menus can improve responsiveness.\n'
'You can hold {} key + right-click to show all menu items regardless of these settings.').format(
'Command' if 'wxMac' in wx.PlatformInfo else 'Control'),
wx.DefaultPosition, wx.DefaultSize, 0)
self.stSubTitle.Wrap(-1)
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 5)
@@ -36,17 +38,17 @@ class PFContextMenuPref(PreferenceView):
rbSizerRow1 = wx.BoxSizer(wx.HORIZONTAL)
self.rbBox1 = wx.RadioBox(panel, -1, "Set as Damage Pattern", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
self.rbBox1 = wx.RadioBox(panel, -1, _t("Set as Damage Pattern"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
self.rbBox1.SetSelection(self.settings.get('ammoPattern'))
rbSizerRow1.Add(self.rbBox1, 1, wx.ALL, 5)
self.rbBox1.Bind(wx.EVT_RADIOBOX, self.OnSetting1Change)
self.rbBox2 = wx.RadioBox(panel, -1, "Change Skills", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
self.rbBox2 = wx.RadioBox(panel, -1, _t("Change Skills"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
self.rbBox2.SetSelection(self.settings.get('changeAffectingSkills'))
rbSizerRow1.Add(self.rbBox2, 1, wx.ALL, 5)
self.rbBox2.Bind(wx.EVT_RADIOBOX, self.OnSetting2Change)
self.rbBox3 = wx.RadioBox(panel, -1, "Variations", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
self.rbBox3 = wx.RadioBox(panel, -1, _t("Variations"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
self.rbBox3.SetSelection(self.settings.get('metaSwap'))
rbSizerRow1.Add(self.rbBox3, 1, wx.ALL, 5)
self.rbBox3.Bind(wx.EVT_RADIOBOX, self.OnSetting3Change)
@@ -56,12 +58,12 @@ class PFContextMenuPref(PreferenceView):
# Row 2
rbSizerRow2 = wx.BoxSizer(wx.HORIZONTAL)
self.rbBox4 = wx.RadioBox(panel, -1, "Project onto Fit", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
self.rbBox4 = wx.RadioBox(panel, -1, _t("Project onto Fit"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
self.rbBox4.SetSelection(self.settings.get('project'))
rbSizerRow2.Add(self.rbBox4, 1, wx.ALL, 5)
self.rbBox4.Bind(wx.EVT_RADIOBOX, self.OnSetting4Change)
self.rbBox5 = wx.RadioBox(panel, -1, "Fill with module", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
self.rbBox5 = wx.RadioBox(panel, -1, _t("Fill with module"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
self.rbBox5.SetSelection(self.settings.get('moduleFill'))
rbSizerRow2.Add(self.rbBox5, 1, wx.ALL, 5)
self.rbBox5.Bind(wx.EVT_RADIOBOX, self.OnSetting5Change)
@@ -71,12 +73,13 @@ class PFContextMenuPref(PreferenceView):
# Row 3
rbSizerRow3 = wx.BoxSizer(wx.HORIZONTAL)
self.rbBox6 = wx.RadioBox(panel, -1, "Spoolup", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
self.rbBox6 = wx.RadioBox(panel, -1, _t("Spoolup"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
self.rbBox6.SetSelection(self.settings.get('spoolup'))
rbSizerRow3.Add(self.rbBox6, 1, wx.ALL, 5)
self.rbBox6.Bind(wx.EVT_RADIOBOX, self.OnSetting6Change)
self.rbBox7 = wx.RadioBox(panel, -1, "Additions Panel Copy/Paste", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
self.rbBox7 = wx.RadioBox(panel, -1, _t("Additions Panel Copy/Paste"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1,
wx.RA_SPECIFY_COLS)
self.rbBox7.SetSelection(self.settings.get('additionsCopyPaste'))
rbSizerRow3.Add(self.rbBox7, 1, wx.ALL, 5)
self.rbBox7.Bind(wx.EVT_RADIOBOX, self.OnSetting7Change)

View File

@@ -6,11 +6,13 @@ from gui.bitmap_loader import BitmapLoader
from gui.preferenceView import PreferenceView
from gui.utils import helpers_wxPython as wxHelpers
_t = wx.GetTranslation
class PFGeneralPref(PreferenceView):
title = "Database"
def populatePanel(self, panel):
self.title = _t("Database")
self.dirtySettings = False
mainSizer = wx.BoxSizer(wx.VERTICAL)
@@ -20,7 +22,7 @@ class PFGeneralPref(PreferenceView):
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, "(Cannot be changed while pyfa is running. Set via command line switches.)",
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, _t("(Cannot be changed while pyfa is running. Set via command line switches.)"),
wx.DefaultPosition, wx.DefaultSize, 0)
self.stSubTitle.Wrap(-1)
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
@@ -29,11 +31,11 @@ class PFGeneralPref(PreferenceView):
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
# Save in Root
self.cbsaveInRoot = wx.CheckBox(panel, wx.ID_ANY, "Using Executable Path for Saved Fit Database and Settings", wx.DefaultPosition, wx.DefaultSize, 0)
self.cbsaveInRoot = wx.CheckBox(panel, wx.ID_ANY, _t("Using Executable Path for Saved Fit Database and Settings"), wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbsaveInRoot, 0, wx.ALL | wx.EXPAND, 5)
# Database path
self.stSetUserPath = wx.StaticText(panel, wx.ID_ANY, "pyfa User Path:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stSetUserPath = wx.StaticText(panel, wx.ID_ANY, _t("pyfa User Path:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stSetUserPath.Wrap(-1)
mainSizer.Add(self.stSetUserPath, 0, wx.ALL, 5)
self.inputUserPath = wx.TextCtrl(panel, wx.ID_ANY, config.savePath, wx.DefaultPosition, wx.DefaultSize, 0)
@@ -42,7 +44,7 @@ class PFGeneralPref(PreferenceView):
mainSizer.Add(self.inputUserPath, 0, wx.ALL | wx.EXPAND, 5)
# Save DB
self.stFitDB = wx.StaticText(panel, wx.ID_ANY, "Fitting Database:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stFitDB = wx.StaticText(panel, wx.ID_ANY, _t("Fitting Database:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stFitDB.Wrap(-1)
mainSizer.Add(self.stFitDB, 0, wx.ALL, 5)
@@ -52,7 +54,7 @@ class PFGeneralPref(PreferenceView):
mainSizer.Add(self.inputFitDB, 0, wx.ALL | wx.EXPAND, 5)
# Game Data DB
self.stGameDB = wx.StaticText(panel, wx.ID_ANY, "Game Database:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stGameDB = wx.StaticText(panel, wx.ID_ANY, _t("Game Database:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stGameDB.Wrap(-1)
mainSizer.Add(self.stGameDB, 0, wx.ALL, 5)
@@ -74,37 +76,36 @@ class PFGeneralPref(PreferenceView):
btnSizer = wx.BoxSizer(wx.VERTICAL)
btnSizer.AddStretchSpacer()
self.btnDeleteDamagePatterns = wx.Button(panel, wx.ID_ANY, "Delete All Damage Pattern Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
self.btnDeleteDamagePatterns = wx.Button(panel, wx.ID_ANY, _t("Delete All Damage Pattern Profiles"), wx.DefaultPosition, wx.DefaultSize, 0)
btnSizer.Add(self.btnDeleteDamagePatterns, 0, wx.ALL, 5)
self.btnDeleteDamagePatterns.Bind(wx.EVT_BUTTON, self.DeleteDamagePatterns)
self.btnDeleteTargetProfiles = wx.Button(panel, wx.ID_ANY, "Delete All Target Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
self.btnDeleteTargetProfiles = wx.Button(panel, wx.ID_ANY, _t("Delete All Target Profiles"), wx.DefaultPosition, wx.DefaultSize, 0)
btnSizer.Add(self.btnDeleteTargetProfiles, 0, wx.ALL, 5)
self.btnDeleteTargetProfiles.Bind(wx.EVT_BUTTON, self.DeleteTargetProfiles)
self.btnPrices = wx.Button(panel, wx.ID_ANY, "Delete All Prices", wx.DefaultPosition, wx.DefaultSize, 0)
self.btnPrices = wx.Button(panel, wx.ID_ANY, _t("Delete All Prices"), wx.DefaultPosition, wx.DefaultSize, 0)
btnSizer.Add(self.btnPrices, 0, wx.ALL, 5)
self.btnPrices.Bind(wx.EVT_BUTTON, self.DeletePrices)
mainSizer.Add(btnSizer, 0, wx.EXPAND, 5)
panel.SetSizer(mainSizer)
panel.Layout()
def DeleteDamagePatterns(self, event):
question = "This is a destructive action that will delete all damage pattern profiles.\nAre you sure you want to do this?"
if wxHelpers.YesNoDialog(question, "Confirm"):
question = _t("This is a destructive action that will delete all damage pattern profiles.\nAre you sure you want to do this?")
if wxHelpers.YesNoDialog(question, _t("Confirm")):
clearDamagePatterns()
def DeleteTargetProfiles(self, event):
question = "This is a destructive action that will delete all target profiles.\nAre you sure you want to do this?"
if wxHelpers.YesNoDialog(question, "Confirm"):
question = _t("This is a destructive action that will delete all target profiles.\nAre you sure you want to do this?")
if wxHelpers.YesNoDialog(question, _t("Confirm")):
clearTargetProfiles()
def DeletePrices(self, event):
question = "This is a destructive action that will delete all cached prices out of the database.\nAre you sure you want to do this?"
if wxHelpers.YesNoDialog(question, "Confirm"):
question = _t("This is a destructive action that will delete all cached prices out of the database.\nAre you sure you want to do this?")
if wxHelpers.YesNoDialog(question, _t("Confirm")):
clearPrices()
def onCBsaveInRoot(self, event):

View File

@@ -12,10 +12,10 @@ from wx.lib.intctrl import IntCtrl
logger = logging.getLogger(__name__)
_t = wx.GetTranslation
class PFFittingEnginePref(PreferenceView):
title = "Fitting Engine"
def __init__(self):
self.dirtySettings = False
@@ -24,6 +24,7 @@ class PFFittingEnginePref(PreferenceView):
# noinspection PyAttributeOutsideInit
def populatePanel(self, panel):
self.title = _t("Fitting Engine")
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
mainSizer = wx.BoxSizer(wx.VERTICAL)
@@ -40,41 +41,40 @@ class PFFittingEnginePref(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.cbGlobalForceReload = wx.CheckBox(panel, wx.ID_ANY, "Factor in reload time when calculating capacitor usage, damage, and tank.",
self.cbGlobalForceReload = wx.CheckBox(panel, wx.ID_ANY, _t("Factor in reload time when calculating capacitor usage, damage, and tank."),
wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbGlobalForceReload, 0, wx.ALL | wx.EXPAND, 5)
self.cbStrictSkillLevels = wx.CheckBox(panel, wx.ID_ANY,
"Enforce strict skill level requirements",
_t("Enforce strict skill level requirements"),
wx.DefaultPosition, wx.DefaultSize, 0)
self.cbStrictSkillLevels.SetCursor(helpCursor)
self.cbStrictSkillLevels.SetToolTip(wx.ToolTip(
'When enabled, skills will check their dependencies\' requirements when their levels change and reset ' +
'skills that no longer meet the requirement.\neg: Setting Drones from level V to IV will reset the Heavy ' +
'Drone Operation skill, as that requires Drones V'))
_t('When enabled, skills will check their dependencies\' requirements when their levels change and reset '
'skills that no longer meet the requirement.\neg: Setting Drones from level V to IV will reset the Heavy '
'Drone Operation skill, as that requires Drones V')))
mainSizer.Add(self.cbStrictSkillLevels, 0, wx.ALL | wx.EXPAND, 5)
self.cbUniversalAdaptiveArmorHardener = wx.CheckBox(panel, wx.ID_ANY,
"When damage profile is Uniform, set Reactive Armor " +
"Hardener to match (old behavior).",
_t("When damage profile is Uniform, set Reactive Armor "
"Hardener to match (old behavior)."),
wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbUniversalAdaptiveArmorHardener, 0, wx.ALL | wx.EXPAND, 5)
spoolup_sizer = wx.BoxSizer(wx.HORIZONTAL)
self.spool_up_label = wx.StaticText(panel, wx.ID_ANY, "Global Default Spoolup Percentage:", wx.DefaultPosition, wx.DefaultSize, 0)
self.spool_up_label = wx.StaticText(panel, wx.ID_ANY, _t("Global Default Spoolup Percentage:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.spool_up_label.Wrap(-1)
self.spool_up_label.SetCursor(helpCursor)
self.spool_up_label.SetToolTip(
wx.ToolTip('The amount of spoolup to use by default on module which support it. Can be changed on a per-module basis'))
wx.ToolTip(_t('The amount of spoolup to use by default on module which support it. Can be changed on a per-module basis')))
spoolup_sizer.Add(self.spool_up_label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.spoolup_value = IntCtrl(panel, min=0, max=100, limited=True)
spoolup_sizer.Add(self.spoolup_value , 0, wx.ALL, 5)
spoolup_sizer.Add(self.spoolup_value, 0, wx.ALL, 5)
mainSizer.Add(spoolup_sizer, 0, wx.ALL | wx.EXPAND, 0)

View File

@@ -6,15 +6,14 @@ from gui.bitmap_loader import BitmapLoader
from gui.preferenceView import PreferenceView
from service.settings import EsiSettings
# noinspection PyPackageRequirements
_t = wx.GetTranslation
class PFEsiPref(PreferenceView):
title = "EVE SSO"
def populatePanel(self, panel):
self.title = _t("EVE SSO")
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.settings = EsiSettings.getInstance()
self.dirtySettings = False
@@ -30,25 +29,25 @@ class PFEsiPref(PreferenceView):
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
self.stInfo = wx.StaticText(panel, wx.ID_ANY,
"Please see the pyfa wiki on GitHub for information regarding these options.",
_t("Please see the pyfa wiki on GitHub for information regarding these options."),
wx.DefaultPosition, wx.DefaultSize, 0)
self.stInfo.Wrap(dlgWidth - 50)
mainSizer.Add(self.stInfo, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
rbSizer = wx.BoxSizer(wx.HORIZONTAL)
self.rbMode = wx.RadioBox(panel, -1, "Login Authentication Method", wx.DefaultPosition, wx.DefaultSize,
['Local Server', 'Manual'], 1, wx.RA_SPECIFY_COLS)
self.rbMode.SetItemToolTip(0, "This options starts a local webserver that the web application will call back to"
" with information about the character login.")
self.rbMode.SetItemToolTip(1, "This option prompts users to copy and paste information from the web application "
"to allow for character login. Use this if having issues with the local server.")
self.rbMode = wx.RadioBox(panel, -1, _t("Login Authentication Method"), wx.DefaultPosition, wx.DefaultSize,
[_t('Local Server'), _t('Manual')], 1, wx.RA_SPECIFY_COLS)
self.rbMode.SetItemToolTip(0, _t("This options starts a local webserver that the web application will call back to"
" with information about the character login."))
self.rbMode.SetItemToolTip(1, _t("This option prompts users to copy and paste information from the web application "
"to allow for character login. Use this if having issues with the local server."))
self.rbSsoMode = wx.RadioBox(panel, -1, "SSO Mode", wx.DefaultPosition, wx.DefaultSize,
['pyfa.io', 'Custom application'], 1, wx.RA_SPECIFY_COLS)
self.rbSsoMode.SetItemToolTip(0, "This options routes SSO Logins through pyfa.io, allowing you to easily login "
"without any configuration. When in doubt, use this option.")
self.rbSsoMode.SetItemToolTip(1, "This option goes through EVE SSO directly, but requires more configuration. Use "
"this is pyfa.io is blocked for some reason, or if you do not wish to route data throguh pyfa.io.")
self.rbSsoMode = wx.RadioBox(panel, -1, _t("SSO Mode"), wx.DefaultPosition, wx.DefaultSize,
[_t('pyfa.io'), _t('Custom application')], 1, wx.RA_SPECIFY_COLS)
self.rbSsoMode.SetItemToolTip(0, _t("This options routes SSO Logins through pyfa.io, allowing you to easily login "
"without any configuration. When in doubt, use this option."))
self.rbSsoMode.SetItemToolTip(1, _t("This option goes through EVE SSO directly, but requires more configuration. Use "
"this is pyfa.io is blocked for some reason, or if you do not wish to route data throguh pyfa.io."))
self.rbMode.SetSelection(self.settings.get('loginMode'))
self.rbSsoMode.SetSelection(self.settings.get('ssoMode'))
@@ -61,7 +60,7 @@ class PFEsiPref(PreferenceView):
mainSizer.Add(rbSizer, 1, wx.ALL | wx.EXPAND, 0)
detailsTitle = wx.StaticText(panel, wx.ID_ANY, "Custom Application", wx.DefaultPosition, wx.DefaultSize, 0)
detailsTitle = wx.StaticText(panel, wx.ID_ANY, _t("Custom Application"), wx.DefaultPosition, wx.DefaultSize, 0)
detailsTitle.Wrap(-1)
detailsTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
@@ -74,7 +73,7 @@ class PFEsiPref(PreferenceView):
fgAddrSizer.SetFlexibleDirection(wx.BOTH)
fgAddrSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)
self.stSetID = wx.StaticText(panel, wx.ID_ANY, "Client ID:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stSetID = wx.StaticText(panel, wx.ID_ANY, _t("Client ID:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stSetID.Wrap(-1)
fgAddrSizer.Add(self.stSetID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
@@ -83,7 +82,7 @@ class PFEsiPref(PreferenceView):
fgAddrSizer.Add(self.inputClientID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
self.stSetSecret = wx.StaticText(panel, wx.ID_ANY, "Client Secret:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stSetSecret = wx.StaticText(panel, wx.ID_ANY, _t("Client Secret:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stSetSecret.Wrap(-1)
fgAddrSizer.Add(self.stSetSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

View File

@@ -8,12 +8,13 @@ from gui.preferenceView import PreferenceView
from service.fit import Fit
from service.settings import SettingsProvider, LocaleSettings
_t = wx.GetTranslation
class PFGeneralPref(PreferenceView):
title = "General"
def populatePanel(self, panel):
self.title = _t("General")
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.dirtySettings = False
self.openFitsSettings = SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits",
@@ -31,68 +32,68 @@ class PFGeneralPref(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.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, "Use global character", wx.DefaultPosition, wx.DefaultSize,
self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, _t("Use global character"), wx.DefaultPosition, wx.DefaultSize,
0)
mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)
self.cbDefaultCharImplants = wx.CheckBox(panel, wx.ID_ANY, "Use character implants by default for new fits",
self.cbDefaultCharImplants = wx.CheckBox(panel, wx.ID_ANY, _t("Use character implants by default for new fits"),
wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbDefaultCharImplants, 0, wx.ALL | wx.EXPAND, 5)
self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, "Use global damage pattern", wx.DefaultPosition,
self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, _t("Use global damage pattern"), wx.DefaultPosition,
wx.DefaultSize, 0)
mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)
self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, "Compact skills needed tooltip", wx.DefaultPosition,
self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, _t("Compact skills needed tooltip"), wx.DefaultPosition,
wx.DefaultSize, 0)
mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)
self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, "Color fitting view by slot", wx.DefaultPosition,
self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, _t("Color fitting view by slot"), wx.DefaultPosition,
wx.DefaultSize, 0)
mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)
self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, "Reopen previous fits on startup", wx.DefaultPosition,
self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, _t("Reopen previous fits on startup"), wx.DefaultPosition,
wx.DefaultSize, 0)
mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)
self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, "Separate Racks", wx.DefaultPosition, wx.DefaultSize, 0)
self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, _t("Separate Racks"), wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)
labelSizer = wx.BoxSizer(wx.VERTICAL)
self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, "Show Rack Labels", wx.DefaultPosition, wx.DefaultSize, 0)
self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, _t("Show Rack Labels"), wx.DefaultPosition, wx.DefaultSize, 0)
labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)
self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show fitting tab tooltips", wx.DefaultPosition, wx.DefaultSize, 0)
self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, _t("Show fitting tab tooltips"), wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)
self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, "Animate gauges", wx.DefaultPosition, wx.DefaultSize, 0)
self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, _t("Animate gauges"), wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)
self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, "Open fittings in a new page by default",
self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, _t("Open fittings in a new page by default"),
wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)
self.cbShowShipBrowserTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show ship browser tooltip",
wx.DefaultPosition, wx.DefaultSize, 0)
self.cbShowShipBrowserTooltip = wx.CheckBox(panel, wx.ID_ANY, _t("Show ship browser tooltip"),
wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbShowShipBrowserTooltip, 0, wx.ALL | wx.EXPAND, 5)
self.cbReloadAll = wx.CheckBox(panel, wx.ID_ANY, "Change charge in all modules of the same type",
self.cbReloadAll = wx.CheckBox(panel, wx.ID_ANY, _t("Change charge in all modules of the same type"),
wx.DefaultPosition, wx.DefaultSize, 0)
if "wxGTK" not in wx.PlatformInfo:
self.cbReloadAll.SetCursor(helpCursor)
self.cbReloadAll.SetToolTip(wx.ToolTip(
'When disabled, reloads charges just in selected modules. Action can be reversed by holding Ctrl or Alt key while changing charge.'))
_t('When disabled, reloads charges just in selected modules. Action can be reversed by holding Ctrl or Alt key while changing charge.')))
mainSizer.Add(self.cbReloadAll, 0, wx.ALL | wx.EXPAND, 5)
self.rbAddLabels = wx.RadioBox(panel, -1, "Extra info in Additions panel tab names", wx.DefaultPosition, wx.DefaultSize, ["None", "Quantity of active items", "Quantity of all items"], 1, wx.RA_SPECIFY_COLS)
self.rbAddLabels = wx.RadioBox(panel, -1, _t("Extra info in Additions panel tab names"), wx.DefaultPosition, wx.DefaultSize,
[_t("None"), _t("Quantity of active items"), _t("Quantity of all items")], 1, wx.RA_SPECIFY_COLS)
mainSizer.Add(self.rbAddLabels, 0, wx.EXPAND | wx.TOP | wx.RIGHT | wx.BOTTOM, 10)
self.rbAddLabels.Bind(wx.EVT_RADIOBOX, self.OnAddLabelsChange)
langSizer = wx.BoxSizer(wx.HORIZONTAL)
self.stLangLabel = wx.StaticText(panel, wx.ID_ANY, "Language (restart required): ", wx.DefaultPosition, wx.DefaultSize, 0)
self.stLangLabel = wx.StaticText(panel, wx.ID_ANY, _t("Language (restart required):"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stLangLabel.Wrap(-1)
langSizer.Add(self.stLangLabel, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

View File

@@ -10,16 +10,18 @@ import gui.mainFrame
from service.settings import HTMLExportSettings
import wx.lib.agw.hyperlink
_t = wx.GetTranslation
class PFHTMLExportPref(PreferenceView):
title = "HTML Export"
desc = ("HTML Export (File > Export HTML) allows you to export your entire fitting "
"database into an HTML file at the specified location. This file can be "
"used to easily open your fits in a web-based fitting program")
desc4 = ("Export Fittings in a minimal HTML Version, just containing the fittings links "
"without any visual styling")
def populatePanel(self, panel):
self.title = _t("HTML Export")
self.desc = _t("HTML Export (File > Export HTML) allows you to export your entire fitting "
"database into an HTML file at the specified location. This file can be "
"used to easily open your fits in a web-based fitting program")
self.desc4 = _t("Export Fittings in a minimal HTML Version, just containing the fittings links "
"without any visual styling")
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.HTMLExportSettings = HTMLExportSettings.getInstance()
self.dirtySettings = False
@@ -39,16 +41,16 @@ class PFHTMLExportPref(PreferenceView):
mainSizer.Add(self.stDesc, 0, wx.ALL, 5)
self.PathLinkCtrl = wx.lib.agw.hyperlink.HyperLinkCtrl(panel, wx.ID_ANY, self.HTMLExportSettings.getPath(),
wx.DefaultPosition, wx.DefaultSize,
URL='file:///{}'.format(self.HTMLExportSettings.getPath()),)
wx.DefaultPosition, wx.DefaultSize,
URL='file:///{}'.format(self.HTMLExportSettings.getPath()), )
mainSizer.Add(self.PathLinkCtrl, 0, wx.ALL | wx.EXPAND, 5)
self.fileSelectDialog = wx.FileDialog(None, "Save Fitting As...",
wildcard="EVE IGB HTML fitting file (*.html)|*.html", style=wx.FD_SAVE)
self.fileSelectDialog = wx.FileDialog(None, _t("Save Fitting As..."),
wildcard=_t("EVE IGB HTML fitting file") + " (*.html)|*.html", style=wx.FD_SAVE)
self.fileSelectDialog.SetPath(self.HTMLExportSettings.getPath())
self.fileSelectDialog.SetFilename(os.path.basename(self.HTMLExportSettings.getPath()))
self.fileSelectButton = wx.Button(panel, -1, "Set export destination", pos=(0, 0))
self.fileSelectButton = wx.Button(panel, -1, _t("Set export destination"), pos=(0, 0))
self.fileSelectButton.Bind(wx.EVT_BUTTON, self.selectHTMLExportFilePath)
mainSizer.Add(self.fileSelectButton, 0, wx.ALL, 5)
@@ -56,7 +58,7 @@ class PFHTMLExportPref(PreferenceView):
self.stDesc4.Wrap(dlgWidth - 50)
mainSizer.Add(self.stDesc4, 0, wx.ALL, 5)
self.exportMinimal = wx.CheckBox(panel, wx.ID_ANY, "Enable minimal format", wx.DefaultPosition,
self.exportMinimal = wx.CheckBox(panel, wx.ID_ANY, _t("Enable minimal format"), wx.DefaultPosition,
wx.DefaultSize, 0)
self.exportMinimal.SetValue(self.HTMLExportSettings.getMinimalEnabled())
self.exportMinimal.Bind(wx.EVT_CHECKBOX, self.OnMinimalEnabledChange)

View File

@@ -6,6 +6,7 @@ import config
from logbook import Logger
pyfalog = Logger(__name__)
_t = wx.GetTranslation
def OnDumpLogs(event):
@@ -13,9 +14,9 @@ def OnDumpLogs(event):
class PFGeneralPref(PreferenceView):
title = "Logging"
def populatePanel(self, panel):
self.title = _t("Logging")
self.dirtySettings = False
mainSizer = wx.BoxSizer(wx.VERTICAL)
@@ -25,7 +26,7 @@ class PFGeneralPref(PreferenceView):
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, "(Cannot be changed while pyfa is running. Set via command line switches.)",
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, _t("(Cannot be changed while pyfa is running. Set via command line switches.)"),
wx.DefaultPosition, wx.DefaultSize, 0)
self.stSubTitle.Wrap(-1)
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
@@ -34,7 +35,7 @@ class PFGeneralPref(PreferenceView):
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
# Database path
self.stLogPath = wx.StaticText(panel, wx.ID_ANY, "Log file location:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stLogPath = wx.StaticText(panel, wx.ID_ANY, _t("Log file location:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stLogPath.Wrap(-1)
mainSizer.Add(self.stLogPath, 0, wx.ALL, 5)
self.inputLogPath = wx.TextCtrl(panel, wx.ID_ANY, config.logPath, wx.DefaultPosition, wx.DefaultSize, 0)
@@ -43,8 +44,8 @@ class PFGeneralPref(PreferenceView):
mainSizer.Add(self.inputLogPath, 0, wx.ALL | wx.EXPAND, 5)
import requests
self.certPath = wx.StaticText(panel, wx.ID_ANY, "Cert Path:", wx.DefaultPosition, wx.DefaultSize, 0)
self.certPath .Wrap(-1)
self.certPath = wx.StaticText(panel, wx.ID_ANY, _t("Cert Path:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.certPath.Wrap(-1)
mainSizer.Add(self.certPath, 0, wx.ALL, 5)
self.certPathCtrl = wx.TextCtrl(panel, wx.ID_ANY, requests.certs.where(), wx.DefaultPosition, wx.DefaultSize, 0)
self.certPathCtrl.SetEditable(False)
@@ -52,13 +53,13 @@ class PFGeneralPref(PreferenceView):
mainSizer.Add(self.certPathCtrl, 0, wx.ALL | wx.EXPAND, 5)
# Debug Logging
self.cbdebugLogging = wx.CheckBox(panel, wx.ID_ANY, "Debug Logging Enabled", wx.DefaultPosition, wx.DefaultSize, 0)
self.cbdebugLogging = wx.CheckBox(panel, wx.ID_ANY, _t("Debug Logging Enabled"), wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbdebugLogging, 0, wx.ALL | wx.EXPAND, 5)
self.stDumpLogs = wx.StaticText(panel, wx.ID_ANY, "Pressing this button will cause all logs in memory to write to the log file:",
self.stDumpLogs = wx.StaticText(panel, wx.ID_ANY, _t("Pressing this button will cause all logs in memory to write to the log file:"),
wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.stDumpLogs, 0, wx.ALL, 5)
self.btnDumpLogs = wx.Button(panel, wx.ID_ANY, "Dump All Logs", wx.DefaultPosition, wx.DefaultSize, 0)
self.btnDumpLogs = wx.Button(panel, wx.ID_ANY, _t("Dump All Logs"), wx.DefaultPosition, wx.DefaultSize, 0)
self.btnDumpLogs.Bind(wx.EVT_BUTTON, OnDumpLogs)
mainSizer.Add(self.btnDumpLogs, 0, wx.ALIGN_LEFT, 5)

View File

@@ -11,21 +11,23 @@ from service.settings import MarketPriceSettings
from service.fit import Fit
from service.price import Price
_t = wx.GetTranslation
class PFMarketPref(PreferenceView):
title = "Market & Prices"
def __init__(self):
self.priceSettings = MarketPriceSettings.getInstance()
def populatePanel(self, panel):
self.title = _t("Market & Prices")
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.sFit = Fit.getInstance()
helpCursor = wx.Cursor(wx.CURSOR_QUESTION_ARROW)
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.stTitle = wx.StaticText(panel, wx.ID_ANY, "Market && Prices", wx.DefaultPosition, wx.DefaultSize, 0)
self.stTitle = wx.StaticText(panel, wx.ID_ANY, _t("Market && Prices"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stTitle.Wrap(-1)
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)
@@ -34,11 +36,12 @@ class PFMarketPref(PreferenceView):
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
delayTimer = wx.BoxSizer(wx.HORIZONTAL)
self.stMarketDelay = wx.StaticText(panel, wx.ID_ANY, "Market Search Delay (ms):", wx.DefaultPosition, wx.DefaultSize, 0)
self.stMarketDelay = wx.StaticText(panel, wx.ID_ANY, _t("Market Search Delay (ms):"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stMarketDelay.Wrap(-1)
if "wxGTK" not in wx.PlatformInfo:
self.stMarketDelay.SetCursor(helpCursor)
self.stMarketDelay.SetToolTip(wx.ToolTip('The delay between a keystroke and the market search. Can help reduce lag when typing fast in the market search box.'))
self.stMarketDelay.SetToolTip(wx.ToolTip(
_t('The delay between a keystroke and the market search. Can help reduce lag when typing fast in the market search box.')))
delayTimer.Add(self.stMarketDelay, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.intDelay = IntCtrl(panel, max=1000, limited=True)
delayTimer.Add(self.intDelay, 0, wx.ALL, 5)
@@ -46,20 +49,20 @@ class PFMarketPref(PreferenceView):
self.intDelay.SetValue(self.sFit.serviceFittingOptions["marketSearchDelay"])
self.intDelay.Bind(wx.lib.intctrl.EVT_INT, self.onMarketDelayChange)
self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY, "Show market shortcuts", wx.DefaultPosition, wx.DefaultSize, 0)
self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY, _t("Show market shortcuts"), wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbMarketShortcuts, 0, wx.EXPAND | wx.TOP | wx.RIGHT, 10)
self.cbMarketShortcuts.SetValue(self.sFit.serviceFittingOptions["showMarketShortcuts"] or False)
self.cbMarketShortcuts.Bind(wx.EVT_CHECKBOX, self.onCBShowShortcuts)
priceSizer = wx.BoxSizer(wx.HORIZONTAL)
self.stDefaultSystem = wx.StaticText(panel, wx.ID_ANY, "Default Market Prices:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stDefaultSystem = wx.StaticText(panel, wx.ID_ANY, _t("Default Market Prices:"), wx.DefaultPosition, wx.DefaultSize, 0)
self.stDefaultSystem.Wrap(-1)
priceSizer.Add(self.stDefaultSystem, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
if "wxGTK" not in wx.PlatformInfo:
self.stDefaultSystem.SetCursor(helpCursor)
self.stDefaultSystem.SetToolTip(wx.ToolTip(
'The source you choose will be tried first, but subsequent sources will be used if the preferred source fails. '
'The system you choose will also be tried first, and if no data is available, global price will be used.'))
_t('The source you choose will be tried first, but subsequent sources will be used if the preferred source fails. '
'The system you choose will also be tried first, and if no data is available, global price will be used.')))
self.chPriceSource = wx.Choice(panel, choices=sorted(Price.sources.keys()))
self.chPriceSystem = wx.Choice(panel, choices=list(Price.systemsList.keys()))
priceSizer.Add(self.chPriceSource, 1, wx.ALL | wx.EXPAND, 5)
@@ -70,37 +73,45 @@ class PFMarketPref(PreferenceView):
self.chPriceSystem.SetStringSelection(self.sFit.serviceFittingOptions["priceSystem"])
self.chPriceSystem.Bind(wx.EVT_CHOICE, self.onPriceSelection)
self.tbTotalPriceBox = wx.StaticBoxSizer(wx.VERTICAL, panel, "Total Price Includes")
self.tbTotalPriceDrones = wx.CheckBox(panel, -1, "Drones", wx.DefaultPosition, wx.DefaultSize, 1)
self.tbTotalPriceBox = wx.StaticBoxSizer(wx.VERTICAL, panel, _t("Total Price Includes"))
self.tbTotalPriceDrones = wx.CheckBox(panel, -1, _t("Drones"), wx.DefaultPosition, wx.DefaultSize, 1)
self.tbTotalPriceDrones.SetValue(self.priceSettings.get("drones"))
self.tbTotalPriceDrones.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceDroneChange)
self.tbTotalPriceBox.Add(self.tbTotalPriceDrones, 0, wx.LEFT | wx.RIGHT | wx.TOP, 5)
self.tbTotalPriceCargo = wx.CheckBox(panel, -1, "Cargo", wx.DefaultPosition, wx.DefaultSize, 1)
self.tbTotalPriceCargo = wx.CheckBox(panel, -1, _t("Cargo"), wx.DefaultPosition, wx.DefaultSize, 1)
self.tbTotalPriceCargo.SetValue(self.priceSettings.get("cargo"))
self.tbTotalPriceCargo.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceCargoChange)
self.tbTotalPriceBox.Add(self.tbTotalPriceCargo, 0, wx.LEFT | wx.RIGHT, 5)
self.tbTotalPriceCharacter = wx.CheckBox(panel, -1, "Implants && Boosters", wx.DefaultPosition, wx.DefaultSize, 1)
self.tbTotalPriceCharacter = wx.CheckBox(panel, -1, _t("Implants && Boosters"), wx.DefaultPosition, wx.DefaultSize, 1)
self.tbTotalPriceCharacter.SetValue(self.priceSettings.get("character"))
self.tbTotalPriceCharacter.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceCharacterChange)
self.tbTotalPriceBox.Add(self.tbTotalPriceCharacter, 0, wx.LEFT | wx.RIGHT | wx.BOTTOM, 5)
mainSizer.Add(self.tbTotalPriceBox, 0, wx.EXPAND | wx.TOP | wx.RIGHT, 10)
self.rbMarketSearch = wx.RadioBox(panel, -1, "Market Search && Recent Items", wx.DefaultPosition, wx.DefaultSize, ["No changes to meta buttons", "Enable all meta buttons for a duration of search / recents", "Enable all meta buttons"], 1, wx.RA_SPECIFY_COLS)
self.rbMarketSearch = wx.RadioBox(panel, -1, _t("Market Search && Recent Items"), wx.DefaultPosition, wx.DefaultSize,
[_t("No changes to meta buttons"), _t("Enable all meta buttons for a duration of search / recents"),
_t("Enable all meta buttons")], 1,
wx.RA_SPECIFY_COLS)
self.rbMarketSearch.SetSelection(self.priceSettings.get('marketMGSearchMode'))
mainSizer.Add(self.rbMarketSearch, 0, wx.RIGHT | wx.TOP | wx.EXPAND, 10)
self.rbMarketSearch.Bind(wx.EVT_RADIOBOX, self.OnMarketSearchChange)
self.rbMarketEmpty = wx.RadioBox(panel, -1, "Market Group Selection", wx.DefaultPosition, wx.DefaultSize, ["No changes to meta buttons", "Enable all meta buttons"], 1, wx.RA_SPECIFY_COLS)
self.rbMarketEmpty = wx.RadioBox(panel, -1, _t("Market Group Selection"), wx.DefaultPosition, wx.DefaultSize,
[_t("No changes to meta buttons"), _t("Enable all meta buttons")], 1, wx.RA_SPECIFY_COLS)
self.rbMarketEmpty.SetSelection(self.priceSettings.get('marketMGMarketSelectMode'))
mainSizer.Add(self.rbMarketEmpty, 0, wx.EXPAND | wx.TOP | wx.RIGHT, 10)
self.rbMarketEmpty.Bind(wx.EVT_RADIOBOX, self.OnMarketGroupSelectionChange)
self.rbMarketEmpty = wx.RadioBox(panel, -1, "Empty Market View", wx.DefaultPosition, wx.DefaultSize, ["No changes to meta buttons", "Enable leftmost available meta button", "Enable all available meta buttons"], 1, wx.RA_SPECIFY_COLS)
self.rbMarketEmpty = wx.RadioBox(panel, -1, _t("Empty Market View"), wx.DefaultPosition, wx.DefaultSize,
[_t("No changes to meta buttons"), _t("Enable leftmost available meta button"), _t("Enable all available meta buttons")], 1,
wx.RA_SPECIFY_COLS)
self.rbMarketEmpty.SetSelection(self.priceSettings.get('marketMGEmptyMode'))
mainSizer.Add(self.rbMarketEmpty, 0, wx.EXPAND | wx.TOP | wx.RIGHT, 10)
self.rbMarketEmpty.Bind(wx.EVT_RADIOBOX, self.OnMarketEmptyChange)
self.rbMarketJump = wx.RadioBox(panel, -1, "Item Market Group Jump", wx.DefaultPosition, wx.DefaultSize, ["No changes to meta buttons", "Enable item's meta button", "Enable item's meta button, disable others", "Enable all meta buttons"], 1, wx.RA_SPECIFY_COLS)
self.rbMarketJump = wx.RadioBox(panel, -1, _t("Item Market Group Jump"), wx.DefaultPosition, wx.DefaultSize,
[_t("No changes to meta buttons"), _t("Enable item's meta button"), _t("Enable item's meta button, disable others"),
_t("Enable all meta buttons")], 1, wx.RA_SPECIFY_COLS)
self.rbMarketJump.SetSelection(self.priceSettings.get('marketMGJumpMode'))
mainSizer.Add(self.rbMarketJump, 0, wx.EXPAND | wx.TOP | wx.RIGHT | wx.BOTTOM, 10)
self.rbMarketJump.Bind(wx.EVT_RADIOBOX, self.OnMarketJumpChange)

View File

@@ -8,12 +8,13 @@ import gui.mainFrame
from service.settings import NetworkSettings
from service.network import Network
_t = wx.GetTranslation
class PFNetworkPref(PreferenceView):
title = "Network"
def populatePanel(self, panel):
self.title = _t("Network")
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.settings = NetworkSettings.getInstance()
self.network = Network.getInstance()
@@ -29,23 +30,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 +80,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 +98,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 +106,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 +118,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 +133,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 +155,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)

View File

@@ -5,9 +5,10 @@ from gui.preferenceView import PreferenceView
from gui.bitmap_loader import BitmapLoader
from service.settings import StatViewSettings
_t = wx.GetTranslation
class PFStatViewPref(PreferenceView):
title = "Statistics Panel"
def __init__(self):
self.dirtySettings = False
@@ -18,6 +19,7 @@ class PFStatViewPref(PreferenceView):
# noinspection PyAttributeOutsideInit
def populatePanel(self, panel):
self.title = _t("Statistics Panel")
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
@@ -26,7 +28,7 @@ class PFStatViewPref(PreferenceView):
mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY,
"Changes require restart of pyfa to take effect.",
_t("Changes require restart of pyfa to take effect."),
wx.DefaultPosition, wx.DefaultSize, 0)
self.stSubTitle.Wrap(-1)
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
@@ -37,21 +39,24 @@ class PFStatViewPref(PreferenceView):
rbSizerRow1 = wx.BoxSizer(wx.HORIZONTAL)
self.rbResources = wx.RadioBox(panel, -1, "Resources", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
self.rbResources = wx.RadioBox(panel, -1, _t("Resources"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1,
wx.RA_SPECIFY_COLS)
# Disable minimal as we don't have a view for this yet
self.rbResources.EnableItem(1, False)
self.rbResources.SetSelection(self.settings.get('resources'))
rbSizerRow1.Add(self.rbResources, 1, wx.TOP | wx.RIGHT, 5)
self.rbResources.Bind(wx.EVT_RADIOBOX, self.OnResourcesChange)
self.rbResistances = wx.RadioBox(panel, -1, "Resistances", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
self.rbResistances = wx.RadioBox(panel, -1, _t("Resistances"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1,
wx.RA_SPECIFY_COLS)
# Disable minimal as we don't have a view for this yet
self.rbResistances.EnableItem(1, False)
self.rbResistances.SetSelection(self.settings.get('resistances'))
rbSizerRow1.Add(self.rbResistances, 1, wx.ALL, 5)
self.rbResistances.Bind(wx.EVT_RADIOBOX, self.OnResistancesChange)
self.rbRecharge = wx.RadioBox(panel, -1, "Shield/Armor Tank", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
self.rbRecharge = wx.RadioBox(panel, -1, _t("Shield/Armor Tank"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1,
wx.RA_SPECIFY_COLS)
# Disable minimal as we don't have a view for this yet
self.rbRecharge.EnableItem(1, False)
self.rbRecharge.SetSelection(self.settings.get('recharge'))
@@ -63,21 +68,23 @@ class PFStatViewPref(PreferenceView):
# Row 2
rbSizerRow2 = wx.BoxSizer(wx.HORIZONTAL)
self.rbFirepower = wx.RadioBox(panel, -1, "Firepower", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
self.rbFirepower = wx.RadioBox(panel, -1, _t("Firepower"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1,
wx.RA_SPECIFY_COLS)
# Disable minimal as we don't have a view for this yet
self.rbFirepower.EnableItem(1, False)
self.rbFirepower.SetSelection(self.settings.get('firepower'))
rbSizerRow2.Add(self.rbFirepower, 1, wx.TOP | wx.RIGHT, 5)
self.rbFirepower.Bind(wx.EVT_RADIOBOX, self.OnFirepowerChange)
self.rbCapacitor = wx.RadioBox(panel, -1, "Capacitor", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
self.rbCapacitor = wx.RadioBox(panel, -1, _t("Capacitor"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1,
wx.RA_SPECIFY_COLS)
# Disable minimal as we don't have a view for this yet
self.rbCapacitor.EnableItem(1, False)
self.rbCapacitor.SetSelection(self.settings.get('capacitor'))
rbSizerRow2.Add(self.rbCapacitor, 1, wx.ALL, 5)
self.rbCapacitor.Bind(wx.EVT_RADIOBOX, self.OnCapacitorChange)
self.rbMisc = wx.RadioBox(panel, -1, "Misc", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
self.rbMisc = wx.RadioBox(panel, -1, _t("Misc"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1, wx.RA_SPECIFY_COLS)
# Disable full as we don't have a view for this yet
self.rbMisc.EnableItem(2, False)
self.rbMisc.SetSelection(self.settings.get('targetingMisc'))
@@ -89,12 +96,12 @@ class PFStatViewPref(PreferenceView):
# Row 3
rbSizerRow3 = wx.BoxSizer(wx.HORIZONTAL)
self.rbPrice = wx.RadioBox(panel, -1, "Price", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
self.rbPrice = wx.RadioBox(panel, -1, _t("Price"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1, wx.RA_SPECIFY_COLS)
self.rbPrice.SetSelection(self.settings.get('price'))
rbSizerRow3.Add(self.rbPrice, 1, wx.TOP | wx.RIGHT, 5)
self.rbPrice.Bind(wx.EVT_RADIOBOX, self.OnPriceChange)
self.rbOutgoing = wx.RadioBox(panel, -1, "Remote Reps", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
self.rbOutgoing = wx.RadioBox(panel, -1, _t("Remote Reps"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1, wx.RA_SPECIFY_COLS)
self.rbOutgoing.SetSelection(self.settings.get('outgoing'))
rbSizerRow3.Add(self.rbOutgoing, 1, wx.TOP | wx.RIGHT, 5)
self.rbOutgoing.Bind(wx.EVT_RADIOBOX, self.OnOutgoingChange)

View File

@@ -5,15 +5,17 @@ from gui.preferenceView import PreferenceView
from gui.bitmap_loader import BitmapLoader
from service.settings import UpdateSettings
_t = wx.GetTranslation
class PFUpdatePref(PreferenceView):
title = "Updates"
desc = ("Pyfa can automatically check and notify you of new releases. "
"This feature is toggled in the Network settings. "
"Here, you may allow pre-release notifications and view "
"suppressed release notifications, if any.")
def populatePanel(self, panel):
self.title = _t("Updates")
self.desc = _t("Pyfa can automatically check and notify you of new releases. "
"This feature is toggled in the Network settings. "
"Here, you may allow pre-release notifications and view "
"suppressed release notifications, if any.")
self.UpdateSettings = UpdateSettings.getInstance()
self.dirtySettings = False
@@ -33,7 +35,7 @@ class PFUpdatePref(PreferenceView):
self.stDesc.Wrap(dlgWidth - 50)
mainSizer.Add(self.stDesc, 0, wx.ALL, 5)
self.suppressPrerelease = wx.CheckBox(panel, wx.ID_ANY, "Allow pre-release notifications", wx.DefaultPosition,
self.suppressPrerelease = wx.CheckBox(panel, wx.ID_ANY, _t("Allow pre-release notifications"), wx.DefaultPosition,
wx.DefaultSize, 0)
self.suppressPrerelease.Bind(wx.EVT_CHECKBOX, self.OnPrereleaseStateChange)
self.suppressPrerelease.SetValue(not self.UpdateSettings.get('prerelease'))
@@ -43,14 +45,14 @@ class PFUpdatePref(PreferenceView):
if self.UpdateSettings.get('version'):
self.versionSizer = wx.BoxSizer(wx.VERTICAL)
self.versionTitle = wx.StaticText(panel, wx.ID_ANY, "Suppressing {0} Notifications".format(
self.versionTitle = wx.StaticText(panel, wx.ID_ANY, _t("Suppressing {0} Notifications").format(
self.UpdateSettings.get('version')), wx.DefaultPosition, wx.DefaultSize, 0)
self.versionTitle.Wrap(-1)
self.versionTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
self.versionInfo = ("There is a release available which you have chosen to suppress. "
"You can choose to reset notification suppression for this release, "
"or download the new release from GitHub.")
self.versionInfo = _t("There is a release available which you have chosen to suppress. "
"You can choose to reset notification suppression for this release, "
"or download the new release from GitHub.")
self.versionSizer.AddStretchSpacer()
@@ -66,12 +68,12 @@ class PFUpdatePref(PreferenceView):
actionSizer = wx.BoxSizer(wx.HORIZONTAL)
resetSizer = wx.BoxSizer(wx.VERTICAL)
self.downloadButton = wx.Button(panel, wx.ID_ANY, "Download", wx.DefaultPosition, wx.DefaultSize, 0)
self.downloadButton = wx.Button(panel, wx.ID_ANY, _t("Download"), wx.DefaultPosition, wx.DefaultSize, 0)
self.downloadButton.Bind(wx.EVT_BUTTON, self.OnDownload)
resetSizer.Add(self.downloadButton, 0, wx.ALL, 5)
actionSizer.Add(resetSizer, 1, wx.EXPAND, 5)
self.resetButton = wx.Button(panel, wx.ID_ANY, "Reset Suppression", wx.DefaultPosition, wx.DefaultSize, 0)
self.resetButton = wx.Button(panel, wx.ID_ANY, _t("Reset Suppression"), wx.DefaultPosition, wx.DefaultSize, 0)
self.resetButton.Bind(wx.EVT_BUTTON, self.ResetSuppression)
actionSizer.Add(self.resetButton, 0, wx.ALL, 5)
self.versionSizer.Add(actionSizer, 0, wx.EXPAND, 5)

View File

@@ -126,14 +126,14 @@ class NavigationPanel(SFItem.SFBrowserItem):
if not toggle:
self.shipBrowser.recentFits = False
self.btnRecent.label = "Recent Fits"
self.btnRecent.label = _t("Recent Fits")
self.btnRecent.normalBmp = self.recentBmpD
if emitEvent:
wx.PostEvent(self.shipBrowser, Stage1Selected())
else:
self.shipBrowser.recentFits = True
self.btnRecent.label = "Hide Recent Fits"
self.btnRecent.label = _t("Hide Recent Fits")
self.btnRecent.normalBmp = self.recentBmp
if emitEvent:

View File

@@ -15,7 +15,7 @@ from service.market import Market
from .events import FitSelected, Stage3Selected
pyfalog = Logger(__name__)
_t = wx.GetTranslation
class ShipItem(SFItem.SFBrowserItem):
@@ -108,7 +108,7 @@ class ShipItem(SFItem.SFBrowserItem):
def OnShowPopup(self, event):
pos = event.GetPosition()
pos = self.ScreenToClient(pos)
contexts = [("baseShip", "Ship Basic")]
contexts = [("baseShip", _t("Ship Basic"))]
menu = ContextMenu.getMenu(self, self.baseItem, (self.baseItem,), *contexts)
self.PopupMenu(menu, pos)

View File

@@ -64,7 +64,7 @@ class FirepowerViewFull(StatsView):
counter = 0
for damageType, image in (("weapon", "turret"), ("drone", "droneDPS")):
for label, image, attr in ((_t("Weapon"), "turret", "Weapon"), (_t("Drone"), "droneDPS", "Drone")):
baseBox = wx.BoxSizer(wx.HORIZONTAL)
sizerFirepower.Add(baseBox, 1, wx.ALIGN_LEFT if counter == 0 else wx.ALIGN_CENTER_HORIZONTAL)
@@ -73,13 +73,13 @@ class FirepowerViewFull(StatsView):
box = wx.BoxSizer(wx.VERTICAL)
baseBox.Add(box, 0, wx.ALIGN_CENTER)
box.Add(wx.StaticText(parent, wx.ID_ANY, _t(damageType).capitalize()), 0, wx.ALIGN_LEFT)
box.Add(wx.StaticText(parent, wx.ID_ANY, label), 0, wx.ALIGN_LEFT)
hbox = wx.BoxSizer(wx.HORIZONTAL)
box.Add(hbox, 1, wx.ALIGN_CENTER)
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0 DPS")
setattr(self, "label%sDps%s" % (panel.capitalize(), damageType.capitalize()), lbl)
setattr(self, "label%sDps%s" % (panel.capitalize(), attr), lbl)
hbox.Add(lbl, 0, wx.ALIGN_CENTER)
self._cachedValues.append(0)
@@ -112,7 +112,7 @@ class FirepowerViewFull(StatsView):
image = BitmapLoader.getBitmap("mining_small", "gui")
self.miningyield = wx.BitmapButton(contentPanel, -1, image)
self.miningyield.SetToolTip(wx.ToolTip(_t("Click to toggle to Mining Yield ")))
self.miningyield.SetToolTip(wx.ToolTip(_t("Click to toggle to Mining Yield")))
self.miningyield.Bind(wx.EVT_BUTTON, self.switchToMiningYieldView)
sizerFirepower.Add(self.miningyield, 0, wx.ALIGN_LEFT)

View File

@@ -53,7 +53,10 @@ class PriceViewFull(StatsView):
gridPrice = wx.GridSizer(2, 3, 0, 0)
contentSizer.Add(gridPrice, 0, wx.EXPAND | wx.ALL, 0)
for _type in ("ship", "fittings", "character", "drones", "cargoBay", "total"):
for _type, label in (
("ship", _t("Ship")), ("fittings", _t("Fittings")), ("character", _t("Character")),
("drones", _t("Drones")), ("cargoBay", _t("Cargo bay")), ("total", _t("Total"))
):
if _type in "ship":
image = "ship_big"
elif _type in ("fittings", "total"):
@@ -69,7 +72,7 @@ class PriceViewFull(StatsView):
vbox = wx.BoxSizer(wx.VERTICAL)
box.Add(vbox, 1, wx.EXPAND)
vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, _t(_type).capitalize()), 0, wx.ALIGN_LEFT)
vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, label.capitalize()), 0, wx.ALIGN_LEFT)
hbox = wx.BoxSizer(wx.HORIZONTAL)
vbox.Add(hbox)

View File

@@ -53,7 +53,9 @@ class PriceViewMinimal(StatsView):
gridPrice = wx.GridSizer(1, 3, 0, 0)
contentSizer.Add(gridPrice, 0, wx.EXPAND | wx.ALL, 0)
for _type in ("ship", "fittings", "total"):
for _type, label in (
("ship", _t("Ship")), ("fittings", _t("Fittings")), ("total", _t("Total"))
):
image = "%sPrice_big" % _type if _type != "ship" else "ship_big"
box = wx.BoxSizer(wx.HORIZONTAL)
gridPrice.Add(box, 0, wx.ALIGN_TOP)
@@ -63,7 +65,7 @@ class PriceViewMinimal(StatsView):
vbox = wx.BoxSizer(wx.VERTICAL)
box.Add(vbox, 1, wx.EXPAND)
vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, _t(_type).capitalize()), 0, wx.ALIGN_LEFT)
vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, label), 0, wx.ALIGN_LEFT)
hbox = wx.BoxSizer(wx.HORIZONTAL)
vbox.Add(hbox)

View File

@@ -58,7 +58,7 @@ class ResistancesViewFull(StatsView):
# Custom header EHP
headerContentSizer = self.headerPanel.Parent.GetHeaderContentSizer()
self.stEff = wx.StaticText(headerPanel, wx.ID_ANY, "(" + _t("Effective HP") + ": ")
self.stEff = wx.StaticText(headerPanel, wx.ID_ANY, "(" + _t("Effective HP: "))
headerContentSizer.Add(self.stEff)
headerPanel.GetParent().AddToggleItem(self.stEff)
@@ -93,7 +93,7 @@ class ResistancesViewFull(StatsView):
bitmap.SetToolTip(tooltip)
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 = wx.Button(contentPanel, style=wx.BU_EXACTFIT, label=_t("EHP"))
self.stEHPs.SetToolTip(wx.ToolTip(_t("Click to toggle between effective HP and raw HP")))
self.stEHPs.Bind(wx.EVT_BUTTON, self.toggleEHP)
@@ -169,7 +169,7 @@ class ResistancesViewFull(StatsView):
self.stEHPs.SetToolTip(wx.ToolTip(_t("Click to toggle between effective HP and raw HP")))
def toggleEHP(self, event):
wx.PostEvent(self.mainFrame, GE.EffectiveHpToggled(effective=self.stEHPs.GetLabel() == "HP"))
wx.PostEvent(self.mainFrame, GE.EffectiveHpToggled(effective=self.stEHPs.GetLabel() == _t("HP")))
def ehpSwitch(self, event):
event.Skip()
@@ -184,7 +184,7 @@ class ResistancesViewFull(StatsView):
wx.PostEvent(self.mainFrame, GE.EffectiveHpToggled(effective=True))
return
self.stEHPs.SetLabel("EHP" if self.showEffective else "HP")
self.stEHPs.SetLabel(_t("EHP") if self.showEffective else _t("HP"))
self.activeFit = fit.ID if fit is not None else None
for tankType in ("shield", "armor", "hull"):
@@ -203,24 +203,24 @@ class ResistancesViewFull(StatsView):
ehp = (fit.ehp if self.showEffective else fit.hp) if fit is not None else None
total = 0
for tankType in ("shield", "armor", "hull"):
for tankType, tooltip in (("shield", _t("Shield: ")), ("armor", _t("Armor: ")), ("hull", _t("Hull: "))):
lbl = getattr(self, "labelResistance%sEhp" % tankType.capitalize())
if ehp is not None:
total += ehp[tankType]
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(tooltip + "%d\n" % ehp[tankType] + _t("Resist Multiplier: ") + "%.2fx" % rrFactor))
else:
lbl.SetLabel("0")
self.labelEhp.SetLabel("%s" % formatAmount(total, 3, 0, 9))
if self.showEffective:
self.stEff.SetLabel("( Effective HP: ")
self.labelEhp.SetToolTip(wx.ToolTip("Effective: %d HP" % total))
self.stEff.SetLabel("(" + _t("Effective HP: "))
self.labelEhp.SetToolTip(wx.ToolTip(_t("Effective: %d HP") % total))
else:
self.stEff.SetLabel("( Raw HP: ")
self.labelEhp.SetToolTip(wx.ToolTip("Raw: %d HP" % total))
self.stEff.SetLabel("(" + _t("Raw HP: "))
self.labelEhp.SetToolTip(wx.ToolTip(_t("Raw: %d HP") % total))
damagePattern = fit.damagePattern if fit is not None and self.showEffective else None
total = sum((damagePattern.emAmount, damagePattern.thermalAmount,

View File

@@ -17,11 +17,13 @@
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
# =============================================================================
from collections import OrderedDict
# noinspection PyPackageRequirements
import wx
from gui.statsView import StatsView
from gui.utils.numberFormatter import formatAmount
from collections import OrderedDict
_t = wx.GetTranslation
@@ -104,7 +106,8 @@ class TargetingMiscViewMinimal(StatsView):
sensorValues = {
"main": lambda: fit.scanStrength,
"jamChance": lambda: fit.jamChance}
"jamChance": lambda: fit.jamChance
}
cargoNamesOrder = OrderedDict((
("fleetHangarCapacity", _t("Fleet hangar")),
@@ -143,7 +146,8 @@ class TargetingMiscViewMinimal(StatsView):
"specialSalvageHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialSalvageHoldCapacity"),
"specialCommandCenterHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialCommandCenterHoldCapacity"),
"specialPlanetaryCommoditiesHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialPlanetaryCommoditiesHoldCapacity"),
"specialQuafeHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialQuafeHoldCapacity")}
"specialQuafeHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialQuafeHoldCapacity")
}
stats = (("labelTargets", {"main": lambda: fit.maxTargets}, 3, 0, 0, ""),
("labelRange", {"main": lambda: fit.maxTargetRange / 1000}, 3, 0, 0, "km"),
@@ -157,10 +161,10 @@ class TargetingMiscViewMinimal(StatsView):
("labelFullCargo", cargoValues, 4, 0, 9, "m\u00B3"))
counter = 0
RADII = [("Pod", 25), ("Interceptor", 33), ("Frigate", 38),
("Destroyer", 83), ("Cruiser", 130),
("Battlecruiser", 265), ("Battleship", 420),
("Carrier", 3000)]
RADII = [(_t("Pod"), 25), (_t("Interceptor"), 33), (_t("Frigate"), 38),
(_t("Destroyer"), 83), (_t("Cruiser"), 130),
(_t("Battlecruiser"), 265), (_t("Battleship"), 420),
(_t("Carrier"), 3000)]
for labelName, valueDict, prec, lowest, highest, unit in stats:
label = getattr(self, labelName)
newValues = {}
@@ -185,8 +189,8 @@ class TargetingMiscViewMinimal(StatsView):
ecmChance = round(ecmChance, 1)
if ecmChance:
label.SetLabel("{} ({}%)".format(
formatAmount(mainValue, prec, lowest, highest),
formatAmount(ecmChance, 3, 0, 0)))
formatAmount(mainValue, prec, lowest, highest),
formatAmount(ecmChance, 3, 0, 0)))
else:
label.SetLabel("{}".format(formatAmount(mainValue, prec, lowest, highest)))
else:
@@ -194,35 +198,35 @@ class TargetingMiscViewMinimal(StatsView):
# Tooltip stuff
if fit:
if labelName == "labelScanRes":
lockTime = "%s\n" % "Lock Times".center(30)
lockTime = "%s\n" % _t("Lock Times").center(30)
for size, radius in RADII:
left = "%.1fs" % fit.calculateLockTime(radius)
right = "%s [%d]" % (size, radius)
lockTime += "%5s\t%s\n" % (left, right)
label.SetToolTip(wx.ToolTip(lockTime))
elif labelName == "labelFullWarpSpeed":
maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance
maxWarpDistance = _t("Max Warp Distance: %.1f AU") % fit.maxWarpDistance
if fit.ship.getModifiedItemAttr("warpScrambleStatus"):
warpScrambleStatus = "Warp Core Strength: %.1f" % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1)
warpScrambleStatus = _t("Warp Core Strength: %.1f") % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1)
else:
warpScrambleStatus = "Warp Core Strength: %.1f" % 0
warpScrambleStatus = _t("Warp Core Strength: %.1f") % 0
label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus)))
elif labelName == "labelSensorStr":
ecmChance = otherValues["jamChance"]
ecmChance = round(ecmChance, 1)
if ecmChance > 0:
label.SetToolTip(wx.ToolTip("Type: {}\n{}% chance to be jammed".format(
fit.scanType,
formatAmount(ecmChance, 3, 0, 0))))
label.SetToolTip(wx.ToolTip(
_t("Type: {0}\n").foramt(fit.scanType) + "{}%".format(formatAmount(ecmChance, 3, 0, 0)) + _t(" chance to be jammed").format(
formatAmount(ecmChance, 3, 0, 0))))
else:
label.SetToolTip(wx.ToolTip("Type: {}".format(fit.scanType)))
label.SetToolTip(wx.ToolTip(_t("Type: {}").format(fit.scanType)))
elif labelName == "labelFullAlignTime":
alignTime = "Align:\t%.3fs" % mainValue
mass = 'Mass:\t{:,.0f}kg'.format(fit.ship.getModifiedItemAttr("mass"))
agility = "Agility:\t%.3fx" % (fit.ship.getModifiedItemAttr("agility") or 0)
alignTime = _t("Align:\t%.3fs") % mainValue
mass = _t('Mass:\t{:,.0f}kg').format(fit.ship.getModifiedItemAttr("mass"))
agility = _t("Agility:\t%.3fx") % (fit.ship.getModifiedItemAttr("agility") or 0)
label.SetToolTip(wx.ToolTip("%s\n%s\n%s" % (alignTime, mass, agility)))
elif labelName == "labelFullCargo":
tipLines = ["Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, newValues["main"])]
tipLines = [_t("Cargohold: ")+"{:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, newValues["main"])]
for attrName, tipAlias in list(cargoNamesOrder.items()):
if newValues[attrName] > 0:
tipLines.append("{}: {:,.2f}m\u00B3".format(tipAlias, newValues[attrName]))
@@ -234,11 +238,11 @@ class TargetingMiscViewMinimal(StatsView):
self._cachedValues[counter] = newValues
elif labelName == "labelFullWarpSpeed":
if fit:
maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance
maxWarpDistance = _t("Max Warp Distance: %.1f AU") % fit.maxWarpDistance
if fit.ship.getModifiedItemAttr("warpScrambleStatus"):
warpScrambleStatus = "Warp Core Strength: %.1f" % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1)
warpScrambleStatus = _t("Warp Core Strength: %.1f") % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1)
else:
warpScrambleStatus = "Warp Core Strength: %.1f" % 0
warpScrambleStatus = _t("Warp Core Strength: %.1f") % 0
label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus)))
else:
label.SetToolTip(wx.ToolTip(""))
@@ -247,7 +251,7 @@ class TargetingMiscViewMinimal(StatsView):
cachedCargo = self._cachedValues[counter]
# if you add stuff to cargo, the capacity doesn't change and thus it is still cached
# This assures us that we force refresh of cargo tooltip
tipLines = ["Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, cachedCargo["main"])]
tipLines = [_t("Cargohold: ")+"{:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, cachedCargo["main"])]
for attrName, tipAlias in list(cargoNamesOrder.items()):
if cachedCargo[attrName] > 0:
tipLines.append("{}: {:,.2f}m\u00B3".format(tipAlias, cachedCargo[attrName]))
@@ -258,7 +262,7 @@ class TargetingMiscViewMinimal(StatsView):
# forces update of probe size, since this stat is used by both sig radius and sensor str
if labelName == "labelFullSigRadius":
if fit:
label.SetToolTip(wx.ToolTip("Probe Size: %.3f" % (fit.probeSize or 0)))
label.SetToolTip(wx.ToolTip(_t("Probe Size: %.3f") % (fit.probeSize or 0)))
else:
label.SetToolTip(wx.ToolTip(""))

View File

@@ -24,6 +24,8 @@ from eos.saveddata.fighter import Fighter
from gui.viewColumn import ViewColumn
import gui.mainFrame
_t = wx.GetTranslation
class Abilities(ViewColumn):
name = "Fighter Abilities"
@@ -32,7 +34,7 @@ class Abilities(ViewColumn):
ViewColumn.__init__(self, fittingView)
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.columnText = "Active Abilities"
self.columnText = _t("Active Abilities")
self.mask = wx.LIST_MASK_TEXT
def getText(self, stuff):

View File

@@ -40,6 +40,7 @@ from service.market import Market
pyfalog = Logger(__name__)
_t = wx.GetTranslation
class BaseName(ViewColumn):
@@ -51,7 +52,7 @@ class BaseName(ViewColumn):
ViewColumn.__init__(self, fittingView)
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.columnText = "Name"
self.columnText = _t("Name")
self.mask = wx.LIST_MASK_TEXT
self.projectedView = isinstance(fittingView, gui.builtinAdditionPanes.projectedView.ProjectedView)

View File

@@ -47,7 +47,7 @@ class Miscellanea(ViewColumn):
self.imageId = -1
if params["displayName"] or self.imageId == -1:
self.columnText = "Misc data"
self.columnText = _("Misc data")
self.mask |= wx.LIST_MASK_TEXT
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.fittingView = fittingView

View File

@@ -24,6 +24,8 @@ from eos.saveddata.booster import Booster
from gui.viewColumn import ViewColumn
import gui.mainFrame
_t = wx.GetTranslation
class SideEffects(ViewColumn):
name = "Side Effects"
@@ -32,7 +34,7 @@ class SideEffects(ViewColumn):
ViewColumn.__init__(self, fittingView)
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.columnText = "Active Side Effects"
self.columnText = _t("Active Side Effects")
self.mask = wx.LIST_MASK_TEXT
def getText(self, stuff):

View File

@@ -45,6 +45,7 @@ from config import slotColourMap
from gui.fitCommands.helpers import getSimilarModPositions
pyfalog = Logger(__name__)
_t = wx.GetTranslation
# Tab spawning handler
@@ -653,11 +654,11 @@ class FittingView(d.Display):
contexts.append(fullContext)
elif isinstance(mainMod, Mode):
srcContext = "fittingMode"
itemContext = "Tactical Mode"
itemContext = _t("Tactical Mode")
fullContext = (srcContext, itemContext)
if srcContext not in tuple(fCtx[0] for fCtx in contexts):
contexts.append(fullContext)
contexts.append(("fittingShip", "Ship" if not fit.isStructure else "Citadel"))
contexts.append(("fittingShip", _t("Ship") if not fit.isStructure else _t("Citadel")))
menu = ContextMenu.getMenu(self, mainMod, selection, *contexts)
self.PopupMenu(menu)

View File

@@ -369,10 +369,10 @@ class SkillTreeView(wx.Panel):
bSizerButtons.AddStretchSpacer()
importExport = ((_t("Import"), wx.ART_FILE_OPEN, _t("from")),
(_t("Export"), wx.ART_FILE_SAVE_AS, _t("to")))
importExport = ((_t("Import skills from clipboard"), wx.ART_FILE_OPEN, "import"),
(_t("Export skills from clipboard"), wx.ART_FILE_SAVE_AS, "export"))
for name, art, direction in importExport:
for tooltip, art, attr in importExport:
bitmap = wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON)
btn = wx.BitmapButton(self, wx.ID_ANY, bitmap)
@@ -380,11 +380,11 @@ class SkillTreeView(wx.Panel):
btn.SetMaxSize(btn.GetSize())
btn.Layout()
setattr(self, "{}Btn".format(name.lower()), btn)
setattr(self, "{}Btn".format(attr), btn)
btn.Enable(True)
btn.SetToolTip(_t("%s skills %s clipboard") % (name, direction))
btn.SetToolTip(tooltip)
bSizerButtons.Add(btn, 0, wx.ALL, 5)
btn.Bind(wx.EVT_BUTTON, getattr(self, "{}Skills".format(name.lower())))
btn.Bind(wx.EVT_BUTTON, getattr(self, "{}Skills".format(attr)))
pmainSizer.Add(bSizerButtons, 0, wx.EXPAND, 5)
@@ -605,7 +605,7 @@ class SkillTreeView(wx.Panel):
eveItem = Market.getInstance().getItem(id)
srcContext = "skillItem"
itemContext = "Skill"
itemContext = _t("Skill")
context = (srcContext, itemContext)
menu = ContextMenu.getMenu(self, eveItem, [eveItem], context)
char = self.charEditor.entityEditor.getActiveEntity()
@@ -646,7 +646,7 @@ class SkillTreeView(wx.Panel):
lvl, dirty = sChar.getSkillLevel(char.ID, skillID)
self.skillTreeListCtrl.SetItemText(treeItem,
1,
_("Level {}").format(int(lvl)) if not isinstance(lvl, str) else lvl)
_t("Level {}").format(int(lvl)) if not isinstance(lvl, str) else lvl)
if not dirty:
self.skillTreeListCtrl.SetItemImage(treeItem, self.skillBookImageId)

View File

@@ -197,7 +197,7 @@ class ItemStatsContainer(wx.Panel):
if config.debug:
self.properties = ItemProperties(self.nbContainer, stuff, item, context)
self.nbContainer.AddPage(self.properties, "Properties")
self.nbContainer.AddPage(self.properties, _t("Properties"))
self.nbContainer.Bind(wx.EVT_LEFT_DOWN, self.mouseHit)
self.SetSizer(mainSizer)

View File

@@ -283,9 +283,10 @@ class MainFrame(wx.Frame):
def LoadMainFrameAttribs(self):
mainFrameDefaultAttribs = {
"wnd_display": 0, "wnd_x": 0, "wnd_y": 0, "wnd_width": 1000, "wnd_height": 700, "wnd_maximized": False,
"browser_width": 300, "market_height": 0, "fitting_height": -200}
"browser_width": 300, "market_height": 0, "fitting_height": -200
}
self.mainFrameAttribs = SettingsProvider.getInstance().getSettings(
"pyfaMainWindowAttribs", mainFrameDefaultAttribs)
"pyfaMainWindowAttribs", mainFrameDefaultAttribs)
wndDisplay = self.mainFrameAttribs["wnd_display"]
displayData = self._getDisplayData()
@@ -463,10 +464,10 @@ class MainFrame(wx.Frame):
defaultFile = "%s - %s.xml" % (fit.ship.item.name, fit.name) if fit else None
with wx.FileDialog(
self, _t("Save Fitting As..."),
wildcard=_t("EVE XML fitting files (*.xml)|*.xml"),
style=wx.FD_SAVE,
defaultFile=defaultFile
self, _t("Save Fitting As..."),
wildcard=_t("EVE XML fitting files") + " (*.xml)|*.xml",
style=wx.FD_SAVE,
defaultFile=defaultFile
) as dlg:
if dlg.ShowModal() == wx.ID_OK:
self.supress_left_up = True
@@ -643,15 +644,15 @@ class MainFrame(wx.Frame):
if not fit.ignoreRestrictions:
with wx.MessageDialog(
self, _t("Are you sure you wish to ignore fitting restrictions for the "
"current fit? This could lead to wildly inaccurate results and possible errors."),
_t("Confirm"), wx.YES_NO | wx.ICON_QUESTION
self, _t("Are you sure you wish to ignore fitting restrictions for the "
"current fit? This could lead to wildly inaccurate results and possible errors."),
_t("Confirm"), wx.YES_NO | wx.ICON_QUESTION
) as dlg:
result = dlg.ShowModal() == wx.ID_YES
else:
with wx.MessageDialog(
self, _t("Re-enabling fitting restrictions for this fit will also remove any illegal items "
"from the fit. Do you want to continue?"), _t("Confirm"), wx.YES_NO | wx.ICON_QUESTION
self, _t("Re-enabling fitting restrictions for this fit will also remove any illegal items "
"from the fit. Do you want to continue?"), _t("Confirm"), wx.YES_NO | wx.ICON_QUESTION
) as dlg:
result = dlg.ShowModal() == wx.ID_YES
if result:
@@ -802,14 +803,14 @@ class MainFrame(wx.Frame):
""" Exports skills needed for active fit and active character """
sCharacter = Character.getInstance()
with wx.FileDialog(
self,
_t("Export Skills Needed As..."),
wildcard=("|".join([
_t("EVEMon skills training file") + " (*.emp)|*.emp",
_t("EVEMon skills training XML file") + " (*.xml)|*.xml",
_t("Text skills training file") + " (*.txt)|*.txt"
])),
style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT,
self,
_t("Export Skills Needed As..."),
wildcard=("|".join([
_t("EVEMon skills training file") + " (*.emp)|*.emp",
_t("EVEMon skills training XML file") + " (*.xml)|*.xml",
_t("Text skills training file") + " (*.txt)|*.txt"
])),
style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT,
) as dlg:
if dlg.ShowModal() == wx.ID_OK:
saveFmtInt = dlg.GetFilterIndex()
@@ -831,21 +832,21 @@ class MainFrame(wx.Frame):
def fileImportDialog(self, event):
"""Handles importing single/multiple EVE XML / EFT cfg fit files"""
with wx.FileDialog(
self,
_t("Open One Or More Fitting Files"),
wildcard=("|".join([
_t("EVE XML fitting files") + " (*.xml)|*.xml",
_t("EFT text fitting files") + " (*.cfg)|*.cfg",
_t("All Files") + "|*"
])),
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
self,
_t("Open One Or More Fitting Files"),
wildcard=("|".join([
_t("EVE XML fitting files") + " (*.xml)|*.xml",
_t("EFT text fitting files") + " (*.cfg)|*.cfg",
_t("All Files") + "|*"
])),
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
) as dlg:
if dlg.ShowModal() == wx.ID_OK:
self.progressDialog = wx.ProgressDialog(
_t("Importing fits"),
" " * 100, # set some arbitrary spacing to create width in window
parent=self,
style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL
_t("Importing fits"),
" " * 100, # set some arbitrary spacing to create width in window
parent=self,
style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL
)
Port.importFitsThreaded(dlg.GetPaths(), self)
self.progressDialog.ShowModal()
@@ -855,11 +856,11 @@ class MainFrame(wx.Frame):
defaultFile = "pyfa-fits-%s.xml" % strftime("%Y%m%d_%H%M%S", gmtime())
with wx.FileDialog(
self,
_t("Save Backup As..."),
wildcard=_t("EVE XML fitting file") + " (*.xml)|*.xml",
style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT,
defaultFile=defaultFile,
self,
_t("Save Backup As..."),
wildcard=_t("EVE XML fitting file") + " (*.xml)|*.xml",
style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT,
defaultFile=defaultFile,
) as dlg:
if dlg.ShowModal() == wx.ID_OK:
filePath = dlg.GetPath()
@@ -870,11 +871,11 @@ class MainFrame(wx.Frame):
max_ = sFit.countAllFits()
self.progressDialog = wx.ProgressDialog(
_t("Backup fits"),
_t("Backing up {} fits to: {}").format(max_, filePath),
maximum=max_,
parent=self,
style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL
_t("Backup fits"),
_t("Backing up {} fits to: {}").format(max_, filePath),
maximum=max_,
parent=self,
style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL
)
Port.backupFits(filePath, self)
self.progressDialog.ShowModal()
@@ -889,22 +890,22 @@ class MainFrame(wx.Frame):
if not os.path.isdir(os.path.dirname(path)):
with wx.MessageDialog(
self,
self,
_t("Invalid Path") + "\n\n" +
_t("The following path is invalid or does not exist:") +
f"\n{path}\n\n" +
_t("Please verify path location pyfa's preferences."),
_t("Error"),
wx.OK | wx.ICON_ERROR
_t("Error"),
wx.OK | wx.ICON_ERROR
) as dlg:
if dlg.ShowModal() == wx.ID_OK:
return
self.progressDialog = wx.ProgressDialog(
_t("Backup fits"),
_t("Generating HTML file at: {}").format(path),
maximum=max_, parent=self,
style=wx.PD_APP_MODAL | wx.PD_ELAPSED_TIME)
_t("Backup fits"),
_t("Generating HTML file at: {}").format(path),
maximum=max_, parent=self,
style=wx.PD_APP_MODAL | wx.PD_ELAPSED_TIME)
exportHtml.getInstance().refreshFittingHtml(True, self.backupCallback)
self.progressDialog.ShowModal()
@@ -922,7 +923,7 @@ class MainFrame(wx.Frame):
def on_port_processing(self, action, data=None):
# 2017/03/29 NOTE: implementation like interface
wx.CallAfter(
self._on_port_processing, action, data
self._on_port_processing, action, data
)
return self.__progress_flag
@@ -946,11 +947,11 @@ class MainFrame(wx.Frame):
self.closeProgressDialog()
_message = _t("Import Error") if action & IPortUser.PROCESS_IMPORT else _t("Export Error")
with wx.MessageDialog(
self,
self,
_t("The following error was generated") +
f"\n\n{data}\n\n" +
f"\n\n{data}\n\n" +
_t("Be aware that already processed fits were not saved"),
_message, wx.OK | wx.ICON_ERROR
_message, wx.OK | wx.ICON_ERROR
) as dlg:
dlg.ShowModal()
return
@@ -1007,13 +1008,13 @@ class MainFrame(wx.Frame):
def importCharacter(self, event):
""" Imports character XML file from EVE API """
with wx.FileDialog(
self,
_t("Open One Or More Character Files"),
wildcard="|".join([
_t("EVE API XML character files") + " (*.xml)|*.xml",
_t("All Files") + "|*"
]),
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
self,
_t("Open One Or More Character Files"),
wildcard="|".join([
_t("EVE API XML character files") + " (*.xml)|*.xml",
_t("All Files") + "|*"
]),
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
) as dlg:
if dlg.ShowModal() == wx.ID_OK:
self.supress_left_up = True

View File

@@ -168,10 +168,10 @@ class DmgPatternEditor(AuxiliaryFrame):
self.SetSizer(mainSizer)
importExport = (("Import", wx.ART_FILE_OPEN, _t("from")),
("Export", wx.ART_FILE_SAVE_AS, _t("to")))
importExport = ((_t("Import patterns from clipboard"), wx.ART_FILE_OPEN, "import"),
(_t("Export patterns to clipboard"), wx.ART_FILE_SAVE_AS, "export"))
for name, art, direction in importExport:
for tooltip, art, attr in importExport:
bitmap = wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON)
btn = wx.BitmapButton(self, wx.ID_ANY, bitmap)
@@ -179,11 +179,11 @@ class DmgPatternEditor(AuxiliaryFrame):
btn.SetMaxSize(btn.GetSize())
btn.Layout()
setattr(self, name, btn)
setattr(self, "{}Btn".format(attr), btn)
btn.Enable(True)
btn.SetToolTip(_t("%s patterns %s clipboard") % (name, direction))
btn.SetToolTip(tooltip)
footerSizer.Add(btn, 0)
btn.Bind(wx.EVT_BUTTON, getattr(self, "{}Patterns".format(name.lower())))
btn.Bind(wx.EVT_BUTTON, getattr(self, "{}Patterns".format(attr)))
if not self.entityEditor.checkEntitiesExist():
self.Close()

View File

@@ -16,7 +16,6 @@ from gui.marketBrowser import SearchBox
from service.fit import Fit
from service.market import Market
pyfalog = Logger(__name__)
_t = wx.GetTranslation
@@ -26,8 +25,8 @@ class AttributeEditor(AuxiliaryFrame):
def __init__(self, parent):
super().__init__(
parent, wx.ID_ANY, title=_("Attribute Editor"), pos=wx.DefaultPosition,
size=wx.Size(650, 600), resizeable=True)
parent, wx.ID_ANY, title=_t("Attribute Editor"), pos=wx.DefaultPosition,
size=wx.Size(650, 600), resizeable=True)
i = wx.Icon(BitmapLoader.getBitmap("fit_rename_small", "gui"))
self.SetIcon(i)
@@ -36,11 +35,11 @@ class AttributeEditor(AuxiliaryFrame):
menubar = wx.MenuBar()
fileMenu = wx.Menu()
fileImport = fileMenu.Append(wx.ID_ANY, _('Import'), _('Import overrides'))
fileExport = fileMenu.Append(wx.ID_ANY, _('Export'), _('Import overrides'))
fileClear = fileMenu.Append(wx.ID_ANY, _('Clear All'), _('Clear all overrides'))
fileImport = fileMenu.Append(wx.ID_ANY, _t('Import'), _t('Import overrides'))
fileExport = fileMenu.Append(wx.ID_ANY, _t('Export'), _t('Import overrides'))
fileClear = fileMenu.Append(wx.ID_ANY, _t('Clear All'), _t('Clear all overrides'))
menubar.Append(fileMenu, '&File')
menubar.Append(fileMenu, _t('&File'))
self.SetMenuBar(menubar)
self.Bind(wx.EVT_MENU, self.OnImport, fileImport)
@@ -69,7 +68,7 @@ class AttributeEditor(AuxiliaryFrame):
mainSizer.Add(leftPanel, 1, wx.ALL | wx.EXPAND, 5)
rightSizer = wx.BoxSizer(wx.VERTICAL)
self.btnRemoveOverrides = wx.Button(panel, wx.ID_ANY, _("Remove Overides for Item"), wx.DefaultPosition,
self.btnRemoveOverrides = wx.Button(panel, wx.ID_ANY, _t("Remove Overides for Item"), wx.DefaultPosition,
wx.DefaultSize, 0)
self.pg = AttributeGrid(panel)
rightSizer.Add(self.pg, 1, wx.ALL | wx.EXPAND, 5)
@@ -105,9 +104,9 @@ class AttributeEditor(AuxiliaryFrame):
def OnImport(self, event):
with wx.FileDialog(
self, _("Import pyfa override file"),
wildcard="pyfa override file (*.csv)|*.csv",
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST
self, _t("Import pyfa override file"),
wildcard=_t("pyfa override file") + " (*.csv)|*.csv",
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST
) as dlg:
if dlg.ShowModal() == wx.ID_OK:
path = dlg.GetPath()
@@ -128,10 +127,10 @@ class AttributeEditor(AuxiliaryFrame):
defaultFile = "pyfa_overrides.csv"
with wx.FileDialog(
self, _("Save Overrides As..."),
wildcard="pyfa overrides (*.csv)|*.csv",
style=wx.FD_SAVE,
defaultFile=defaultFile
self, _t("Save Overrides As..."),
wildcard=_t("pyfa overrides") + " (*.csv)|*.csv",
style=wx.FD_SAVE,
defaultFile=defaultFile
) as dlg:
if dlg.ShowModal() == wx.ID_OK:
path = dlg.GetPath()
@@ -143,10 +142,10 @@ class AttributeEditor(AuxiliaryFrame):
def OnClear(self, event):
with wx.MessageDialog(
self,
_t("Are you sure you want to delete all overrides?"),
_t("Confirm Delete"),
wx.YES | wx.NO | wx.ICON_EXCLAMATION
self,
_t("Are you sure you want to delete all overrides?"),
_t("Confirm Delete"),
wx.YES | wx.NO | wx.ICON_EXCLAMATION
) as dlg:
if dlg.ShowModal() == wx.ID_YES:
sMkt = Market.getInstance()
@@ -269,7 +268,7 @@ class AttributeGrid(wxpg.PropertyGrid):
prop = wxpg.FloatProperty(key, value=default)
prop.SetClientData(item.attributes[key]) # set this so that we may access it later
prop.SetHelpString("%s\n%s" % (item.attributes[key].displayName or key, _("Default Value: %0.3f") % default))
prop.SetHelpString("%s\n%s" % (item.attributes[key].displayName or key, _t("Default Value: %0.3f") % default))
self.Append(prop)
def removeOverrides(self, event):

View File

@@ -145,10 +145,10 @@ class ImplantSetEditor(AuxiliaryFrame):
self.stNotice.Wrap(-1)
footerSizer.Add(self.stNotice, 1, wx.BOTTOM | wx.TOP | wx.LEFT, 5)
importExport = (("Import", wx.ART_FILE_OPEN, _t("from")),
("Export", wx.ART_FILE_SAVE_AS, _t("to")))
importExport = ((_t("Import implant sets from clipboard"), wx.ART_FILE_OPEN, "Import"),
(_t("Export implant sets to clipboard"), wx.ART_FILE_SAVE_AS, "Export"))
for name, art, direction in importExport:
for tooltip, art, attr in importExport:
bitmap = wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON)
btn = wx.BitmapButton(self, wx.ID_ANY, bitmap)
@@ -156,9 +156,9 @@ class ImplantSetEditor(AuxiliaryFrame):
btn.SetMaxSize(btn.GetSize())
btn.Layout()
setattr(self, name, btn)
setattr(self, attr, btn)
btn.Enable(True)
btn.SetToolTip(_t("{} implant sets {} clipboard").format(name, direction))
btn.SetToolTip(tooltip)
footerSizer.Add(btn, 0)
mainSizer.Add(footerSizer, 0, wx.ALL | wx.EXPAND, 5)

View File

@@ -218,10 +218,10 @@ class TargetProfileEditor(AuxiliaryFrame):
self.SetSizer(mainSizer)
importExport = (("Import", wx.ART_FILE_OPEN, _t("from")),
("Export", wx.ART_FILE_SAVE_AS, _t("to")))
importExport = ((_t("Import profiles from clipboard"), wx.ART_FILE_OPEN, "import"),
(_t("Export profiles to clipboard"), wx.ART_FILE_SAVE_AS, "export"))
for name, art, direction in importExport:
for tooltip, art, attr in importExport:
bitmap = wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON)
btn = wx.BitmapButton(self, wx.ID_ANY, bitmap)
@@ -229,11 +229,11 @@ class TargetProfileEditor(AuxiliaryFrame):
btn.SetMaxSize(btn.GetSize())
btn.Layout()
setattr(self, name, btn)
setattr(self, attr, btn)
btn.Enable(True)
btn.SetToolTip(_t("{} profiles {} clipboard").format(name, direction))
btn.SetToolTip(tooltip)
footerSizer.Add(btn, 0)
btn.Bind(wx.EVT_BUTTON, getattr(self, "{}Patterns".format(name.lower())))
btn.Bind(wx.EVT_BUTTON, getattr(self, "{}Patterns".format(attr)))
if not self.entityEditor.checkEntitiesExist():
self.Close()

View File

@@ -7,32 +7,32 @@ Below is a summary of [GNU gettext](https://www.gnu.org/software/gettext/) manua
## i18n with command line
Windows users can get these tools via Git for windows, Msys2 or Cygwin; or just use WSL / WSL2.
For Linux and macOS users these tools might be avaliable out-of-box.
For Linux and macOS users these tools might be available out-of-box.
### To generate new template for translation:
```console
$ find */ *.py -name "*.py" | xgettext -o locale/lang.pot -d lang -k_t -k_r -
$ find */ *.py -name "*.py" | xgettext -o locale/lang.pot -d lang -k_t -f -
```
explaination:
explanation:
* `find */ *.py -name "*.py"`: collect all `.py` file path in root dir and all sub-folder, write it to stdout
* `find */ *.py -name "*.py"`: collect all `.py` file path in root folder and all sub-folder, write it to stdout
* `xgettext`: a utility looking for keyword and put string literals in a specific format for human translation
* `-o locale/lang.pot`: let `xgettext` write to `locale/lang.pot`
* `-d lang`: default language domain is `lang`
* `-k_t -k_r`: besides default keyword (including `_`, see `info xgettext` for detail), also look for `_t` and `_r`
* `-`: let `xgettext` to read from stdin, which is connected to `find` stdout
* `-k_t`: besides default keyword (including `_`, see `info xgettext` for detail), also look for `_t`
* `-f -`: let `xgettext` to read from stdin, which is connected to `find` stdout
this `locale/lang.pot` is called PO template, which is throwed away once actual `ll_CC/LC_MESSAGES/lang.po` is ready for use.
### To initalize PO file for new language
### To initialize PO file for new language
```console
$ msginit -i locale/lang.pot -l ll_CC -o locale/ll_CC/LC_MESSAGES/lang.po
```
explaination:
explanation:
* `-i locale/lang.pot`: input file location
* `-l ll_CC`: target locale. `ll` should be a language code, and `CC` should be a country code
@@ -53,7 +53,7 @@ $ msgmerge locale/ll_CC/LC_MESSAGES/lang.po locale/lang.pot
just edit the `lang.po` file :)
### To generate mechine readable MO file
### To generate machine readable MO file
For a single locale:
@@ -61,9 +61,9 @@ For a single locale:
$ msgfmt locale/ll_CC/LC_MESSAGES/lang.po -o locale/ll_CC/LC_MESSAGES/lang.mo
```
For all avaliable locale:
For all available locale:
```bash
for $f in locale/*/; do
for f in locale/*/; do
msgfmt $f/LC_MESSAGES/lang.po -o $f/LC_MESSAGES/lang.mo
done
```

File diff suppressed because it is too large Load Diff