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

Default language on user-account-edit differs from application default #2362

Closed
xsrust opened this issue Jan 24, 2020 · 5 comments
Closed

Default language on user-account-edit differs from application default #2362

xsrust opened this issue Jan 24, 2020 · 5 comments
Assignees
Labels

Comments

@xsrust
Copy link
Contributor

xsrust commented Jan 24, 2020

When a new user to the tool first updates their profile, the language box will default to the first returned from the database.

Our logic for this page's default language is:
current_user.language.nil? ? Language.id_for(FastGettext.default_locale) : current_user.language.id

The id_for function is defined as:
Language.where(abbreviation: abbreviation).pluck(:id).first

@xsrust xsrust added the bug label Jan 24, 2020
@xsrust xsrust self-assigned this Jan 24, 2020
@xsrust
Copy link
Contributor Author

xsrust commented Jan 24, 2020

It looks like this is once-again due to the fast-get-text vs i18n discrepancy in naming schemes
the default_locale according to gettext is en_GB, whereas the abbreviation is en-GB.

Given we have a Language.default column in the database, I'm going to swap to pulling this in, rather than attempting to use the language configured in Gettext.

@magdalenadrafiova
Copy link

I am not sure whether this is the desired behaviour
image

@magdalenadrafiova magdalenadrafiova moved this from UAT to In progress in Current sprint Feb 4, 2020
@magdalenadrafiova
Copy link

sam to look at still

@xsrust xsrust moved this from In progress to Review in Current sprint Feb 11, 2020
@xsrust xsrust moved this from Review to UAT in Current sprint Feb 11, 2020
@magdalenadrafiova
Copy link

works well - thank you - created new account and the language was this time set up as English
image

@sjDCC
Copy link
Contributor

sjDCC commented Feb 14, 2020

Good for me

@mariapraetzellis mariapraetzellis removed this from UAT in Current sprint Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants