Closed davymaish closed 1 year ago
This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days
You can use the "find any translation" mechanism by setting fallback_locale
to null
.
https://docs.astrotomic.info/laravel-translatable/package/fallback-locale#app-wide
This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days
Hi thank you for the wonderful package.
Is there a way in which i can change the fallback locale of translation as per the model instead of a global configuration.
My application is used by different users using different locale. Example default fallback locale in the configuration is 'en'. A post is created by a writer in 'es' locale. Another user reads the post in 'fr' locale. The application displays nothing to the reader as both 'fr' (the users locale) and 'en' (the fallback locale ) are not saved in the database. I would like to set the fallback locale to be set as per the post in which the fallback locae to be the original locale the post was written in. How can i set the fallback locale to be dependent to the model?
My idea was to have a column on the Post Model to hold the actual locale in which the post was created and point the fallback locale to point to that column in the event both reader user locale and config fallback locale are not define in the database.
Thank you in advance