Get translations for an array of strings.
$strings: An array of strings to translate.
$langcode: The language code of the language to translate to.
function checkTranslations($strings, $langcode) {
foreach ($strings as $source => $translation) {
$db_translation = db_query('SELECT translation FROM {locales_target} lt INNER JOIN {locales_source} ls ON ls.lid = lt.lid WHERE ls.source = :source AND lt.language = :langcode', array(
':source' => $source,
':langcode' => $langcode,
))
->fetchField();
$this
->assertEqual((string) $translation, (string) $db_translation);
}
}