Skip to content
Snippets Groups Projects
Commit ffa4e797 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing default language problem, removing striping of tags from controller

parent 9977920c
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,10 @@ class MailController extends ActionController {
$languages = ['en'];
foreach ($activatedLanguages as $language) {
$languages[] = $language->getLocale();
$this->writeLanguageFile($language, $templatePath);
}
foreach($languages as $currentLanguage) {
$this->writeLanguageFile($currentLanguage, $templatePath);
}
$this->view->assign('languages', $languages);
......@@ -113,21 +116,21 @@ class MailController extends ActionController {
$this->view->assign(
'contentLeft',
strip_tags(file_get_contents($templatePath . $selectedLanguageLeft . '.sg_mail.locallang.html'))
file_get_contents($templatePath . $selectedLanguageLeft . '.sg_mail.locallang.html')
);
$this->view->assign(
'contentRight',
strip_tags(file_get_contents($templatePath . $selectedLanguageRight . '.sg_mail.locallang.html'))
file_get_contents($templatePath . $selectedLanguageRight . '.sg_mail.locallang.html')
);
} else {
$this->view->assign('selectedLanguageLeft', 'en');
$this->view->assign(
'contentLeft', strip_tags(file_get_contents($templatePath . 'en.sg_mail.locallang.html'))
'contentLeft', file_get_contents($templatePath . 'en.sg_mail.locallang.html')
);
$this->view->assign('selectedLanguageRight', 'en');
$this->view->assign(
'contentRight', strip_tags(file_get_contents($templatePath . 'en.sg_mail.locallang.html'))
'contentRight', file_get_contents($templatePath . 'en.sg_mail.locallang.html')
);
}
}
......@@ -136,17 +139,17 @@ class MailController extends ActionController {
*
* creates a language File for this Template
*
* @param \TYPO3\CMS\Lang\Domain\Model\Language $language
* @param string $language
* @param string $path
*/
private function writeLanguageFile(\TYPO3\CMS\Lang\Domain\Model\Language $language, $path) {
$currentLangFile = $path . $language->getLocale() . '.sg_mail.locallang.html';
private function writeLanguageFile($language, $path) {
$currentLangFile = $path . $language . '.sg_mail.locallang.html';
if (file_exists($currentLangFile)) {
return;
}
$langFileContent = 'Auto Generated for Language: ' . $language->getLocale();
$langFileContent = 'Auto Generated for Language: ' . $language;
file_put_contents($currentLangFile, $langFileContent);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment