function i18n_Blocks_Test::i18nTranslateBlock in Internationalization 6
Translate block fields to all languages
1 call to i18n_Blocks_Test::i18nTranslateBlock()
File
- tests/
i18n_blocks.test, line 92
Class
Code
function i18nTranslateBlock($module, $delta, $fields = array(
'title',
'body',
)) {
foreach ($this
->getOtherLanguages() as $language) {
foreach ($fields as $key) {
$text[$key] = $this
->i18nstringsCreateTranslation("blocks:{$module}:{$delta}:{$key}", $language->language);
}
// Now check translated strings display on page
$this
->i18nGet($language->language, '');
foreach ($text as $string) {
$this
->assertText($string);
}
$translations[$language->language] = $text;
}
return $translations;
}