i m a noob and trying to figure out the best database design to :
store the user langage preference (en / fr / es / etc)
i have a user table, wich store the data like : email, sign in dates, etc
i am wondering if i should :
A. store the user language in this same table as a new column lang in a string format “en”
B. create a language table and insert there :
1 – en
2 – fr
3 – es
then make a reference to that table in my main user table, in a new column lang in Int format “1”
I guess it is a basic question, but that would help me understand best practice in database design, and get a good start in my learning.
Thanks in advance for all your advices and replies.
I would use a separate table, because you will probably want to store more data about the language then just the language code. For example, the full language name (for the language select box), ISO country codes, path to a flag image perhaps, or an index into a translation system for fetching the associated user interface strings.