You are here

function _ckeditor_scayt_langcode in CKEditor - WYSIWYG HTML editor 6

Get the language locale code supported by Scayt for the specified language

1 call to _ckeditor_scayt_langcode()
ckeditor_form_alter in ./ckeditor.module
Implementation of hook_form_alter()

File

./ckeditor.module, line 1425
CKEditor - The text editor for the Internet - http://ckeditor.com Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.

Code

function _ckeditor_scayt_langcode($lang) {
  $scayt_langs = array(
    'en' => 'en_US',
    'es' => 'es_ES',
    'fr' => 'fr_FR',
    'de' => 'de_DE',
    'it' => 'it_IT',
    'el' => 'el_EL',
    'pt' => 'pt_PT',
    'da' => 'da_DA',
    'sv' => 'sv_SE',
    'nl' => 'nl_NL',
    'nb' => 'no_NO',
    'fi' => 'fi_FI',
  );
  if (array_key_exists($lang, $scayt_langs)) {
    return $scayt_langs[$lang];
  }
  $default = language_default('language');
  if (array_key_exists($default, $scayt_langs)) {
    return $scayt_langs[$default];
  }
  return 'en_US';
}