I just want to make a multilingual application site so I red and saw translatable and other bundle.
I use translatable and a2lix... so I read the doc but when I try to use a2lix, I get this error message :
Class c2c\AppBundle\Entity\PeriodTranslation does not exist 500 Internal Server Error - ReflectionException
I set my entityTranslation in a subfolder like so Entity>Translation>MyEntityTranslation
Is there a way to say to a2lix... that it should look inside my sub-folder ?
Thank you for your help.
Entity
namespace c2c\AppBundle\Entity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Translatable;
/**
* Period
*
* @ORM\Table(name="Periods")
* @ORM\Entity(repositoryClass="c2c\AppBundle\Entity\PeriodRepository")
* @Gedmo\TranslationEntity(class="c2c\AppBundle\Entity\Translation\PeriodTranslation")
*/
class Period implements Translatable
...
Entity Translation
namespace c2c\AppBundle\Entity\Translation;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation;
/**
* PeriodTranslation is used fo
*
* @author blucas
*/
/**
* @ORM\Table(name="ext_translations_period", indexes={
* @ORM\Index(name="period_translation_idx", columns={"locale", "object_class", "field", "foreign_key"})
* })
* @ORM\Entity(repositoryClass="Gedmo\Translatable\Entity\Repository\TranslationRepository")
*/
class PeriodTranslation extends AbstractTranslation
{
/**
* All required columns are mapped through inherited superclass
*/
}
Config
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
mappings:
gedmo_translatable:
type: annotation
prefix: Gedmo\Translatable\Entity
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity"
alias: GedmoTranslatable
is_bundle: false
...
# Soft Doctrine extendions
stof_doctrine_extensions:
default_locale: en_US
# Only used if you activated the Uploadable extension
# uploadable:
# Default file path: This is one of the three ways you can configure the path for the Uploadable extension
# default_file_path: %kernel.root_dir%/../web/uploads
# Mime type guesser class: Optional. By default, we provide an adapter for the one present in the HttpFoundation component of Symfony
# mime_type_guesser_class: Stof\DoctrineExtensionsBundle\Uploadable\MimeTypeGuesserAdapter
# Default file info class implementing FileInfoInterface: Optional. By default we provide a class which is prepared to receive an UploadedFile instance.
# default_file_info_class: Stof\DoctrineExtensionsBundle\Uploadable\UploadedFileInfo
orm:
default:
# sluggable: true
translatable: true
...
# Give a way to translate form
a2lix_translation_form:
locale_provider: default
locales: [en,fr,nl]
default_locale: en
required_locales: [en]
manager_registry: doctrine
templating: "A2lixTranslationFormBundle::default.html.twig"
The error is thrown becous the newest version of a2lix
is not compatible with the stable version of Gedmo
check this answer https://stackoverflow.com/a/22018321/2160958
If you want to use Gedmo strategy you will have to downgrade your "a2lix/translation-form-bundle"
to "1.*@dev"
if you want to use the newest version of "a2lix/translation-form-bundle"
you will have to use
wip2.4 Gedmo
version, with is unstable yet.
check this https://github.com/a2lix/TranslationFormBundle/blob/master/UPGRADE-2.0.md