interface TransliterationInterface

Defines an interface for classes providing transliteration.

Hierarchy

Expanded class hierarchy of TransliterationInterface

All classes that implement TransliterationInterface

Related topics

1 file declares its use of TransliterationInterface
MachineNameController.php in drupal/core/modules/system/lib/Drupal/system/MachineNameController.php
Contains \Drupal\system\MachineNameController.

File

drupal/core/lib/Drupal/Component/Transliteration/TransliterationInterface.php, line 15
Definition of \Drupal\Component\Transliteration\TransliterationInterface.

Namespace

Drupal\Component\Transliteration
View source
interface TransliterationInterface {

  /**
   * Transliterates text from Unicode to US-ASCII.
   *
   * @param string $string
   *   The string to transliterate.
   * @param string $langcode
   *   (optional) The language code of the language the string is in. Defaults
   *   to 'en' if not provided.
   * @param string $unknown_character
   *   (optional) The character to substitute for characters in $string without
   *   transliterated equivalents. Defaults to '?'.
   *
   * @return string
   *   $string with non-US-ASCII characters transliterated to US-ASCII
   *   characters, and unknown characters replaced with $unknown_character.
   */
  public function transliterate($string, $langcode = 'en', $unknown_character = '?');

}

Members

Namesort descending Modifiers Type Description Overrides
TransliterationInterface::transliterate public function Transliterates text from Unicode to US-ASCII. 1