Set a custom language for your site

Updated 5 months ago ​by Matt Bilotti

Say you have two versions of your website, one in English and one in German. How do you use the same widget on both sites, but specify the appropriate language for each? Now you can just by adding a little extra configuration to your Drift snippet...

<!-- Start of Async Drift Code -->
<script>
// ...
drift.SNIPPET_VERSION = '0.3.0';
drift.config({
 locale: "de-DE"
});
drift.load('xxxxxxxxxxxx');
</script>
<!-- End of Async Drift Code -->

Notice this little bit at the end that we added manually...

drift.config({
 locale: "de-DE"
});

Make sure you grab the latest snippet for your Drift account from https://app.drift.com/customize to use this new config method.

If you just want to change the language of your widget on all sites, there's no custom code necessary. Head on over to this help doc to see how.

If this is helpful please let us know! If there are other parameters you'd like to override on a per-site basis just chat with us and let us know what else you'd like to see added.

Supported language codes

  • en
  • es
  • de
  • de-DE
  • de-DE-formal
  • hi
  • hu
  • et
  • is
  • nl
  • pt
  • pt-PT
  • pt-BR
  • sv
  • zh
  • fr
  • it
  • tr
  • ru
  • pl
  • sl
  • da
  • fi
  • hr
  • ko
  • nb
  • ro
  • sr
  • th
  • vi

Additional customization options

When using a language separate from your account default configuration, you will need update the Welcome message and Away message content as well. Here is the configuration option to set that up:

drift.config({
  locale: "fr",
  messages: {
    welcomeMessage: "Translated Welcome Message Here",
    awayMessage: "Translated Away Message Here"
  }
});
Be sure to replace the "Translated..." messages with what you'd like yours to be.

Was this article helpful?

Can’t find what you’re looking for?

Talk To Us