Multi language settings

Learn more about how to make Dashly multilingual for your website

Dashly allows to translate any system message on your website via changing service installation code. Here is an example of modified code:

1. Config object with changed parameters

2. Your API key (it is individual for each account, you can find API key in Settings - Developers section) 

3. Config object is added to dashly.connect

Here is an example of code for translating service messages into 3 languages. 

Note that you can also use any other language as well. 

This code will work if language on your website reflects in url this way -

Replace /en/ condition with your own and add your individual APY key. 

var config;      
 if (location.href.indexOf('/en/') > -1) {          
    config = {              
              "thanks": "Thank you",
              "dialogs_history": "Conversation history",
              "new_message": "New message",
              "enter_message": "Type your message and press Enter",
              "dialogs_zerodata": "There are no conversations yet. We've never talked before",
              "enter_email": "Enter your email",
              "enter_phone": "Enter phone number",
              "leave_email": "You can leave your email and we'll continue this conversation through email:",
              "page_title_new_message": "New message",
              "privacy_policy": "Privacy Policy",
              "close": "Close",
              "button_title_viber": "Contact us on Viber",
              "button_title_telegram": "Contact us on Telegram",
              "button_title_facebook": "Contact us on Facebook",
              "bumperText": "We use cookies to offer you a better browsing experience, analyze   site traffic and personalize content. By using this site or clicking I agree, you consent to our use of cookies. You can read our policy <a href="{{privacy-policy-link}}" target="_blank">here</a>.",
              "bumperButton": "I agree",
              "confirmSubscription": "I agree <a href="{{subscription-policy}}" target="_blank">with terms of service</a>",
              "appeal": "You",
              "vote_comment": "What happened?",
              "vote_text": "Please rate the operator",
              "vote_thanks": "Thank you for rating!",                                
      "settings": {                
              "messenger_collapsed_text": "Ask me...",                  
              "messenger_offline_message": "Тhere are no operators ready to answer now, but you  can leave your question, and we will help you during business hours.",                 
              "messenger_welcome_message": "Ask your question and we will respond. Write to us!"  
 if (location.href.indexOf('/fr/') > -1) {          
     config = {              
               "thanks": "Je vous remercie",                  
               "dialogs_history": "Historique de dialogue",                  
               "new_message": "Nouveau message",                  
               "enter_message": "Tapez votre message et appuyez sur Entrée",                  
               "dialogs_zerodata": "Il n'y a pas de dialogues. Vous n'avez pas encore communiqué avec nous",                  
               "enter_email": "Entrer un email",                  
               "enter_phone": "Entrez votre numéro de téléphone",                  
               "leave_email": "Vous pouvez laisser votre email et nous continuerons cette conversation par email:",                  
               "you" : "Vous",                     
        "settings": {                  
               "messenger_collapsed_text": "Demande moi...",                  
               "messenger_offline_message": "Il n'y a pas d'opérateurs prêts à répondre          maintenant, mais vous pouvez laisser votre question et nous vous aiderons pendant les heures de travail.",                                        
               "messenger_welcome_message": "Posez votre question et nous vous répondrons.       Écrivez-nous!"            
 if (location.href.indexOf('/de/') > -1) {          
    config = {              
              "thanks": "Vielen Dank",                  
              "dialogs_history": "Dialog Geschichte",                  
              "new_message": "Neue Nachricht",                  
              "enter_message": "Geben Sie Ihre Nachricht ein und drücken Sie die Enter",   
              "dialogs_zerodata": "Es gibt keine Dialoge. Sie haben noch nicht mit uns           kommuniziert",                  
              "enter_email": "E-Mail eingeben",                  
              "enter_phone": "Giben Sie Ihre Telefonnummer ein",                  
              "leave_email": "Sie können Ihre E-Mail-Adresse hinterlassen und diese Unterhaltung per E-Mail fortsetzen:",                  
              "you" : "Sie",                           
       "settings": {                 
              "messenger_collapsed_text": "Fragen Sie mich...",                  
              "messenger_offline_message": "Es gibt keine Mitarbeiter, die jetzt antworten       können. Sie können aber Ihre Frage stellen und wir werden Ihnen während der Geschäftszeiten     helfen.",                  
              "messenger_welcome_message": "Stellen Sie Ihre Frage und wir werden antworten.      Schreiben Sie uns!"              
   dashly.connect("XXXXX-XXXXXXXXXXXXXXXXXXXXXXXX", config);

In case the language changes the domain itself -

Please replace this line from the previous example 

if (location.href.indexOf('/en/') > -1) {  

with this one

if ('.').indexOf('com')>-1) {

Note that instead of 'com' you should add your own value.

Powered by