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

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

Function: getPersonalModificationName()

getPersonalModificationName(modificationSymbol, locale): string | null

Defined in: src/i18n/personal-modifications.ts:52

Look up an engineer-applied personal-equipment modification's source-backed display name for a locale.

Parameters

modificationSymbol

string

The recipe symbol PERSONAL_MODIFICATIONS is keyed by, such as "suit_increasedmeleedamage" or the technology-specific "weapon_range_laser". A journal line writes the unsuffixed "weapon_range", which resolvePersonalModificationForWeapon turns into the specific symbol. Matching ignores case and surrounding whitespace.

locale

string

A BCP 47 language or regional tag, such as "de" or "de-DE"; see GameLocale for how a tag is matched.

Returns

string | null

The localized modification name; the canonical PersonalModification.name for any English tag; or null when the recipe is unknown or the locale is not one of the six this catalogue stores.

Remarks

All six stored locales are complete for this dataset, so a supported locale always answers. The game offers Greater Range, Headshot Damage and Improved Hip Fire Accuracy as one menu entry each, so the three Kinetic, Laser and Plasma recipes this repository keys separately share that entry's record rather than storing it three times.

Throws

If modificationSymbol is present and not a string, or locale is not a string. A nullish modificationSymbol is a lookup miss and returns null.

Example

import { getPersonalModificationName } from '@elite-dangerous-almanac/core/i18n/personal-modifications';

getPersonalModificationName('suit_nightvision', 'de'); // -> 'Nachtsicht'
getPersonalModificationName('weapon_range_laser', 'fr'); // -> 'Portée améliorée'
getPersonalModificationName('suit_nightvision', 'it'); // -> null
⚠️ **GitHub.com Fallback** ⚠️