i18n.Function.getLoadoutSlotName - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / i18n / getLoadoutSlotName
getLoadoutSlotName(
slot,locale):string|null
Defined in: src/i18n/slots.ts:27
Resolve a loadout slot's display name for a locale.
A slot returned by enumerateSlots or ShipLoadout.slots.
string
A BCP 47 locale. The slot-label sources supply English only.
string | null
The slot's English display name for an English locale, otherwise null.
If slot is not an object or locale is not a string.
import { getLoadoutSlotName } from '@elite-dangerous-almanac/core/i18n/slots';
import { enumerateSlots } from '@elite-dangerous-almanac/core/ships/slots';
import { getShipSlots } from '@elite-dangerous-almanac/core/ships/ships';
const powerPlant = enumerateSlots(getShipSlots('SideWinder')!).find(
(slot) => slot.kind === 'core' && slot.core === 'powerPlant',
)!;
getLoadoutSlotName(powerPlant, 'en'); // -> 'Power Plant'