Best Approach in Multi Language Site


I am looking to create a multi-language site using phalcon. I would like to seek some advices from experienced peeps who did it before on what is the best approach in doing so.

Cheer Derek

Its hard to say, can you be more specific, what exactly do you want achieve? Multilanguage models, how to handle translations, ...?


I use "symfony/translation". The best extension with PoEdit.

$di->setShared('translator', function() {
    $lang = Lang::getCurrentLanguage();

    $translator = new \Symfony\Component\Translation\Translator($lang, new \Symfony\Component\Translation\MessageSelector());
    $translator->addLoader('mo', new \Symfony\Component\Translation\Loader\MoFileLoader());

    if(file_exists(sprintf(__DIR__ . '/locale/', $lang))) {
        $translator->addResource('mo', sprintf(__DIR__ . '/Resource/locale/', $lang), $lang);
    } else {
        $translator->addResource('mo', __DIR__ . '/Resource/locale/', 'en_US');

    return $translator;