Open MVrachev opened 4 years ago
The question is do we have information about the nationality of ever user of PyPI?
We don't currently have this information. Presumably when a logged-in user selects a locale, we could store it along with their other account details:
This would probably also require some changes to how we determine the locale based on the request, to take this new attribute into account.
This would probably also require some changes to how we determine the locale based on the request, to take this new attribute into account.
By this I actually mean, how we determine for the locale for the localizer when translating emails, since right now it is based on the request, but it will need to use the attribute on the user who the email is being sent to instead. We'd likely need to construct new localizers for each user with this attribute. We do something similar here:
Thanks @miketheman for pointing me here.
Unless I'm missing something, the preferred language of the users is not defined in the models.
Is there any other way to do this than adding a field to the model? (e.g. is there somewhere this information is already being stored?)
A few days ago, I received an email notification in Russian, the language of my collaborator, rather than my preferred language, English:
I got the gist from the non-translated subject (missing translation?) and Google Translate helped me verify, but it was surprising.
What's the problem this feature will solve? While I was working to add email notifications for project/release removed we had a discussion that translation of those emails can't be used because the nationality of the initiator of that action could be different from that of the receiver. For example if the initiator of the project removal is from Spain that doesn't mean that the rest of the contributors of that package will speak spanish.
Read more about that discussion here: https://github.com/pypa/warehouse/pull/7530#issuecomment-598897978
Describe the solution you'd like
I propose to use the receiver nationality when deciding what language to use in the emails. That seems logical solution to me as we are doing just that in our daily lives - in our social interactions with other people we choose our language of communication based on the language spoken from the other person.
That way we would be able to translate the emails which are aimed for groups of people.
The question is, do we have information about the nationality of every user of PyPI?