Multi Language Variables for Dynamic Content Campaigns

Comments

4 comments

  • Lior Delouya

    Hi Manuel,

    There is a feature on the way to support this. 

     

    The best way, for now, is to have a JS code that is looking into the context lng parameter/URL and picking the lng variable for you. Basically you will have a translated variables in one template, rather than 3 experiences. 

    Comment actions Permalink
  • Manuel Fuechslin

    That's what would be great to use.

    Is there a Dynamic Yield Javascript which we can use? Out of a Template or so.

    Comment actions Permalink
  • Lior Delouya

    Hi, 

    We do not have an official reference for this. I would recommend that you will share the need with your CSM which might be able to provide you with something.

     

    I'm not a developer BUT, In general, it will be something like

     

    HTML

     

    <div class = 'myTraslatedDiv'> </div>

     

    JS

     

    var lng = DY.recommendationContext.lng

    lng1Text = ${DYVariableLng1Tex}

    lng2Text = ${DYVariableLng2Tex}

    lng3Text = ${DYVariableLng3Tex}

     

    if (lng === lng1) {

    append lng1Text variable to myTraslatedDiv

    }

    else if ...

     

    Comment actions Permalink
  • Guy Dynamic

    another example:

    var DY_VARIABLES = {
      "en":{
        "title":"${EN Banner Title}",
        "img":"${EN Banner Image}",
        "url":"${EN Banner click URL}"
      },
      "de":{
        "title":"${DE Banner Title}",
        "img":"${DE Banner Image}",
        "url":"${DE Banner click URL}"
      },
      "fr":{
        "title":"${FR Banner Title}",
        "img":"${FR Banner Image}",
        "url":"${FR Banner click URL}"
      }
    }

    var bannerHtml = document.getElementById('dy-banner');
    bannerHtml.querySelector('.dy_title').textContent = DY_VARIABLES[DY.recommendationContext.lng].title;
    bannerHtml.querySelector('.dy_image').textContent = DY_VARIABLES[DY.recommendationContext.lng].img;
    bannerHtml.querySelector('.dy_url').textContent = DY_VARIABLES[DY.recommendationContext.lng].url;
    Comment actions Permalink

Please sign in to leave a comment.