HuyPV
Thursday, January 5, 2012
apps/frontend/config/settings.yml
all:
.settings:
defaut_culture: vi
Article (I18N: name, body)
In action:
$article = ArticleTable::getInstance()->find(1987);
if ($article !== false) {
$this->getUser()->setCulture($unknownLang);
$name = $article->getName(); # will return $vietnameseName (I am using Diem CMF; check function getI18nFallback in file dmDoctrineRecord.php)
$englishName = $article->Translation['en']->name;
$vietnameseName = $article->Translation['vi']->name;
}
Title:
Symfony Application Change default culture
Description:
apps/frontend/config/settings.yml all: .settings: defaut_culture: vi Article (I18N: name, body) In action: $article = Articl...
...
Rating:
4