function LanguageMapper::getMapping

Same name and namespace in other branches
  1. 11.x core/modules/ckeditor5/src/LanguageMapper.php \Drupal\ckeditor5\LanguageMapper::getMapping()

Returns a specific ckeditor langcode based on the requested one.

Parameters

string $langcode: The Drupal langcode to match.

Return value

string The associated CKEditor 5 langcode.

File

core/modules/ckeditor5/src/LanguageMapper.php, line 92

Class

LanguageMapper
Manages language mappings and discovery for ckeditor translations.

Namespace

Drupal\ckeditor5

Code

public function getMapping(string $langcode) : string {
  return $this->getMappings()[$langcode] ?? 'en';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.