Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to achieve dynamic fallback_locale set #255

Open
noumansarwarr opened this issue Oct 24, 2022 · 0 comments
Open

how to achieve dynamic fallback_locale set #255

noumansarwarr opened this issue Oct 24, 2022 · 0 comments

Comments

@noumansarwarr
Copy link

I'm trying to achieve the following result:

The user of an app can fill entities in two languages (the app is in two languages)
If one language is not available the other one should be taken.

The fallback_locale setting allows me to set one as a fallback, i.e.

I have a user model with HasTranslations trait

public $translatable = ['fname', 'lname', 'short_info', 'address', 'detail'];

If the user signup in English local and then changes to Arabic it will show the user name as set in English (en) during sign up because fallback_locale is set to English (en)
but when the user signup Arabic(ar) locale and then change to English(en) it will not show the user name as set during signup in the Arabic(ar) locale because fallback_locale is set to en.

Is there a way to do this by setting fallback_locale dynamically?

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant