Available cultures can be declared in
config/dm/config.yml
all:
i18n:
cultures: [ en, fr, de ]
The first culture is the default one.
Authenticated users can use the tool bar culture selector.
To allow non-authenticated users to switch to another culture, the dmCore/selectCulture action can be used.
In a front template:
echo _open('ul'); foreach(sfConfig::get('dm_i18n_cultures') as $culture) { echo _tag('li', _link('+/dmFront/selectCulture') // link to the dmFront/selectCulture symfony action ->param('culture', $culture) // the culture parameter ->param('page_id', $dm_page->id) // by passing the current page id, we get redirected to this page after the culture changed ->text($culture) // the link text ); } echo _close('ul');
This template uses Diem Template helpers.
The dmFront/selectCulture action will change the user culture, then redirect to the previous page.
Questions and Feedback
If you need support or have a technical question, you can
The documentation is hosted on GitHub. Feel free to submit issues and patches!