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.

Comments

cha0s’s picture

Assigned: Unassigned » cha0s
Status: Active » Needs review
StatusFileSize
new966 bytes

I'm thinking this may be how this code is supposed to look.

rszrama’s picture

Patch looks good to me... any thoughts on the other instances of language_default() in core? I see it in files, roles, and order admin.

cha0s’s picture

StatusFileSize
new9.04 KB

I 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.

Docc’s picture

Function sounds good to me. Ill test this patch when i get the change.

rszrama’s picture

Issue tags: +CA

Initially 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

cha0s’s picture

Would you like me to roll a new patch?

rszrama’s picture

Assigned: cha0s » rszrama
Issue tags: +ubercamp sprint
Island Usurper’s picture

Status: Needs review » Fixed
StatusFileSize
new8.76 KB

It 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().

Status: Fixed » Closed (fixed)
Issue tags: -CA, -ubercamp sprint

Automatically closed -- issue fixed for 2 weeks with no activity.