You are here

public static function LingotekLocale::testConvertFunctions in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()
  2. 4.0.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()
  3. 3.0.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()
  4. 3.1.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()
  5. 3.2.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()
  6. 3.3.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()
  7. 3.4.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()
  8. 3.5.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()
  9. 3.6.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()
  10. 3.7.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()
  11. 3.8.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::testConvertFunctions()

File

src/LingotekLocale.php, line 306
Defines LingotekLocale class.

Class

LingotekLocale
A utility class for Lingotek translation.

Namespace

Drupal\lingotek

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);
    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);
    if (strcmp($drupal_language_code, $ret_drupal_language_code) !== 0) {
      $result["lingotek => drupal"][] = "[{$lingotek_locale} => {$ret_drupal_language_code}] !== {$drupal_language_code}";
    }
  }
  return $result;
}