prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  No way to set default notification setting for watched projects
  ### Describe the issue
  
  Thanks for this great project. On the notifications part there is some room for improvements as when you come from transifex, you get a lot of useful notifications which encourage user to finish the translation of a language when stuff changes. Would it be possible to set some defaults for the "New translation component was created" and "New string is available for translation" settings. As IMO for these settings an instant notification should be sent out. Probably some more would be nice too.
  
  ### I already tried
  
  - [X] I've read and searched [the documentation](https://docs.weblate.org/).
  - [X] I've searched for similar issues in this repository.
  
  ### Steps to reproduce the behavior
  
  1. Got to /accounts/profile/#notifications__1
  2. Check the component and translation notifications
  
  ### Expected behavior
  
  Some default settings to adjust, either in the GUI or by configuration variable.
  
  ### Screenshots
  
  _No response_
  
  ### Exception traceback
  
  _No response_
  
  ### How do you run Weblate?
  
  Docker container
  
  ### Weblate versions
  
  _No response_
  
  ### Weblate deploy checks
  
  _No response_
  
  ### Additional context
  
  Kind of related to #5155.
  
  </issue>
  <code>
  [start of weblate/accounts/data.py]
  1 # Copyright © Michal Čihař <michal@weblate.org>
  2 #
  3 # SPDX-License-Identifier: GPL-3.0-or-later
  4 
  5 from weblate.accounts.notifications import (
  6     FREQ_INSTANT,
  7     SCOPE_ADMIN,
  8     SCOPE_ALL,
  9     SCOPE_WATCHED,
  10 )
  11 
  12 DEFAULT_NOTIFICATIONS = [
  13     (SCOPE_ALL, FREQ_INSTANT, "MentionCommentNotificaton"),
  14     (SCOPE_WATCHED, FREQ_INSTANT, "LastAuthorCommentNotificaton"),
  15     (SCOPE_WATCHED, FREQ_INSTANT, "MentionCommentNotificaton"),
  16     (SCOPE_WATCHED, FREQ_INSTANT, "NewAnnouncementNotificaton"),
  17     (SCOPE_ADMIN, FREQ_INSTANT, "MergeFailureNotification"),
  18     (SCOPE_ADMIN, FREQ_INSTANT, "ParseErrorNotification"),
  19     (SCOPE_ADMIN, FREQ_INSTANT, "NewTranslationNotificaton"),
  20     (SCOPE_ADMIN, FREQ_INSTANT, "NewAlertNotificaton"),
  21     (SCOPE_ADMIN, FREQ_INSTANT, "NewAnnouncementNotificaton"),
  22 ]
  23 
  24 
  25 def create_default_notifications(user) -> None:
  26     for scope, frequency, notification in DEFAULT_NOTIFICATIONS:
  27         user.subscription_set.get_or_create(
  28             scope=scope, notification=notification, defaults={"frequency": frequency}
  29         )
  30
  [end of weblate/accounts/data.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/weblate/accounts/data.py b/weblate/accounts/data.py
  --- a/weblate/accounts/data.py
  +++ b/weblate/accounts/data.py
  @@ -4,6 +4,7 @@
   
   from weblate.accounts.notifications import (
       FREQ_INSTANT,
  +    FREQ_WEEKLY,
       SCOPE_ADMIN,
       SCOPE_ALL,
       SCOPE_WATCHED,
  @@ -14,6 +15,7 @@
       (SCOPE_WATCHED, FREQ_INSTANT, "LastAuthorCommentNotificaton"),
       (SCOPE_WATCHED, FREQ_INSTANT, "MentionCommentNotificaton"),
       (SCOPE_WATCHED, FREQ_INSTANT, "NewAnnouncementNotificaton"),
  +    (SCOPE_WATCHED, FREQ_WEEKLY, "NewStringNotificaton"),
       (SCOPE_ADMIN, FREQ_INSTANT, "MergeFailureNotification"),
       (SCOPE_ADMIN, FREQ_INSTANT, "ParseErrorNotification"),
       (SCOPE_ADMIN, FREQ_INSTANT, "NewTranslationNotificaton"),
  
verification_info: {"golden_diff": "diff --git a/weblate/accounts/data.py b/weblate/accounts/data.py\n--- a/weblate/accounts/data.py\n+++ b/weblate/accounts/data.py\n@@ -4,6 +4,7 @@\n \n from weblate.accounts.notifications import (\n     FREQ_INSTANT,\n+    FREQ_WEEKLY,\n     SCOPE_ADMIN,\n     SCOPE_ALL,\n     SCOPE_WATCHED,\n@@ -14,6 +15,7 @@\n     (SCOPE_WATCHED, FREQ_INSTANT, \"LastAuthorCommentNotificaton\"),\n     (SCOPE_WATCHED, FREQ_INSTANT, \"MentionCommentNotificaton\"),\n     (SCOPE_WATCHED, FREQ_INSTANT, \"NewAnnouncementNotificaton\"),\n+    (SCOPE_WATCHED, FREQ_WEEKLY, \"NewStringNotificaton\"),\n     (SCOPE_ADMIN, FREQ_INSTANT, \"MergeFailureNotification\"),\n     (SCOPE_ADMIN, FREQ_INSTANT, \"ParseErrorNotification\"),\n     (SCOPE_ADMIN, FREQ_INSTANT, \"NewTranslationNotificaton\"),\n", "issue": "No way to set default notification setting for watched projects\n### Describe the issue\n\nThanks for this great project. On the notifications part there is some room for improvements as when you come from transifex, you get a lot of useful notifications which encourage user to finish the translation of a language when stuff changes. Would it be possible to set some defaults for the \"New translation component was created\" and \"New string is available for translation\" settings. As IMO for these settings an instant notification should be sent out. Probably some more would be nice too.\n\n### I already tried\n\n- [X] I've read and searched [the documentation](https://docs.weblate.org/).\n- [X] I've searched for similar issues in this repository.\n\n### Steps to reproduce the behavior\n\n1. Got to /accounts/profile/#notifications__1\r\n2. Check the component and translation notifications\n\n### Expected behavior\n\nSome default settings to adjust, either in the GUI or by configuration variable.\n\n### Screenshots\n\n_No response_\n\n### Exception traceback\n\n_No response_\n\n### How do you run Weblate?\n\nDocker container\n\n### Weblate versions\n\n_No response_\n\n### Weblate deploy checks\n\n_No response_\n\n### Additional context\n\nKind of related to #5155.\n", "before_files": [{"content": "# Copyright \u00a9 Michal \u010ciha\u0159 <michal@weblate.org>\n#\n# SPDX-License-Identifier: GPL-3.0-or-later\n\nfrom weblate.accounts.notifications import (\n    FREQ_INSTANT,\n    SCOPE_ADMIN,\n    SCOPE_ALL,\n    SCOPE_WATCHED,\n)\n\nDEFAULT_NOTIFICATIONS = [\n    (SCOPE_ALL, FREQ_INSTANT, \"MentionCommentNotificaton\"),\n    (SCOPE_WATCHED, FREQ_INSTANT, \"LastAuthorCommentNotificaton\"),\n    (SCOPE_WATCHED, FREQ_INSTANT, \"MentionCommentNotificaton\"),\n    (SCOPE_WATCHED, FREQ_INSTANT, \"NewAnnouncementNotificaton\"),\n    (SCOPE_ADMIN, FREQ_INSTANT, \"MergeFailureNotification\"),\n    (SCOPE_ADMIN, FREQ_INSTANT, \"ParseErrorNotification\"),\n    (SCOPE_ADMIN, FREQ_INSTANT, \"NewTranslationNotificaton\"),\n    (SCOPE_ADMIN, FREQ_INSTANT, \"NewAlertNotificaton\"),\n    (SCOPE_ADMIN, FREQ_INSTANT, \"NewAnnouncementNotificaton\"),\n]\n\n\ndef create_default_notifications(user) -> None:\n    for scope, frequency, notification in DEFAULT_NOTIFICATIONS:\n        user.subscription_set.get_or_create(\n            scope=scope, notification=notification, defaults={\"frequency\": frequency}\n        )\n", "path": "weblate/accounts/data.py"}]}