You are here

function transliteration_get in Transliteration 6.3

Same name and namespace in other branches
  1. 5.2 transliteration.module \transliteration_get()
  2. 5 transliteration.module \transliteration_get()
  3. 6 transliteration.module \transliteration_get()
  4. 6.2 transliteration.module \transliteration_get()
  5. 7.3 transliteration.module \transliteration_get()

Transliterate text.

Takes an input string in any language and character set, and tries to represent it in US-ASCII characters by conveying, in Roman letters, the pronunciation expressed by the text in some other writing system.

Parameters

$text: UTF-8 encoded text input.

$unknown: Replacement string for characters that do not have a suitable ASCII equivalent.

$source_langcode: Optional ISO 639 language code that denotes the language of the input and is used to apply language-specific variations. If the source language is not known at the time of transliteration, it is recommended to set this argument to the site default language to produce consistent results. Otherwise the current display language will be used.

Return value

Transliterated text.

See also

language_default()

3 calls to transliteration_get()
transliteration_clean_filename in ./transliteration.module
Transliterate and sanitize a file name.
transliteration_filter in ./transliteration.module
Implements hook_filter().
transliteration_search_preprocess in ./transliteration.module
Implements hook_search_preprocess().

File

./transliteration.module, line 143
Converts non-latin text to US-ASCII and sanitizes file names.

Code

function transliteration_get($text, $unknown = '?', $source_langcode = NULL) {
  static $loaded = FALSE;
  if (!$loaded) {
    module_load_include('inc', 'transliteration');
    $loaded = TRUE;
  }
  return transliteration_process($text, $unknown, $source_langcode);
}