You are here

public static function Lingotek::testConvertFunctions in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/Lingotek.php \Lingotek::testConvertFunctions()
  2. 7.2 lib/Drupal/lingotek/Lingotek.php \Lingotek::testConvertFunctions()
  3. 7.3 lib/Drupal/lingotek/Lingotek.php \Lingotek::testConvertFunctions()
  4. 7.4 lib/Drupal/lingotek/Lingotek.php \Lingotek::testConvertFunctions()
  5. 7.5 lib/Drupal/lingotek/Lingotek.php \Lingotek::testConvertFunctions()

File

lib/Drupal/lingotek/Lingotek.php, line 317
Defines Lingotek.

Class

Lingotek
A utility class for Lingotek translation.

Code

public static function testConvertFunctions() {
  $result = array(
    "drupal => lingotek" => array(),
    "lingotek => drupal" => array(),
  );

  // drupal => lingotek
  foreach (self::$language_map as $drupal_language_code => $lingotek_locale) {
    $ret_lingotek_locale = self::convertDrupal2Lingotek($drupal_language_code, FALSE);
    if (strcmp($lingotek_locale, $ret_lingotek_locale) !== 0) {
      $result["drupal => lingotek"][] = "[{$drupal_language_code} => {$ret_lingotek_locale}] !== {$lingotek_locale}";
    }
  }

  // lingotek => drupal
  foreach (self::$language_map as $drupal_language_code => $lingotek_locale) {
    $ret_drupal_language_code = self::convertLingotek2Drupal($lingotek_locale, FALSE);
    if (strcmp($drupal_language_code, $ret_drupal_language_code) !== 0) {
      $result["lingotek => drupal"][] = "[{$lingotek_locale} => {$ret_drupal_language_code}] !== {$drupal_language_code}";
    }
  }
  return $result;
}