Sending User
emails in the users
preferred language
Anyone who has built a multilingual Drupal site is aware that things aren't always as straight forward as you might hope.
We usually get there in the end using a few essential modules i18n, l10n client and string overrides plus a variety of other useful modules for those harder to reach areas.
One area which caused me some brain ache was the translation of the user emails found admin/user/settings. When a user registers whose language is different to that of the site default language she should receive her welcome email in her native language, but this isn't automatically the case. In my case I have the default language set to English, with French imported and enabled.
We have to address two issues to solve this problem.
User can't specify language during registration process.
By default, regardless of the language the user is viewing the site in when she registers, her language preference is set to the site default during the registration process. If she wants to specify an alternative language she must visit user/UID/edit after the registration process is complete.
By this time Drupal has already sent out a welcome email in the site default language.
Kars-T has come up with a great module addresses this, Registration language. It can be configured that if our user is browsing the site French when she registers her language preference is automatically set to French, she can always modify this later at user/UID/edit.
The site emails are not multilingual variables.
In the same way that we can make the site name, frontpage, mission statement etc multilingual variables, we can do the same for all the text areas concerning site emails admin/user/settings.
You either need to create or add to the array $conf['i18n_variables'] in your /sites/default/settings.php file. If you don't already have this array in your setting.php just copy the whole chunk into the bottom, if you already have it just add the extra lines relating to user_mail.
-
$conf['i18n_variables'] = array(
-
// Site name, slogan, mission, etc..
-
'site_name',
-
'site_slogan',
-
'site_mission',
-
'site_footer',
-
// User email variables
-
'user_mail_password_reset_body',
-
'user_mail_password_reset_subject',
-
'user_mail_register_admin_created_body',
-
'user_mail_register_admin_created_subject',
-
'user_mail_register_no_approval_required_body',
-
'user_mail_register_no_approval_required_subject',
-
'user_mail_register_pending_approval_body',
-
'user_mail_register_pending_approval_subject',
-
'user_mail_status_activated_body',
-
'user_mail_status_activated_subject',
-
'user_mail_status_blocked_body',
-
'user_mail_status_blocked_subject',
-
'user_mail_status_deleted_body',
-
'user_mail_status_deleted_subject',
-
'user_picture_guidelines',
-
'user_registration_help',
-
);
Once you have added this code you just need to visit admin/user/settings in each language and edit the emails to suit the current language (you may find that you need to re-enter the details for the default language as sometimes they get over written the first time you add the other language versions)
That's it, now all users will receive their registration email and all future emails in their preferred language.
This is a good code to know
This is a good code to know when apply for website.
Thanks.
Ma@
Khach san tai Hanoi
khach san ha noi gia re
Quản lý Nhân sự
cong ty tham tu
noithat
noithatvanphong
Funny SMS
cuu du lieu
seo
Thanks
That is so new to me. Thanks about the idea of the code above. Thanks.
Mena@cong ty bao ve
dich vu bao ve
bao ve
công ty bảo vệ
cong ty bao ve
bảo vệ
bao ve
dịch vụ bảo vệ
dich vu bao ve
cong ty bao ve uy tin
cty bao ve o hcm
cty bao ve o sai gon
great
It is so great to post comment on simon elliott. Thanks.
Mitt@
vietnam travel
vietnam holidays
vietnam vacation
vietnam tours
vietnam tour
great
This is so nice to place comment on. Thanks.
Ken@* dich vu ke toan
* dịch vụ kế toán
* bao cao thue
* báo cáo thuế
* tu van thanh lap cong ty
* thành lập công ty
* thanh lap cong ty
* thanh lap cong ty tnhh
* Dịch vụ thành lập công ty
* Dich vu thanh lap cong ty
* Dịch vụ thành lập doanh nghiệp
* dich vu thanh lap doanh nghiep
* cach thanh lap cong ty
* thanh lap cong ty co phan
* qui trinh thanh lap cong ty
* dieu kien thanh lap cong ty
dai ly thue
đại lý thuế
* dang ky kinh doanh
great
This seems to be new to me. I will give it a try when I have time. Thanks.
Matt@* thanh lap doanh nghiep
* thanh lap cty
* thành lập doanh nghiệp
4gb spy camera
I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post.iphone external battery
I concur with your
I concur with your conclusions and will eagerly look forward to your future updates. The usefulness and significance is overwhelming and has been invaluable to me!
-motor trade insurance online quote
Post very nicely written, and
Post very nicely written, and it contains useful facts. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement. Thanks for sharing with us
"Essays term papers"
diagnostic tools
If you need Car Key Programming Tool and looking for reliable and best car key programming tool then you have no choice instead of AD100 Pro.
amazing content i found here
I just came on to this website, amazing content i found here. It's great for every person in all over the world. automotive diagnostic tools
I wanna make it clear that
I wanna make it clear that you do not need to specify your e-mail setting inside web.config file but if you have a static e-mail account which will be in use for your app, it is the best way of doing this. java programmer
I have been reading blogs on
I have been reading blogs on this subject for a few hours now and your content is the most informed I have read thus far. Thanks for putting this information in one place.
recession proof career
Resources like the one you
Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that very useful. Thanks for the information.
-traders insurance
This valuable editorial was
This valuable editorial was very useful to read, I savored it completely. I'm about now to email it to my colleagues to permit them examine this too. Thank you really.
-cannes real estate
Re:
I finally found the information matching my criteria. This will really help me in completing my task easily and on time. Thanks for sharing. wound bandages
great work!
it wasn't worth the constant duplication hassle. The problem with Apple's built-in support for Google Contact Syncing is that you have NO CONTROL over it. You can't tell it what to sync, when to sync or anything else for that matter.
Essay Writing
I concur with your
I concur with your conclusions and will eagerly look forward to your future updates. The usefulness and significance is overwhelming and has been invaluable to me!
Dave @ cheap van hire
RE
Great job. The registration process is one of the trickier part. fastest way to learn french.
Great site and a great topic
Great site and a great topic as well i really get amazed to read this.I be taught one thing tougher on different blogs every day.Great to read about it. Thank you for sharing..
Logo design
Doesn't work
Hi guys,
I have tried to enable this module and to add these lines, but unfortunately, I haven't got anything.
Also, i visited both Arabic/English pages, but the body text still not translatable. e.g. if i changed to Arabic, so i will receive Arabic for all users regardless their preferred language.
Many thanks in advance.
Ihab.
This is such a great resource
This is such a great resource that you are providing and you give it away for free. Essay Writing I love seeing websites that understand the value of providing a quality resource for free. It’s the old what goes around comes around routine.
University Essays
Den Kredit online testen.
Den Kredit online testen.
support multilanguages
Making your software support multiple window tinting tampa language will enable many more people utilizing it.
There are plenty of
There are plenty of information about this topic iPhone jailbreak in the net & some are definitely better than others.mensagens para orkut
Thank you!
Nice post. I'm knee deep in multilingual email hell at the moment, and this has given me some hope to get it fixed :-)
J
hi
Very interesting and informative blog. Hope we get some updates
ms steel
This is an amazing post
This is an amazing post indeed! Adison High School
Eine Bausparkasse
Eine Bausparkasse vergleichen.
Wie eine Baufinanzierung funktioniert.
eine Fertiggarage vergleichen
Eine Altersvorsorge testen.
Eine Lebensversicherung testen.
Die Goldene Kreditkarte bestellen.
Eine Kreditkarte bestellen.
Nice post for sure! Woodfield
Nice post for sure! Woodfield University
multilanguage variable
Is there anyway I can set my custom doors email into multilingual variables?
Cool post for sure Woodfield
Cool post for sure Woodfield High School
Ein Konto testen. Wie die
Ein Konto testen.
Wie die Girokonten verglichen wird.
Wie Kostenlose Kreditkarten gefunden werden.
Ein Konto finden.
Wie man Kreditkarten vergleicht.
Ein Konto eröffnen.
Ein Giro-Konto testen.
Verschiedene Kreditkarten vergleichen.
Re:
Just bookmarked this link in my browser. I will definitely visit this site later to read some more quality blogs. Thanks. mobility scooters
nicely done dude WEVAC
nicely done dude WEVAC University
reported Zimplats’ June 2010
reported Zimplats’ June 2010 quarter statement. - The Herald. Rochville University
multiple language is a good idea
I think that the multiple gift baskets language variable is a great idea because it will encourage other people from around the world to use as well.
Wie Kreditkarten
Wie Kreditkarten funktionieren.
Eine Kreditkarte testen.
Ein Konto eröffnen.
Wie Geld funktioniert.
Einen Sparplan testen.
Wie Schulden getilgt werden.
Den Schufafreien Kredit bekommen.
Paul McCartney Tickets
I truly like your posting as well as the webpage all in all! The article is incredibly clearly written and also without difficulty understandable.Paul McCartney Tickets
ubercart question
Thanks for this tutorial.
It is working as it should , but I have a problem with ubercart.
If an anonymous user completes a purchase, the registration email with the new name-password that drupal generates is always in the default language.
Why is this happening? Have an idea what setting (or code)should I change? Music mixer
dream vacation network
you are right i really agree with your comments thanks for sharing...
dream vacation network
dream vacation network
dream vacation network
Eine Kreditkarte testen. Wie
Eine Kreditkarte testen.
Wie die Kreditkarte verglichen wird.
Wie Kostenlose Kreditkarten gefunden werden.
Ein Konto finden.
Wie man Kreditkarten vergleicht.
Ein Konto eröffnen.
I'm planning to start running
I'm planning to start running a blog. I have heard that the blog platforms matters a great deal. I really love just how your website looks and all the features it's got. Would you please share with me which blog platform you're employing. 10k Training Schedule
The information is very
The information is very applicable. I badly needed this very essential topic for site email issues for the project - urinary track infection treatment.
Thanks
Thanks a ton simon for this useful post, it really helped to solve this problem quickly without wandering here n there.
Forgot to mention my name
I forgot to mention my name in above comment and now cannt edit it as it is submitted by name of anonymous user. Well, i m Varun Taliyan(varuntaliyan@gmail.com)
user
If the user wants to specify an alternative language,try to visit user/UID/edit after the registration process is complete.
uric acid crystals gout
.
Nice blog. I got a lot of
Nice blog. I got a lot of good data. I’ve been following this technology for awhile. It’s interesting how it keeps changing, yet some of the core components remain the same. Have you seen much change since Google made their latest acquisition in the domain? vigilon
Wieso Pflegegeld so wichtig
Wieso Pflegegeld so wichtig ist.
Eine Pflegezusatzversicherung testen.
Eine Pflegeversicherung abschliessen.
Eine günstige Hausratversicherung finden
Den Gebäudeversicherung Vergleich machen.