Waavi/translation

Overriding current locale to fetch localized model attributes in specific language

NaLogo opened this issue · 1 comments

How do I fetch translated attributes of a model in a specific language which is not the currently selected locale?

Example: A user is currently browsing the site in English and they want to use a custom form to enter new/updated non-English translations for a model. How do I provide the current, non-English attributes?

I'm gonna close this as I have found a solution.

In case you're wondering:
I have extended the Translatable trait (by using it in another trait which I'm then using for my models) to allow easy fetching of an attribute in a specific language by making use of the Translation repository in conjunction with translationCodeFor().