Skip to content

Instantly share code, notes, and snippets.

View mathjazz's full-sized avatar

Matjaž Horvat mathjazz

View GitHub Profile
diff --git a/pontoon/base/forms.py b/pontoon/base/forms.py
index 27e1aaa5d..4c393b2a0 100644
--- a/pontoon/base/forms.py
+++ b/pontoon/base/forms.py
@@ -107,33 +107,54 @@ class UserPermissionLogFormMixin:
group.user_set.clear()
- before_count = self.user.badges_promotion_count
- now = timezone.now()
@mathjazz
mathjazz / search-panel.diff
Created July 22, 2024 20:09
search-panel.diff
diff --git a/translate/src/modules/search/components/SearchBox.tsx b/translate/src/modules/search/components/SearchBox.tsx
index f4cd3c37d..06e533e80 100644
--- a/translate/src/modules/search/components/SearchBox.tsx
+++ b/translate/src/modules/search/components/SearchBox.tsx
@@ -21,6 +21,7 @@ import { getAuthorsAndTimeRangeData } from '../actions';
import { FILTERS_EXTRA, FILTERS_STATUS } from '../constants';
import { FiltersPanel } from './FiltersPanel';
+import { SearchPanel } from './SearchPanel';
import './SearchBox.css';
Sideshow:pontoon mathjazz$ git diff pontoon/
diff --git a/pontoon/contributors/utils.py b/pontoon/contributors/utils.py
index 840efcb42..6600252ae 100644
--- a/pontoon/contributors/utils.py
+++ b/pontoon/contributors/utils.py
@@ -381,14 +381,16 @@ def get_project_locale_contribution_counts(contributions_qs):
for item in (
contributions_qs.annotate(
+ month=TruncMonth("created_at"),
@mathjazz
mathjazz / email_script_lr_94.py
Created April 18, 2024 09:58
Email Mozilla L10n event: LR-94
"""
Send email to all users who submitted at least 5 translations that are now approved in the last 12 months.
"""
from django.core.mail import EmailMultiAlternatives
from pontoon.base.models import *
from datetime import datetime
MIN_COUNT = 5
START_DATE = datetime(2023,4,15)
@mathjazz
mathjazz / email_script_lr_83.py
Created March 15, 2024 12:27
Email Mozilla L10n event: LR-83
"""
Send email to all users who submitted at least 5 translations that are now approved in the last 12 months.
"""
from django.core.mail import EmailMultiAlternatives
from pontoon.base.models import *
from datetime import datetime
MIN_COUNT = 5
START_DATE = datetime(2023,3,15)
@mathjazz
mathjazz / patch.diff
Created November 20, 2023 17:55
Fix for the 404 error
diff --git a/pontoon/contributors/views.py b/pontoon/contributors/views.py
index f47656815..ffea38cff 100644
--- a/pontoon/contributors/views.py
+++ b/pontoon/contributors/views.py
@@ -312,24 +312,29 @@ def settings(request):
all_locales.insert(0, default_homepage_locale)
# Set custom homepage selector value
- custom_homepage_code = profile.custom_homepage
- custom_homepage_locale = get_locale_or_redirect(
@mathjazz
mathjazz / 2982.py
Created October 10, 2023 10:55
2982.py
[
(64906, "th", "<b>{0}</b> ชุดรูปแบบ"),
(
263159,
"vi",
'%(recent_unanswered_count)s câu hỏi trong 24 giờ qua chưa được trả lời. <a href="/contribute/forum">Tìm hiểu cách giải quyết chúng!</a>',
),
(
263159,
"ko",
>>> from google.cloud import translate_v3 as translate
>>>
>>> client = translate.TranslationServiceClient()
>>>
>>> project_id = "pontoon-prod"
>>> input_uri = "gs://pontoon-prod-model-data-c1107144/glossary.csv"
>>> timeout = 180
>>>
>>> source_lang_code = "en"
>>> target_lang_code = "sl"
# Glossary
Explanation of common terms and concepts used across documentation.
<!-- toc -->
## Comment
Comments can be used, for example, to discuss possible translations with other team members or request more information from project managers.
# Glossary
Explanation of common terms and concepts used across documentation.
<!-- toc -->
## Comment
Comments can be used, for example, to discuss possible translations with other team members or request more information from project managers.