Jump to content

[Symfony2] Translatable bundle and safest multilingual approach


Recommended Posts

Hi all,


I have developed a website for a personal project in a specific language on Symfony2. It usually takes a long time for everything to program because I like to follow safe approaches in developing code, even If it's the silliest things. My plan now, is to implement my directory business website - let's say musical instrument companies - so that everyone from all over the world could create an account and register their business.


What I have done, is that I have implemented everything from scratch: A Security bundle, some basic entities like Business {name, location, phone, email, information, etc.}, BusinessCategory {name, information etc.} and some custom but simple relationships between them. The user can successfully register for an account and then register their business. I have also implemented translations for every word or phrase that is being shown on the website by using a locale in config.yml and some custom translations for English and let's say Chinese or Spanish. The user can click on a link "English" or "Spanish" and everything gets translated to selected language and the website alias changes from website.com/en to website.com/es.


My next steps are:

- I want the user to be able to register in English or Spanish. Right now, there is only one entry for that Business in the mysql database and translations exist only for the website text. I want the user to be able to enter the English data and the Spanish data for the same fields for example the "name" of the business, the address etc. That will need possibly 2 entries with a different locale and the same business.


- I want the website to align with label translations currently existing with the user's translations. This means that when you choose "spanish" you will get everything translated in Spanish AND the Spanish row for that business. 


- I want to use the domains I have purchased for language If possible: Website.com, Website.es, Website.it etc. I would like someone to enter website.it in the address bar of the browser and get automatically everything in Italian. 


My main concerns are:

- If I use the translatable bundle, an additional row will be created for every business. How will they be connected? I mean, the X business with an ID 1234 will be in Spanish and the same one with name translated to Y will have an ID 1235. How will symfony2 know that these two businesses are the same one in a different locale ?


- What will happen to the joined tables? The User table is linked to the Business table which is linked to the Group table. If I use the translatable extension for the Business table only, how will it affect the other ones ?


Thanks for reading !




Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.