SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Sending emails to customers in their language


Sending emails to customers in their language

Author
Message
OlyKLin
OlyKLin
SSC Eights!
SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)

Group: General Forum Members
Points: 987 Visits: 185
Hi Everyone

I was wondering if it's possible to send emails to customers in their native language?
Our Server/DB is in us_english but we have customers in Spain, Portugel, UK, India etc and we'd like to send them emails in their language.

Is it possible to do this? I've tried SET LANGUAGE but it doesn't seem to work for text. It works for Dates.

Thanks!

Cathryn
John Mitchell-245523
John Mitchell-245523
SSC Guru
SSC Guru (132K reputation)SSC Guru (132K reputation)SSC Guru (132K reputation)SSC Guru (132K reputation)SSC Guru (132K reputation)SSC Guru (132K reputation)SSC Guru (132K reputation)SSC Guru (132K reputation)

Group: General Forum Members
Points: 132207 Visits: 19240
Cathryn

What doesn't work about SET LANGUAGE, and why do you even need it? Can you not just put the messages in the various languages in a table and select from there for your e-mail?

'Hindi', 'नमस्ते'
'English', 'Hello'
'Spanish', 'Buenos días'
'Portuguese', 'Bom dia'


John
OlyKLin
OlyKLin
SSC Eights!
SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)SSC Eights! (987 reputation)

Group: General Forum Members
Points: 987 Visits: 185
Hi John

This is what I tried:

DECLARE @TEXT varchar(50)
SELECT @TEXT = 'HELLO'

SET LANGUAGE 'Spanish'
SELECT @TEXT

It just gives me back 'HELLO'.

I thought about storing the messages in a text and just pulling them but I was hoping I might be able to do it on the fly
ZZartin
ZZartin
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25654 Visits: 17295
That is simply not what set language does, all it's doing is saying you want some specific localization like date names/formats etc... It's not going to take some random text, see that it's in english and then convert to the language you want. Based on your example how would you ever be able to actually get 'HELLO' back after setting the language to spanish BigGrin
Sue_H
Sue_H
SSC Guru
SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)

Group: General Forum Members
Points: 72695 Visits: 14961
OlyKLin - Monday, February 5, 2018 11:44 AM
Hi John

This is what I tried:

DECLARE @TEXT varchar(50)
SELECT @TEXT = 'HELLO'

SET LANGUAGE 'Spanish'
SELECT @TEXT

It just gives me back 'HELLO'.

I thought about storing the messages in a text and just pulling them but I was hoping I might be able to do it on the fly


SET LANGUAGE works on system messages and data formats but won't translate other text. With system messages, it gets the alternative language value from sys.messages. Storing that text may be something you want to do, similar to sys.messages, but it depends on how much text it involves.

Sue



Subramaniam Chandrasekar
Subramaniam Chandrasekar
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3516 Visits: 531
OlyKLin - Monday, February 5, 2018 9:30 AM
Hi Everyone

I was wondering if it's possible to send emails to customers in their native language?
Our Server/DB is in us_english but we have customers in Spain, Portugel, UK, India etc and we'd like to send them emails in their language.

Is it possible to do this? I've tried SET LANGUAGE but it doesn't seem to work for text. It works for Dates.

Thanks!

Cathryn

You do require an user defined function for this ? If I'm not wrong, while working with different time zones, We'll create an user defined functions and

convert the date time to user's timezone date time. We'd need to follow the same here.SmileSmile

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search