Skip to content

Instantly share code, notes, and snippets.

View mathjazz's full-sized avatar

Matjaž Horvat mathjazz

View GitHub Profile
@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.
@mathjazz
mathjazz / gist:13aaeb2b00476c4802063a7cc7415957
Created May 10, 2023 09:56
Pretranslated strings for Italian Firefox Monitor Website
old_string
new_string
link_to_old_string
link_to_new_string
---------------------
breach-description = In data { $breachDate }, { $companyName } è stata violata. Una volta scoperta e verificata la violazione, è stata aggiunta al nostro database il { $addedDate }. Questa violazione includeva: { $dataClasses }
breach-description = Il { $breachDate }, { $companyName } è stato violato. Una volta scoperta e verificata la violazione, è stata aggiunta al nostro database il { $addedDate }. Questa violazione includeva: { $dataClasses }
diff --git a/translate/public/locale/en-US/translate.ftl b/translate/public/locale/en-US/translate.ftl
index 3c27702d9..d75b9b271 100644
--- a/translate/public/locale/en-US/translate.ftl
+++ b/translate/public/locale/en-US/translate.ftl
@@ -209,7 +209,7 @@ editor-KeyboardShortcuts--copy-from-next-helper-shortcut = <mod1>Ctrl</mod1> + <
## Editor machinery source indicator
## Shown when a perfect match is provided automatically from translation memory
-editor-MachinerySourceIndicator--text = Perfect match from translation memory
+editor-MachinerySourceIndicator--text = <stress>100%</stress> MATCH FROM TRANSLATION MEMORY
{
"data": {
"firefox": {
"localizations": [{
"locale": {
"code": "el"
}
}, {
"locale": {
"code": "he"