@@ -19,6 +19,14 @@ def __init__(self):
19
19
self .mainFrame = gui .mainFrame .MainFrame .getInstance ()
20
20
# Format: {type ID: set(loadable, charges)}
21
21
self .loadableChargesCache = {}
22
+ # Translations for the missile categories, as the text here is auto-generated via damage attributes
23
+ self .ddMissileChargeCatTrans = {
24
+ 'em' : _t ('EM' ),
25
+ 'thermal' : _t ('Thermal' ),
26
+ 'explosive' : _t ('Explosive' ),
27
+ 'kinetic' : _t ('Kinetic' ),
28
+ 'mixed' : _t ('Mixed' )
29
+ }
22
30
23
31
def display (self , callingWindow , srcContext , mainItem , selection ):
24
32
if srcContext not in ('fittingModule' , 'projectedModule' ):
@@ -48,7 +56,7 @@ def _getAmmo(self, mod):
48
56
49
57
def _addCharge (self , menu , charge ):
50
58
id_ = ContextMenuCombined .nextID ()
51
- name = charge .name if charge is not None else 'Empty'
59
+ name = charge .name if charge is not None else _t ( 'Empty' )
52
60
self .chargeEventMap [id_ ] = charge
53
61
item = wx .MenuItem (menu , id_ , name )
54
62
menu .Bind (wx .EVT_MENU , self .handleAmmoSwitch , item )
@@ -71,7 +79,7 @@ def getSubMenu(self, callingWindow, context, mainItem, selection, rootMenu, i, p
71
79
self .chargeEventMap = {}
72
80
modType , chargeDict = Ammo .getInstance ().getModuleStructuredAmmo (self .module , ammo = self .mainCharges )
73
81
if modType == 'ddTurret' :
74
- self ._addSeparator (menu , 'Long Range' )
82
+ self ._addSeparator (menu , _t ( 'Long Range' ) )
75
83
menuItems = []
76
84
for charges in chargeDict .values ():
77
85
if len (charges ) == 1 :
@@ -83,25 +91,25 @@ def getSubMenu(self, callingWindow, context, mainItem, selection, rootMenu, i, p
83
91
subMenu = wx .Menu ()
84
92
subMenu .Bind (wx .EVT_MENU , self .handleAmmoSwitch )
85
93
menuItem .SetSubMenu (subMenu )
86
- self ._addSeparator (subMenu , 'Less Damage' )
94
+ self ._addSeparator (subMenu , _t ( 'Less Damage' ) )
87
95
for charge in charges :
88
96
subMenu .Append (self ._addCharge (rootMenu if msw else subMenu , charge ))
89
- self ._addSeparator (subMenu , 'More Damage' )
97
+ self ._addSeparator (subMenu , _t ( 'More Damage' ) )
90
98
for menuItem in menuItems :
91
99
menu .Append (menuItem )
92
- self ._addSeparator (menu , 'Short Range' )
100
+ self ._addSeparator (menu , _t ( 'Short Range' ) )
93
101
elif modType == 'ddMissile' :
94
102
menuItems = []
95
103
for chargeCatName , charges in chargeDict .items ():
96
- menuItem = wx .MenuItem (menu , wx .ID_ANY , chargeCatName . capitalize ( ))
104
+ menuItem = wx .MenuItem (menu , wx .ID_ANY , self . ddMissileChargeCatTrans . get ( chargeCatName , chargeCatName ))
97
105
menuItems .append (menuItem )
98
106
subMenu = wx .Menu ()
99
107
subMenu .Bind (wx .EVT_MENU , self .handleAmmoSwitch )
100
108
menuItem .SetSubMenu (subMenu )
101
- self ._addSeparator (subMenu , 'Less Damage' )
109
+ self ._addSeparator (subMenu , _t ( 'Less Damage' ) )
102
110
for charge in charges :
103
111
subMenu .Append (self ._addCharge (rootMenu if msw else subMenu , charge ))
104
- self ._addSeparator (subMenu , 'More Damage' )
112
+ self ._addSeparator (subMenu , _t ( 'More Damage' ) )
105
113
for menuItem in menuItems :
106
114
menu .Append (menuItem )
107
115
elif modType == 'general' :
0 commit comments