Comments (4)
Because the locale of the email is set to the person deleting. ADDON_TYPE is localised here: https://github.com/mozilla/olympia/blob/master/apps/constants/base.py#L161-L172
What you want to do is make everything in the email be in en-US. There is an activate_lang
context manager on the user that does something very similar to this. What might work is to make that accept an argument and then do something like:
with request.user.activate_lang('en-US'):
... send email
Then after the email has been sent, everything will continue in the users locale.
from addons.
Thanks Andy, that was very helpful!
from addons.
Prerequisites:
--- a/apps/amo/utils.py
+++ b/apps/amo/utils.py
@@ -164,6 +164,9 @@ def send_mail(subject, message, from_email=None, recipient_list=None,
from amo.tasks import send_email
import users.notifications as notifications
+ import ipdb; ipdb.set_trace()
+
if not recipient_list:
return True
How to test the patch:
- Set the default locale in your user profile to a language that you know has the word "extension" localized, e.g. "German".
- Upload a new add-on
- Go to the developer hub -> Status and Versions
- Delete your add-on.
When ipdb pauses, inspect subject
or message
.
Current result:
Deleting ERWEITERUNG ...
Expected result:
Deleting EXTENSION...
from addons.
Here are STRs that don't require modifying the code:
1/ set your locale to be something different than english (eg german)
2/ go to the devhub and delete the add-on
3/ check the "fake mails" (using /en-us/admin/mail
): the mail subject and content should contain something like Deleting EXTENSION <extension> (<extension id>)
: the EXTENSION
word shouldn't be localized (and nothing else should be localized either)
from addons.
Related Issues (20)
- add deployment environment with approval protections to release job
- [Bug]: Skip github pages configure on forks
- [Bug]: Cannot upload addons [STAGE][DEV] HOT 2
- [Bug]: Compatible versions of GNOME browser extension are not offered to Firefox 115 ESR users HOT 1
- [Bug]: add abuse report in front of the text? HOT 3
- [Bug]: Hashin doesn't work out of the box
- [Bug]: ReviewerActionReason has invalid validation rules HOT 2
- Firefox Web Browser 128.02 [Bug]: HOT 1
- [Bug]: Cannot submit an abuse report HOT 3
- [Bug]: Cannot delete a scanner query rule that has many results HOT 3
- [Task]: Store full add-on manifest in the database HOT 2
- [Task]: Ability to Modify a Pending Rejection Date HOT 4
- [Task]: Review Queue Filtering for DSA Abuse Reports HOT 3
- [Task]: Improve due date update on reviewer tools page HOT 1
- [Task]: Show all authors in top author list on the review page HOT 1
- [Task]: Show all authors in top author list on the review page
- [Task]: Always show add-on status in the top list of metadata on the review page
- [Bug]: Verified search filter option in Badging filter is not relevant HOT 1
- [Task]: Add ability to add/update addon privacy policies HOT 3
- [Task]: Auto-close new abuse reports if the add-on is already disabled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from addons.