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

  • SEARCH
  • Home
  • 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 7653653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:04:40+00:00 2026-05-31T12:04:40+00:00

I have a multilingual website with 2 languages: en (default) and de (german). I

  • 0

I have a multilingual website with 2 languages: en (default) and de (german).

I want to fill my categories table with default categories in english, using Doctrine Fixtures like this:

    $subcategory1 = new Category();
    $subcategory1->setTitle('Comedy');
    $subcategory1->setParent($category);
    $subcategory2 = new Category();
    $subcategory2->setTitle('Action');
    $manager->persist($subcategory1);
    $manager->persist($subcategory2);
    $manager->flush();

I am using Doctrine extension translatable to have the table content also in german. If I have to do it manually I have to do in symfony:

    $em = $this->getDoctrine()->getEntityManager();
    $category = $em->find('Tracker\MembersBundle\Entity\Category', 51 );
    $category->setTitle('Komödie');
    $category->setTranslatableLocale('de'); // change locale
    $em->persist($category);
    $em->flush();

My question is how can I automate this process to make it work while loading fixtures? I have about 30 categories.

  • 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-05-31T12:04:41+00:00Added an answer on May 31, 2026 at 12:04 pm

    Try this method:

    $subcategory1 = new Category();
    $subcategory1->setTitle('Comedy');
    $subcategory1->setParent($category);
    $subcategory2 = new Category();
    $subcategory2->setTitle('Action');
    
    $manager->persist($subcategory1);
    $manager->persist($subcategory2);
    $manager->flush();
    
    $subcategory1->setTranslatableLocale('de_DE');
    $subcategory1->setTitle('ComedyDE');
    $subcategorys->setTranslatableLocale('de_DE');
    $subcategory2->setTitle('ActionDE');
    $manager->flush();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multilingual website (Chinese and English). I like to validate a text
I have a multilingual website with the possibility to switch between German and English.
I'm writing multilingual website. I have several files on server like: /index.php /files.php /funny.php
Hi i have develop and deploy one multilingual (english uk and swedish) website at
I am implementing an multilingual web site using ASP.Net. The languages are English,French and
I want to make multilingual buttons, like those of the messagebuttons. I have a
I was asked to create a multilingual website in both English and Arabic languages
We are now using Django to develop a multilingual website. We have different language
I'm building a multilingual website. I've been thinking about using a single table for
I want to make a multi-lingual website that defaults to English like example.com with

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.