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

Multilingual db update #132

Merged
merged 9 commits into from
Mar 22, 2024
Merged

Multilingual db update #132

merged 9 commits into from
Mar 22, 2024

Conversation

lickem22
Copy link
Contributor

@lickem22 lickem22 commented Mar 18, 2024

Reviewer: @amiraliemami

Estimate: 1h


Ticket

Fixes: AAQ-382

Description, Motivation and Context

Goal

This PR is the first official PR as part of the multilingual support. The goal is to add the language table as well as the routes to be able to run CRUD operations.

Changes

Added a language submodule with the following files:

  • schemas
  • routers
  • models
    Added tests for languages
    Also, since we are not planning on building a frontend for the languages yet, added english as the default language in the migration script.

How has this been tested?

This has been tested by manually testing the endpoints one by one and updating the tests.

Checklist

Fill with x for completed. Delete any lines that are not relevant

  • My code follows the style guidelines of this project
  • I have reviewed my own code to ensure good quality
  • I have tested the functionality of my code to ensure it works as intended
  • I have resolved merge conflicts
  • I have updated the automated tests (if applicable)
  • I have updated the requirements (if applicable)
  • [] I have updated the README file (if applicable)
  • I have updated affected documentation (if applicable)

@lickem22 lickem22 requested review from sidravi1, suzinyou and amiraliemami and removed request for suzinyou March 19, 2024 15:05
@lickem22 lickem22 changed the base branch from feature-multilingual to feature-multilingual_support March 19, 2024 15:18
@lickem22 lickem22 changed the title Multilingual/db Multilingual db update Mar 19, 2024
@lickem22 lickem22 marked this pull request as ready for review March 19, 2024 15:20
@lickem22 lickem22 requested a review from suzinyou March 19, 2024 15:21
@lickem22 lickem22 changed the base branch from feature-multilingual_support to feature-multilingual March 21, 2024 08:32
@amiraliemami amiraliemami self-requested a review March 21, 2024 12:20
Copy link
Collaborator

@amiraliemami amiraliemami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@amiraliemami amiraliemami self-requested a review March 21, 2024 12:22
Copy link
Collaborator

@amiraliemami amiraliemami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - really nice code and logic and tests!

Two points re. default language:

  • Check out the comment on the "edit_language" router - I think that should be fixed to avoid causing a situation where there is no default language.
  • Maybe we also add some logic onto the "create_language" endpoint to ensure there is always a default language?

@amiraliemami amiraliemami dismissed their stale review March 21, 2024 12:23

Self-dismiss

@lickem22
Copy link
Contributor Author

Thanks for this - really nice code and logic and tests!

Two points re. default language:

  • Check out the comment on the "edit_language" router - I think that should be fixed to avoid causing a situation where there is no default language.
  • Maybe we also add some logic onto the "create_language" endpoint to ensure there is always a default language?

About checking for a default language, we are already adding a default language in the migrations, so it shouldn't be an issue. So I suggest we keep it like this now and when we will build the language for frontend we will add the logic, by for example creating the language at launch if there is no language in the DB.

@amiraliemami amiraliemami self-requested a review March 21, 2024 16:10
Copy link
Collaborator

@amiraliemami amiraliemami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes!

@lickem22 lickem22 merged commit 60dc360 into feature-multilingual Mar 22, 2024
3 checks passed
lickem22 added a commit that referenced this pull request Apr 11, 2024
* Add language table and routes as well as tests

* Add english as default language in migration

* Fix typos

* Update core_backend/migrations/versions/1ff08438751b_add_language_table.py

Co-authored-by: Amir Emami <[email protected]>

* Update core_backend/app/languages/models.py

Co-authored-by: Amir Emami <[email protected]>

* Update core_backend/app/languages/schemas.py

Co-authored-by: Amir Emami <[email protected]>

* Fix comments

* Fix typos

---------

Co-authored-by: Amir Emami <[email protected]>
@lickem22 lickem22 deleted the multilingual/db branch April 25, 2024 13:23
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