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

Use user locale preferences in view, allow multiple locales #1702

Merged
merged 10 commits into from
Nov 14, 2023

Conversation

emmiegit
Copy link
Member

One design goal is to allow multi-lingual users to specify multiple locales (in a specific order) that they want to see used if a previous locale is not available, so this change both uses the locales specified by the user in the localization order before using the browser Accept-Language setting, and changes the database so that the user.locales column is TEXT[] instead of TEXT.

This also requires that messages pass in a locale they want the message to be rendered as, since with multiple locales per user, we cannot assume any particular one in message drafting.

This does not address the case where the user is not logged in and there is no Accept-Language header, which will need to be fixed in another PR.

@emmiegit emmiegit self-assigned this Nov 13, 2023
Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Merging #1702 (cdaeccc) into develop (e623ac2) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

❗ Current head cdaeccc differs from pull request most recent head c01950d. Consider uploading reports for the commit c01950d to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1702      +/-   ##
===========================================
- Coverage    39.59%   39.55%   -0.05%     
===========================================
  Files          343      343              
  Lines        10975    10990      +15     
===========================================
+ Hits          4346     4347       +1     
- Misses        6629     6643      +14     
Flag Coverage Δ *Carryforward flag
deepwell 2.02% <0.00%> (+0.01%) ⬆️
ftml 76.83% <ø> (ø) Carriedforward from e623ac2

*This pull request uses carry forward flags. Click here to find out more.

Files Coverage Δ
deepwell/src/database/seeder/data.rs 0.00% <ø> (ø)
deepwell/src/models/user.rs 0.00% <ø> (ø)
deepwell/src/services/import/service.rs 0.00% <ø> (ø)
deepwell/src/services/message/structs.rs 100.00% <ø> (ø)
deepwell/src/database/seeder/mod.rs 0.00% <0.00%> (ø)
deepwell/src/endpoints/user_bot.rs 0.00% <0.00%> (ø)
deepwell/src/services/site/service.rs 0.00% <0.00%> (ø)
deepwell/src/services/message/service.rs 0.00% <0.00%> (ø)
deepwell/src/services/user/service.rs 0.00% <0.00%> (ø)
deepwell/src/services/view/service.rs 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@emmiegit
Copy link
Member Author

thanks @Yossipossi1

@emmiegit emmiegit merged commit 39c9ea6 into develop Nov 14, 2023
6 checks passed
@emmiegit emmiegit deleted the user-accept-language branch November 14, 2023 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants