Skip to content

@salesforce/b2c-tooling-sdk / i18n / setLanguage

Function: setLanguage()

setLanguage(lang): void

Defined in: packages/b2c-tooling-sdk/src/i18n/index.ts:203

Set the language for translations. Call this early in CLI initialization if --lang flag is provided.

Parameters

lang

string

Language code (e.g., 'en', 'de')

Returns

void

Example

ts
// In BaseCommand.init()
if (this.flags.lang) {
  setLanguage(this.flags.lang)
}

All rights reserved.