WHAT YOU'LL LEARN
  • What methods are available on sdk.languages?
  • What parameters each method accepts?
  • What each method returns?

Overview
anchor

The LanguagesSdk is accessed via sdk.languages on a Webiny instance. It provides methods for retrieving the languages configured in Webiny. All methods return a Result type — see the SDK overview for initialization and error handling details.

Methods
anchor

listLanguages
anchor

Returns all languages configured in the Webiny instance.

Signature:

This method takes no parameters.

Returns:

An array of Language objects:

FieldTypeDescription
idstringUnique language ID
namestringHuman-readable language name (e.g. "English")
codestringBCP 47 language code (e.g. "en-US")
direction"ltr" \| "rtl"Text direction
isDefaultbooleanWhether this is the default language
enabledbooleanWhether this language is currently active

Example: