Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8712463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:06:51+00:00 2026-06-13T05:06:51+00:00

In a nutshell I’m writing a Symfony2 / Doctrine2 app and have installed and

  • 0

In a nutshell

I’m writing a Symfony2 / Doctrine2 app and have installed and configured the Translatable extension provided by StofDoctrineExtensionsBundle using YAML, however no additional translation table(s) are generated and the following exception is thrown when attempting to work with entities that have translatable properties:

No mapping file found named ‘/var/www/my-project/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/Translation.orm.yml’ for class ‘Gedmo\Translatable\Entity\Translation’.

In more detail

I’m trying to get the Translatable extension working in my Symfony2 / Doctrine2 application that is provided by the StofDoctrineExtensionsBundle, however most of the available documentation I can find mainly targets the usage of annotations for configuration, but I’m going with YAML because that’s how I have configured everything else.

My configuration

I have added the following to my composer.json file and have ran the composer update command: "stof/doctrine-extensions-bundle": "dev-master" and the bundle is registered in my app/AppKernel.php file.

My app/config/config.yml file has the following configuration:

doctrine:
  orm:
    auto_generate_proxy_classes: %kernel.debug%
      auto_mapping: true        
      mappings:
        gedmo_translatable:
          type: yml
          prefix: Gedmo\Translatable\Entity
          dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity"
          alias: GedmoTranslatable
          is_bundle: false

stof_doctrine_extensions:
  default_locale: en_GB
  translation_fallback: true
  orm:
    default:
      timestampable: true
      translatable: true

I have then defined an entity in YAML:

Foo\ContentBundle\Entity\Article:
  type: entity
  repositoryClass: Foo\ContentBundle\Repository\ArticleRepository
  table: article
  gedmo:
    translation:
      locale: locale
  id:
    id:
      type: integer
      generator: { strategy: AUTO }
  fields:
    name:
      type: string
      length: 64
      gedmo:
        - translatable
    content:
      type: text
      gedmo:
        - translatable
    # ... #
  oneToMany:
    # ... #

I have then ran the console command php app/console doctrine:generate:entities FooContentBundle to generate the entity classes, and have manually added the locale property and setter:

class Article
{
    /* ... */
    private $locale;

    public function setTranslatableLocale($locale)
    {
        $this->locale = $locale;
    }
    /* ... */
}

After running php app/console doctrine:schema:update --force, my article table is created along with its associations, but nothing relating to translations (I’m assuming a table is supposed to be created for this…)

Then, when working with an entity that is translatable, I’m getting the exception:

No mapping file found named ‘/var/www/my-project/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/Translation.orm.yml’ for class ‘Gedmo\Translatable\Entity\Translation’.

The YAML file that the exception is referencing does not exist in the path that it’s looking for it within, neither could I find it anywhere else.

Does anyone have any ideas as to where I’m going wrong?

Update: After further investigation…

Running php app/console doctrine:mapping:info displays all of my entities and nothing relating to translations, however, if I update the gedmo_translatable: part of my app/config/config.yml file and change type: yml to type: annotation then run the command again, I get the following listed:

[OK]   Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation
[OK]   Gedmo\Translatable\Entity\Translation
[OK]   Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation

At which point, I can update my schema, and I have a new ext_translations table. However, nothing is being inserted into it when working with my entities, presumably because it’s now expecting configuration by annotation rather than YAML, changing my config back to type: yml starts throwing the exception again, as expected.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:06:52+00:00Added an answer on June 13, 2026 at 5:06 am

    After trying things that the documentation suggests will not work, i.e. mixing both annotation and YAML configurations in the same bundle, it would appear I have things working. The whole thing feels like a bug or an incomplete implementation, however I may be doing something incorrectly. Here’s what’s working…

    Setting the following in app/config/config.yml: doctrine.orm.mappings.gedmo_translatable.type: annotation

    Setting the translatable configuration in my YAML schema definition as outlined in my original question, as well as as an annotation in my class file:

    /* ... */
    use Gedmo\Mapping\Annotation as Gedmo;
    /* ... */
    class Article
    {
        /* ... */
    
        /**
         * @Gedmo\Translatable
         * @var string $name
         */
        private $name;
    
        /**
         * @Gedmo\Locale
         */
        private $locale;
    
        public function setTranslatableLocale($locale)
        {
            $this->locale = $locale;
        }
        /* ... */
    }
    

    After doing this, the additional table is created and translations are being inserted into it when persisting the entity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a nutshell, to give you an example, I basically have an app with
So in a nutshell, I have server set up using tcplistener / tcpclient, and
In a nutshell, I have the following table: I am using the reference to
In a nutshell, I have a solution that builds fine in the IDE, and
My controller, in a nutshell is this: chart1.SeriesCollection.Add(SC); using (MemoryStream ms = chart1.GetChartStream()) {
In a nutshell, what are pros and cons of using triggers in MySQL? Yet
In a nutshell , I want to have different faces for some types of
In a nutshell, the app looks up an instruction for something to do from
In a nutshell: Using jquery I want to get some xml output and use
Im using the PredicateBuilder as seen here http://www.albahari.com/nutshell/predicatebuilder.aspx , everything works great, and now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.