Skip to content

Commit

Permalink
i18n: special comments to mark strings containing '%' mean literally …
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoweny committed Jul 11, 2020
1 parent b820300 commit e536aa5
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 108 deletions.
16 changes: 13 additions & 3 deletions eos/saveddata/damagePattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,19 @@ def _c(x):
# Source: ticket #2067
(-86, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Invading Precursor Entities')) + _t('Dread'), 0, 417, 0, 583)),
(-87, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Invading Precursor Entities')) + _t('Normal Subcaps'), 0, 610, 0, 390)),
(-88, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Invading Precursor Entities')) + _t('Subcaps w/missiles 0% spool up'), 367, 155, 367, 112)),
(-89, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Invading Precursor Entities')) + _t('Subcaps w/missiles 50% spool up'), 291, 243, 291, 175)),
(-90, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Invading Precursor Entities')) + _t('Subcaps w/missiles 100% spool up'), 241, 301, 241, 217)),

# To avoid errors on msgfmt, we have to mark that '0%' is meaning literally 0% with no-python-format.
# See also: https://github.com/vslavik/poedit/issues/645
(-88, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Invading Precursor Entities')) +
# xgettext:no-python-format
_t('Subcaps w/missiles 0% spool up'), 367, 155, 367, 112)),
(-89, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Invading Precursor Entities')) +
# xgettext:no-python-format
_t('Subcaps w/missiles 50% spool up'), 291, 243, 291, 175)),
(-90, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Invading Precursor Entities')) +
# xgettext:no-python-format
_t('Subcaps w/missiles 100% spool up'), 241, 301, 241, 217)),

(-91, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Retaliating Amarr Entities')) + _t('Dread/Subcaps'), 583, 417, 0, 0)),
(-92, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Retaliating Caldari Entities')) + _t('Dread'), 1000, 0, 0, 0)),
(-93, (_c(_t('NPC')) + _c(_t('Invasion')) + _c(_t('Retaliating Caldari Entities')) + _t('Subcaps'), 511, 21, 29, 440)),
Expand Down
10 changes: 5 additions & 5 deletions gui/builtinStatsViews/targetingMiscViewMinimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ def refreshPanel(self, fit):
ecmChance = otherValues["jamChance"]
ecmChance = round(ecmChance, 1)
if ecmChance > 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))))
label.SetToolTip(wx.ToolTip(_t("Type: {0}\n").foramt(fit.scanType) +
# xgettext:no-python-format,python-brace-format
_t("{}% chance to be jammed").format(formatAmount(ecmChance, 3, 0, 0))))
else:
label.SetToolTip(wx.ToolTip(_t("Type: {}").format(fit.scanType)))
elif labelName == "labelFullAlignTime":
Expand All @@ -226,7 +226,7 @@ def refreshPanel(self, fit):
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 = [_t("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]))
Expand All @@ -251,7 +251,7 @@ def refreshPanel(self, fit):
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 = [_t("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]))
Expand Down
Loading

0 comments on commit e536aa5

Please sign in to comment.