From 25a694bd69380975f2aeaa7f45e67b9d705da90e Mon Sep 17 00:00:00 2001 From: zhaoweny Date: Tue, 30 Jun 2020 16:37:36 +0800 Subject: [PATCH] i18n: annotate copySelectDialog.py --- gui/copySelectDialog.py | 43 +++++++++++++++++++++++++++------------- service/port/dna.py | 4 ---- service/port/eft.py | 9 --------- service/port/multibuy.py | 9 --------- 4 files changed, 29 insertions(+), 36 deletions(-) diff --git a/gui/copySelectDialog.py b/gui/copySelectDialog.py index 235b5c0af..723247b05 100644 --- a/gui/copySelectDialog.py +++ b/gui/copySelectDialog.py @@ -25,13 +25,12 @@ import wx from eos.db import getFit from gui.utils.clipboard import toClipboard -from service.const import PortMultiBuyOptions +from service.const import PortDnaOptions, PortEftOptions, PortMultiBuyOptions from service.port import EfsPort, Port -from service.port.dna import DNA_OPTIONS -from service.port.eft import EFT_OPTIONS -from service.port.multibuy import MULTIBUY_OPTIONS from service.settings import SettingsProvider +_t = wx.GetTranslation + class CopySelectDialog(wx.Dialog): copyFormatEft = 0 @@ -43,15 +42,32 @@ class CopySelectDialog(wx.Dialog): copyFormatFitStats = 6 def __init__(self, parent): - super().__init__(parent, id=wx.ID_ANY, title="Select a format", size=(-1, -1), style=wx.DEFAULT_DIALOG_STYLE) + self.MULTIBUY_OPTIONS = ( + (PortMultiBuyOptions.LOADED_CHARGES, _t('Loaded Charges'), _t('Export charges loaded into modules'), True), + (PortMultiBuyOptions.IMPLANTS, _t('Implants'), _t('Export implants'), False), + (PortMultiBuyOptions.BOOSTERS, _t('Boosters'), _t('Export boosters'), False), + (PortMultiBuyOptions.CARGO, _t('Cargo'), _t('Export cargo contents'), True), + (PortMultiBuyOptions.OPTIMIZE_PRICES, _t('Optimize Prices'), _t('Replace items by cheaper alternatives'), False), + ) + self.EFT_OPTIONS = ( + (PortEftOptions.LOADED_CHARGES, _t('Loaded Charges'), _t('Export charges loaded into modules'), True), + (PortEftOptions.MUTATIONS, _t('Mutated Attributes'), _t('Export mutated modules\' stats'), True), + (PortEftOptions.IMPLANTS, _t('Implants'), _t('Export implants'), True), + (PortEftOptions.BOOSTERS, _t('Boosters'), _t('Export boosters'), True), + (PortEftOptions.CARGO, _t('Cargo'), _t('Export cargo hold contents'), True)) + self.DNA_OPTIONS = ( + (PortDnaOptions.FORMATTING, _t('Formatting Tags'), _t('Include formatting tags to paste fit directly into corp bulletins, MOTD, etc.'), True), + ) + + super().__init__(parent, id=wx.ID_ANY, title=_t("Select a format"), size=(-1, -1), style=wx.DEFAULT_DIALOG_STYLE) self.CopySelectDict = { - CopySelectDialog.copyFormatEft : self.exportEft, - CopySelectDialog.copyFormatXml : self.exportXml, - CopySelectDialog.copyFormatDna : self.exportDna, - CopySelectDialog.copyFormatEsi : self.exportEsi, + CopySelectDialog.copyFormatEft: self.exportEft, + CopySelectDialog.copyFormatXml: self.exportXml, + CopySelectDialog.copyFormatDna: self.exportDna, + CopySelectDialog.copyFormatEsi: self.exportEsi, CopySelectDialog.copyFormatMultiBuy: self.exportMultiBuy, - CopySelectDialog.copyFormatEfs : self.exportEfs, + CopySelectDialog.copyFormatEfs: self.exportEfs, CopySelectDialog.copyFormatFitStats: self.exportFitStats } @@ -59,10 +75,10 @@ class CopySelectDialog(wx.Dialog): mainSizer = wx.BoxSizer(wx.VERTICAL) self.copyFormats = OrderedDict(( - ("EFT", (CopySelectDialog.copyFormatEft, EFT_OPTIONS)), - ("MultiBuy", (CopySelectDialog.copyFormatMultiBuy, MULTIBUY_OPTIONS)), + ("EFT", (CopySelectDialog.copyFormatEft, self.EFT_OPTIONS)), + ("MultiBuy", (CopySelectDialog.copyFormatMultiBuy, self.MULTIBUY_OPTIONS)), ("ESI", (CopySelectDialog.copyFormatEsi, None)), - ("DNA", (CopySelectDialog.copyFormatDna, DNA_OPTIONS)), + ("DNA", (CopySelectDialog.copyFormatDna, self.DNA_OPTIONS)), ("EFS", (CopySelectDialog.copyFormatEfs, None)), ("Stats", (CopySelectDialog.copyFormatFitStats, None)), # ("XML", (CopySelectDialog.copyFormatXml, None)), @@ -196,4 +212,3 @@ class CopySelectDialog(wx.Dialog): """ Puts fit stats in textual format into the clipboard """ fit = getFit(self.mainFrame.getActiveFit()) Port.exportFitStats(fit, callback) - diff --git a/service/port/dna.py b/service/port/dna.py index 5d2177372..09e766d80 100644 --- a/service/port/dna.py +++ b/service/port/dna.py @@ -39,10 +39,6 @@ from service.market import Market pyfalog = Logger(__name__) -DNA_OPTIONS = ( - (PortDnaOptions.FORMATTING, 'Formatting Tags', 'Include formatting tags to paste fit directly into corp bulletins, MOTD, etc.', True), -) - def importDna(string, fitName=None): sMkt = Market.getInstance() diff --git a/service/port/eft.py b/service/port/eft.py index b30244de2..5cdeeb4d2 100644 --- a/service/port/eft.py +++ b/service/port/eft.py @@ -43,15 +43,6 @@ from service.port.shared import IPortUser, fetchItem, processing_notify pyfalog = Logger(__name__) - -EFT_OPTIONS = ( - (PortEftOptions.LOADED_CHARGES, 'Loaded Charges', 'Export charges loaded into modules', True), - (PortEftOptions.MUTATIONS, 'Mutated Attributes', 'Export mutated modules\' stats', True), - (PortEftOptions.IMPLANTS, 'Implants', 'Export implants', True), - (PortEftOptions.BOOSTERS, 'Boosters', 'Export boosters', True), - (PortEftOptions.CARGO, 'Cargo', 'Export cargo hold contents', True)) - - MODULE_CATS = ('Module', 'Subsystem', 'Structure Module') SLOT_ORDER = (FittingSlot.LOW, FittingSlot.MED, FittingSlot.HIGH, FittingSlot.RIG, FittingSlot.SUBSYSTEM, FittingSlot.SERVICE) OFFLINE_SUFFIX = '/OFFLINE' diff --git a/service/port/multibuy.py b/service/port/multibuy.py index 848456fcb..40d932f7a 100644 --- a/service/port/multibuy.py +++ b/service/port/multibuy.py @@ -22,15 +22,6 @@ from service.const import PortMultiBuyOptions from service.price import Price as sPrc -MULTIBUY_OPTIONS = ( - (PortMultiBuyOptions.LOADED_CHARGES, 'Loaded Charges', 'Export charges loaded into modules', True), - (PortMultiBuyOptions.IMPLANTS, 'Implants', 'Export implants', False), - (PortMultiBuyOptions.BOOSTERS, 'Boosters', 'Export boosters', False), - (PortMultiBuyOptions.CARGO, 'Cargo', 'Export cargo contents', True), - (PortMultiBuyOptions.OPTIMIZE_PRICES, 'Optimize Prices', 'Replace items by cheaper alternatives', False), -) - - def exportMultiBuy(fit, options, callback): itemAmounts = {}