I have following problem.I want to translate my website in different languages. Lets say i want to translate my page in english and german.
I know how to translate single parts of an document by using translate
ViewHelper.
I know how to individualize links (etc.) by using translate
and sprintf
.
But how can i translate the whole html? I have one site where the english structure is completely different to the german structure? I tried to outsource the html into translation file (phparray) but ViewHelpers such as url
arent recognized.
Any ideas how to get it work?
If the HTML structure is completely different you should load a different template for each and every viewModel per language. So within your controllers:
if ($language == 'DE') {
$viewModel->setTemplate('template/de/index.phtml');
} else {
$viewModel->setTemplate('template/en/index.phtml');
}
You shouldn't use HTML in translation files. Just stick to strings within your translations. Since you already know the HTML structure this shouldn't be a hard thing to setup.