Skip to content

Commit

Permalink
i18n: annotate string literals in gui/builtinPreferenceViews
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoweny committed Jun 21, 2020
1 parent 7cd7d47 commit 29ec297
Show file tree
Hide file tree
Showing 11 changed files with 187 additions and 156 deletions.
29 changes: 16 additions & 13 deletions gui/builtinPreferenceViews/pyfaContextMenuPreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import gui.mainFrame
from service.settings import ContextMenuSettings

_t = wx.GetTranslation


class PFContextMenuPref(PreferenceView):
title = "Context Menus"
title = _t("Context Menus")

def populatePanel(self, panel):
self.settings = ContextMenuSettings.getInstance()
Expand All @@ -22,11 +24,11 @@ def populatePanel(self, panel):
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)

Expand All @@ -36,17 +38,17 @@ def populatePanel(self, panel):

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)
Expand All @@ -56,12 +58,12 @@ def populatePanel(self, panel):
# 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)
Expand All @@ -71,12 +73,13 @@ def populatePanel(self, panel):
# 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)
Expand Down
33 changes: 17 additions & 16 deletions gui/builtinPreferenceViews/pyfaDatabasePreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
from gui.preferenceView import PreferenceView
from gui.utils import helpers_wxPython as wxHelpers

_t = wx.GetTranslation


class PFGeneralPref(PreferenceView):
title = "Database"
title = _t("Database")

def populatePanel(self, panel):
self.dirtySettings = False
Expand All @@ -20,7 +22,7 @@ def populatePanel(self, panel):
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)
Expand All @@ -29,11 +31,11 @@ def populatePanel(self, panel):
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)
Expand All @@ -42,7 +44,7 @@ def populatePanel(self, panel):
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)

Expand All @@ -52,7 +54,7 @@ def populatePanel(self, panel):
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)

Expand All @@ -74,37 +76,36 @@ def populatePanel(self, panel):
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):
Expand Down
25 changes: 13 additions & 12 deletions gui/builtinPreferenceViews/pyfaEnginePreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@

logger = logging.getLogger(__name__)

_t = wx.GetTranslation


class PFFittingEnginePref(PreferenceView):
title = "Fitting Engine"
title = _t("Fitting Engine")

def __init__(self):
self.dirtySettings = False
Expand All @@ -40,41 +42,40 @@ def populatePanel(self, panel):
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)

Expand Down
38 changes: 19 additions & 19 deletions gui/builtinPreferenceViews/pyfaEsiPreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from gui.preferenceView import PreferenceView
from service.settings import EsiSettings


# noinspection PyPackageRequirements
_t = wx.GetTranslation


class PFEsiPref(PreferenceView):
title = "EVE SSO"
title = _t("EVE SSO")

def populatePanel(self, panel):

Expand All @@ -30,25 +30,25 @@ def populatePanel(self, panel):
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.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.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, _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'))
Expand All @@ -61,7 +61,7 @@ def populatePanel(self, panel):

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))

Expand All @@ -74,7 +74,7 @@ def populatePanel(self, panel):
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)

Expand All @@ -83,7 +83,7 @@ def populatePanel(self, panel):

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)
Expand Down
Loading

0 comments on commit 29ec297

Please sign in to comment.