Skip to content

bug: user_language and pref_language columns too short for multi part language codes #78

@ryaverma

Description

@ryaverma

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

  1. Log in to the tool
  2. Select Chinese Simplified, zh-hans, from the language dropdown
  3. Refresh the page
  4. Language stays English instead of staying as zh-hans
  5. 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.

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions