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

feat(Notifications): Added translation notifications #11712

Merged
merged 26 commits into from
Jun 24, 2024

Conversation

JoaoCodificacoes
Copy link
Contributor

Proposed changes

Added a new notification for:

  • when all the languages in component are translated.
  • when a language is translated.

Addresses: #4294 and #11215

Checklist

  • [x ] Lint and unit tests pass locally with my changes.
  • [x ] I have added tests that prove my fix is effective or that my feature works.
  • I have added documentation to describe my feature.
  • [x ] I have squashed my commits into logic units.
  • [x ] I have described the changes in the commit messages.

@JoaoCodificacoes
Copy link
Contributor Author

Hey, is there something else that needs to be done?

Added a new notification for:
- when all the languages in component are translated.
- when a language is translated.

Addresses: WeblateOrg#4294 and WeblateOrg#11215

Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt>
weblate/trans/tasks.py Outdated Show resolved Hide resolved
weblate/trans/tasks.py Outdated Show resolved Hide resolved
weblate/accounts/notifications.py Outdated Show resolved Hide resolved
weblate/accounts/tests/test_notifications.py Outdated Show resolved Hide resolved
weblate/templates/mail/translated_language.html Outdated Show resolved Hide resolved
weblate/templates/mail/translated_language.html Outdated Show resolved Hide resolved
weblate/trans/tasks.py Outdated Show resolved Hide resolved
@nijel nijel added this to the 5.7 milestone Jun 18, 2024
JoaoCodificacoes and others added 6 commits June 18, 2024 23:42
Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt>
Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt>
…me scope as global

Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt>
…onent

Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt>
…caton

Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt>
Copy link
Member

@nijel nijel left a comment

Choose a reason for hiding this comment

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

Thanks, looks better now. There is also missing database migration, see https://github.com/WeblateOrg/weblate/actions/runs/9573747553/job/26395745226?pr=11712

weblate/accounts/tests/test_views.py Show resolved Hide resolved
weblate/accounts/tests/test_notifications.py Outdated Show resolved Hide resolved
weblate/accounts/tests/test_notifications.py Outdated Show resolved Hide resolved
@nijel nijel requested a review from orangesunny June 19, 2024 07:28
@nijel
Copy link
Member

nijel commented Jun 19, 2024

@orangesunny Can you please review texts in the notifications?

@orangesunny
Copy link
Member

sure

JoaoCodificacoes and others added 4 commits June 19, 2024 12:36
Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt>
Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt>
Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt>
Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt>
@JoaoCodificacoes
Copy link
Contributor Author

Thanks, looks better now. There is also missing database migration, see https://github.com/WeblateOrg/weblate/actions/runs/9573747553/job/26395745226?pr=11712

Thanks for the help, we were wondering if we could get some help with the migrations, do they also need to be added in accounts/data.py ?

@nijel
Copy link
Member

nijel commented Jun 19, 2024

Avoid manual changes in the migration files and just run ./manage.py makemigrations. That will create the two needed migrations. See https://docs.djangoproject.com/en/5.0/topics/migrations/ for more info on the topic.

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.61%. Comparing base (6aee586) to head (24dcbae).
Report is 2285 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11712      +/-   ##
==========================================
- Coverage   90.82%   90.61%   -0.21%     
==========================================
  Files         554      579      +25     
  Lines       57306    58854    +1548     
  Branches     9122     9396     +274     
==========================================
+ Hits        52046    53329    +1283     
- Misses       3640     3832     +192     
- Partials     1620     1693      +73     
Files Coverage Δ
...migrations/0011_alter_subscription_notification.py 100.00% <100.00%> (ø)
weblate/accounts/notifications.py 95.85% <100.00%> (+0.13%) ⬆️
weblate/accounts/tests/test_notifications.py 100.00% <100.00%> (ø)
weblate/accounts/tests/test_views.py 100.00% <ø> (ø)
...blate/trans/migrations/0019_alter_change_action.py 100.00% <100.00%> (ø)
weblate/trans/models/change.py 82.26% <100.00%> (+3.25%) ⬆️
weblate/trans/tasks.py 69.23% <33.33%> (-3.11%) ⬇️

... and 325 files with indirect coverage changes

@JoaoCodificacoes
Copy link
Contributor Author

Avoid manual changes in the migration files and just run ./manage.py makemigrations. That will create the two needed migrations. See https://docs.djangoproject.com/en/5.0/topics/migrations/ for more info on the topic.

Alright, thanks for the help.

Copy link
Member

@orangesunny orangesunny left a comment

Choose a reason for hiding this comment

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

Subjects of the notifications are fine

weblate/trans/tasks.py Outdated Show resolved Hide resolved
@nijel nijel enabled auto-merge (squash) June 24, 2024 13:08
@nijel nijel merged commit 8462ccc into WeblateOrg:main Jun 24, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants