pybr2012-site icon indicating copy to clipboard operation
pybr2012-site copied to clipboard

Translation of emails template from subscription app.

Open fernandogrd opened this issue 12 years ago • 9 comments

Review needed.

fernandogrd avatar Jun 05 '12 07:06 fernandogrd

Not sure yet if it will work as is, I need to check.

+@tatiana

fsouza avatar Jun 05 '12 13:06 fsouza

Thanks, @fernandogrd! We still need to provide support to emails i18n. Recording the user's local preference might be an alternative... Any thoughts, @fsouza?

tatiana avatar Jun 25 '12 02:06 tatiana

In my manual local tests, it works 'out of the box'. If I choose English in menu and access a view that sends e-mail. I receive it in English, If I choose Portuguese in menu, I receive it in Portuguese.

I don't know how it works, but I did nothing, nor passing ContextRequest, or using the translation api.

fernandogrd avatar Jun 26 '12 18:06 fernandogrd

s/ContextRequest/RequestContext/

fernandogrd avatar Jun 26 '12 18:06 fernandogrd

The point is that this request does not come from a user, but from PagSeguro.

We would need to store the user preference about the page language, so when PagSeguro sends a notification to us we know which language to use.

fsouza avatar Jun 26 '12 21:06 fsouza

Hum, I see now. What would be best?

I thought about a field in AccountProfile to be updated when user log-in (via signal), using the current idiom, the one identified by Django. This would be transparent for the user and will keep things working as it is now.

Other option is give user more control, showing preference in user panel and always respect it, eg: Change to user defined idiom at login, even if current idiom (identified by django) is other.

fernandogrd avatar Jun 26 '12 23:06 fernandogrd

when the user log in or every time he changes the page language?

Not sure yet what is the best approach.

fsouza avatar Jun 27 '12 14:06 fsouza

I think maybe is just better to store the language only when user start the process of subscription. Every login seems a waste of resources.. and the system works well as it is.

fernandogrd avatar Jun 27 '12 15:06 fernandogrd

@fernandogrd but what would happen if at that exact moment the user weren't using his/her prefered locale? Perhaps @fsouza proposal of changing when the language choice changes is better.

tatiana avatar Jun 27 '12 19:06 tatiana