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

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

Function: getPreEngineeredVariantName()

getPreEngineeredVariantName(variant, locale): string | null

Defined in: src/i18n/pre-engineered.ts:65

Look up the display name of one pre-engineered module variant.

Parameters

variant

PreEngineeredVariantIdentity

The variant's stable catalogue identity. All four dimensions are used because a base module and blueprint alone do not uniquely identify every reward.

locale

string

A BCP 47 locale. Regional tags fall back to their supported language.

Returns

string | null

The explicit localized name, or null for an unknown variant or unavailable translation. Decorative reward names have English values only.

Throws

If variant is not an object, a required identity field or a non-null experimentalEffectSymbol value is not a string, or locale is not a string.

Example

import { getPreEngineeredVariantName } from '@elite-dangerous-almanac/core/i18n/pre-engineered';

getPreEngineeredVariantName({
  symbol: 'Hpt_FlakMortar_Turret_Medium',
  blueprintSymbol: 'Decorative_Red',
  acquisition: 'eventReward',
}, 'en'); // -> 'Festive Red Remote Release Flak Launcher'
⚠️ **GitHub.com Fallback** ⚠️