-
Notifications
You must be signed in to change notification settings - Fork 321
saving translation records #43
Comments
I am asking this because I have an entity "Page", for which I want translations in 3 different locales. Current setup: In my app config I have set the locales:
And In my pagecontroller I create a new page: |
It only adds a record in your model's translations table for the current locale. Why would you want it to add empty records for the other locales? |
Thank you very much for your answer. Now I know this is default behaviour. To answer yours: It would be handy if the empty records for each locale were already available right after the user created the page. |
You can still do that by using the translate() method mentioned in the documentation. Like this:
In the form the user is taken to after creating a page you could then make specific fields and save them per locale. For example:
Then in your controller you translate the correct field:
|
Hey @nexana, you don't need empty db records to show empty input forms. Laravel-translatable only adds db records for translations that are defined. Cheers |
Does the package automatically create records in the translation table when an entity is first saved?
Or should I handle this manually?
A user on stackoverflow asked a similar question:
http://stackoverflow.com/questions/25409328/laravel4-manage-translation-in-db
Thank you!
The text was updated successfully, but these errors were encountered: