i18n.Function.getPersonalMountName - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@elite-dangerous-almanac/core / i18n / getPersonalMountName

Function: getPersonalMountName()

getPersonalMountName(mount, locale): string | null

Defined in: src/i18n/suits.ts:114

Resolve a suit weapon mount's display name for a locale.

Parameters

mount

PersonalMount

A mount from Suit.mounts.

locale

string

A BCP 47 locale. The mount-label source supplies English only.

Returns

string | null

The mount's English display name for an English locale, otherwise null. null too when the mount carries a key this library does not name.

Throws

If mount is not an object or locale is not a string.

Remarks

The label reads the Frontier journal SlotName the mount carries, so it distinguishes a suit's primary mounts from each other. A consumer needs no table of its own.

No locale but English answers, although the game itself publishes all six.

Example

import { getSuitByFamily } from '@elite-dangerous-almanac/core/equipment/suits';
import { getPersonalMountName } from '@elite-dangerous-almanac/core/i18n/suits';

const suit = getSuitByFamily('tacticalsuit')!;
getPersonalMountName(suit.mounts[1]!, 'en-GB'); // -> 'Primary Weapon 2'
getPersonalMountName(suit.mounts[2]!, 'de'); // -> null
⚠️ **GitHub.com Fallback** ⚠️