Skip to content

Commit

Permalink
Fix environmental variables for localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzmann committed Jun 28, 2020
1 parent b225093 commit 77d233c
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 14 deletions.
31 changes: 17 additions & 14 deletions gui/builtinContextMenus/envEffectAdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ def handleSelection(self, event):

def getData(self):
data = Group()
data.groups['Wormhole'] = self.getEffectBeacons(
'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()
data.groups['Abyssal Weather'] = self.getAbyssalWeather()
data.groups[_t('Wormhole')] = self.getEffectBeacons(
_t('Black Hole'), _t('Cataclysmic Variable'), _t('Magnetar'),
_t('Pulsar'), _t('Red Giant'), _t('Wolf Rayet'))
data.groups[_t('Sansha Incursion')] = self.getEffectBeacons(_t('Sansha Incursion'))
data.groups[_t('Triglavian Invasion')] = self.getEffectBeacons(_t('Triglavian Invasion'))
data.groups[_t('Triglavian Invasion')].groups[_t('Destructible Beacons')] = self.getDestructibleBeacons()
data.groups[_t('Abyssal Weather')] = self.getAbyssalWeather()
return data

def getEffectBeacons(self, *groups):
Expand All @@ -122,7 +122,7 @@ def getEffectBeacons(self, *groups):
data = Group()

# Stuff we don't want to see in names
garbages = ("System Effects", "Effects")
garbages = (_t("System Effects"), _t("Effects"))

# Get group with all the system-wide beacons
grp = sMkt.getGroup("Effect Beacon")
Expand Down Expand Up @@ -182,21 +182,24 @@ def getAbyssalWeather(self):
# Localized abyssal hazards
items = sMkt.getGroup("Abyssal Hazards").items
if items:
subdata = data.groups.setdefault('Localized', Group())
subdata = data.groups.setdefault(_t('Localized'), Group())
for beacon in sMkt.getGroup("Abyssal Hazards").items:
if not beacon.isType('projected'):
continue
# Localized effects, currently, have a name like "(size) (type) Cloud"
# Until this inevitably changes, do a simple split
name_parts = beacon.typeName.split(" ")
groups = (_t('Bioluminescence'), _t('Caustic'), _t('Filament'))
for group in groups:
if re.search(group, beacon.name):
key = group
break
else:
continue

key = name_parts[1].strip()
subsubdata = subdata.groups.setdefault(key, Group())
subsubdata.items.append(Entry(beacon.ID, beacon.name, beacon.name))
subdata.sort()

# PVP weather
data.items.append(Entry(49766, 'PvP Weather', 'PvP Weather'))
data.items.append(Entry(49766, _t('PvP Weather'), _t('PvP Weather')))

return data

Expand Down
41 changes: 41 additions & 0 deletions locale/zh_CN/LC_MESSAGES/lang.po
Original file line number Diff line number Diff line change
Expand Up @@ -2508,3 +2508,44 @@ msgstr "复制{}"
#: gui/builtinContextMenus/itemStats.py:38
msgid "{} Stats"
msgstr "{}属性"

# These aren't typical translations. They need to map exactly to sub strings of the item names in the database
# to produce the proper context menu tree for environmental effects
msgid "System Effects"
msgstr "星系效果"

msgid "Effects"
msgstr "效果光束"

msgid "Black Hole"
msgstr "黑洞"

msgid "Cataclysmic Variable"
msgstr "激变变星"

msgid "Magnetar"
msgstr "磁星"

msgid "Pulsar"
msgstr "脉冲星"

msgid "Red Giant"
msgstr "红巨星"

msgid "Wolf Rayet"
msgstr "沃尔夫-拉叶星"

msgid "Sansha Incursion"
msgstr "萨沙入侵"

msgid "Triglavian Invasion"
msgstr "三神裔入侵"

msgid "Bioluminescence"
msgstr "型生物荧光"

msgid "Caustic"
msgstr "腐蚀"

msgid "Filament"
msgstr "纤维"

0 comments on commit 77d233c

Please sign in to comment.