I have to implement my own translation loader. I\'ve used the tutorial on: http://blog.elendev.com/development/php/symfony/use-a-database-as-translation-provider-in-symfony-
http://blog.elendev.com/page/3/#post-26 or http://blog.elendev.com/development/php/symfony/use-a-database-as-translation-provider-in-symfony-2/ Another issue here is that there are no LanguageRepository class in the example. You can use this example.
<?php
namespace TranslationBundle\Repository;
use Doctrine\ORM\EntityRepository;
class LanguageRepository extends EntityRepository
{
public function getLanguage($locale)
{
return $this->findOneBy(array('locale' => $locale));
}
}
Aldo answered this already but just to make it an official answer and to help others:
From Symfony Dependency Injection Tags: "translation.loader"
[...] If you're loading translations from a database, you'll still need a resource file, but it might either be blank or contain a little bit of information about loading those resources from the database. The file is key to trigger the load method on your custom loader.
So you need to crate files of the form <domain>.<locale>.<loader-alias>
in your translations folder app/Resources/translations/
.
In your case one file would be app/Resources/translations/messages.en.db
for English.