public function KeycloakServiceInterface::getI18nMapping in Keycloak OpenID Connect 8
Return the Keycloak i18n locale code mapping.
This mapping is required for some languages, as Drupal uses IETF script codes, while Keycloak may use IETF region codes for its localization.
Parameters
bool $reverse: (optional) Whether to use Drupal language IDs as keys (FALSE), or Keycloak locales (TRUE). Defaults to FALSE.
bool $include_enabled: (optional) Whether to include non-mapped, but in Drupal enabled languages. If no mapping is set for an enabled language, the Drupal language ID will be used as Keycloak locale. (Which most often matches the Keycloak locales by default.) Defaults to TRUE.
Return value
array Associative array with i18n locale mappings with keys as specified with the $reverse parameter and an associative locale map array as value, having the following keys:
- language_id: Drupal language ID.
- locale: Keycloak locale.
- label: Localized human-readable language label.
1 method overrides KeycloakServiceInterface::getI18nMapping()
- KeycloakService::getI18nMapping in src/
Service/ KeycloakService.php - Return the Keycloak i18n locale code mapping.
File
- src/
Service/ KeycloakServiceInterface.php, line 210
Class
- KeycloakServiceInterface
- Keycloak service interface.
Namespace
Drupal\keycloak\ServiceCode
public function getI18nMapping($reverse = FALSE, $include_enabled = TRUE);