How to use Internationalization in models ? #3936
Unanswered
3adel-bassiony
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I want to use the internationalization feature in models, Let's say I have a backend app that supports 2 languages ( en & fr ) and I have a table for users and I created a column for gender, how I can localize the gender when returning the users list based on the locale sent in headers?
I don't know if it's the best approach or not, and I know I can make a map and return a new object or array but I think it will be better to make it in the model file, right?
Another way to make it is to return it and make the localization from the frontend side, but I think the first approach is the best
Beta Was this translation helpful? Give feedback.
All reactions