Description
The user_language and pref_language columns in model.py are both defined as String(4), which can only store 4 characters. However, several supported language codes in the i18n folder are longer than 4 characters, ex. zh-hans, zh-hant, pt-br, sr-ec, etc.
Steps to Reproduce
- Log in to the tool
- Select Chinese Simplified, zh-hans, from the language dropdown
- Refresh the page
- Language stays English instead of staying as zh-hans
- Do the same thing with some other language, ex. Italian, it changes from English to Italian
Fix
Increase both column sizes in model.py from String(4) to String(20) and create a database migration.
Discovery
Found while investigating issue #39 (add translated languages to tool) and reviewing the database schema in model.py.

Description
The user_language and pref_language columns in model.py are both defined as String(4), which can only store 4 characters. However, several supported language codes in the i18n folder are longer than 4 characters, ex. zh-hans, zh-hant, pt-br, sr-ec, etc.
Steps to Reproduce
Fix
Increase both column sizes in model.py from String(4) to String(20) and create a database migration.
Discovery
Found while investigating issue #39 (add translated languages to tool) and reviewing the database schema in model.py.