Skip to content

Preferences ​

Type
Class
Namespace
craft\mcp\capabilities
Inherits
craft\mcp\capabilities\Preferences
Since
5.12.0

The authenticated user’s language preferences.

View source

Public Methods ​

MethodDescription
__construct()
get()
update()

__construct() ​

View source

Arguments ​

  • $actor
  • $users

get() ​

View source

Returns ​

array{language: string|null, locale: string|null}

update() ​

View source

Arguments ​

  • $context
  • $language (string, null) – A control panel language ID, such as en-US or de.
  • $locale (string, null) – A locale ID for formatting dates and numbers, such as en-GB. Pass null to use the language’s formatting.

Returns ​

array{language: string|null, locale: string|null}