function Drupali18nTestCase::createNodeTranslationSet in Internationalization 7
Create translation set from a node
Parameters
$source: Source node
$languages: Optional list of language codes
2 calls to Drupali18nTestCase::createNodeTranslationSet()
- i18nSelectTestCase::testIi18nSelect in i18n_select/
i18n_select.test - i18nSyncTestCase::testIi18nSync in i18n_sync/
i18n_sync.test
File
- ./
i18n.test, line 133 - Base class for Internationalization tests
Class
- Drupali18nTestCase
- @file Base class for Internationalization tests
Code
function createNodeTranslationSet(&$source, $languages = NULL) {
if (empty($source->tnid)) {
$source->tnid = $source->nid;
}
$translations[$source->language] = $source;
foreach (language_list() as $language) {
if ($language->language != $source->language) {
$translations[$language->language] = $this
->createNodeTranslation($source, $language);
}
}
return $translations;
}