0

Trying to implement the text "view in browser" in different languages.

this isn't working, can someone please help? alternatively, is there an easier way to do this?

%%[
var @language, @vib 
Set @language = AttributeValue("language")

IF @language == “en” THEN
 set @vib = “view in browswer”
ELSEIF @language == “fr” THEN
 set @vib = “view in browswer in french”
ELSEIF @language == “de” THEN
 set @vib = “view in browswer in german” 
ELSEIF @language == “es" THEN
 set @vib = “view in browswer in spanish"
ELSEIF @language == "pt" THEN
 set @vib = “view in browswer in portuguese"
ENDIF
]%%
  
View in browser = %%=v(@vib)=%%  

1 Answer 1

4

I suspect this is caused by your double quotes. I see some of them are correct (i.e. "pt"), while others look like they have been copied from Microsoft Word (i.e. “de”). Try and correct these, as the rest of your code looks correct.

Additionally, I would recommend having a fallback scenario, if the "language" attribute should be missing. Here you could use English as fallback:

 %%[
var @language, @vib 
Set @language = AttributeValue("language")

IF @language == "fr" THEN
 set @vib = "view in browswer in french"
ELSEIF @language == "de" THEN
 set @vib = "view in browswer in german" 
ELSEIF @language == "es" THEN
 set @vib = "view in browswer in spanish"
ELSEIF @language == "pt" THEN
 set @vib = "view in browswer in portuguese"
ELSE 
 set @vib = "view in browswer"
ENDIF
]%%
  
View in browser = %%=v(@vib)=%% 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .