For example. When a invoice gets send through CA (uc_checkout_customer_notification). The subject does not get translated to the current users language. Instead it uses the main language of the site.
Hope someone can shed some light on this.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 415712_mail_language.patch | 8.76 KB | Island Usurper |
| #3 | 415712.mail_language.2.x.patch | 9.04 KB | cha0s |
| #1 | 415712.account_language.2.x.patch | 966 bytes | cha0s |
Comments
Comment #1
cha0s commentedI'm thinking this may be how this code is supposed to look.
Comment #2
rszrama commentedPatch looks good to me... any thoughts on the other instances of language_default() in core? I see it in files, roles, and order admin.
Comment #3
cha0s commentedI audited all the uses of that function... In the process, I've come up with what I think is a more robust solution. This adds a new function, uc_store_mail_recipient_language($address) which takes an e-mail address, and returns the language object associated with any user with that email (defaulting to site default language). Then for each e-mail Ubercart's sending out, we're running through that function.
See, if an order was placed by user 1, but user 3 was in the list of recipients, user 3 would get user 1's language. Now he'll get user 3's language.
Comment #4
Docc commentedFunction sounds good to me. Ill test this patch when i get the change.
Comment #5
rszrama commentedInitially looks good to me, though I might change "mail" to "email" in the func name a la uc_store_email_from(). Don't worry about that yourself... bookmarking this for review and can tweak it myself if I think it's that important. : P
Comment #6
cha0s commentedWould you like me to roll a new patch?
Comment #7
rszrama commentedComment #8
Island Usurper commentedIt works, and it looks like it's already been changed to uc_store_email_from(), so I'm going to go ahead an commit it.
Rerolled the patch to add documentation to the function uc_store_mail_recipient_language().