# SMS and Push Notifications translations: automatically choose language in campaign

**URL:** <https://forum.mautic.org/t/sms-and-push-notifications-translations-automatically-choose-language-in-campaign/18721>\
**Category:** 3rd Party Addons\
**Created:** [March 25, 2021, 7:20pm UTC](https://forum.mautic.org/t/sms-and-push-notifications-translations-automatically-choose-language-in-campaign/18721 "2021-03-25T19:20:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmakar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jmakar/32/2247_2.png) [@jmakar](https://forum.mautic.org/u/jmakar)\
**Post date:** [March 25, 2021, 7:20pm UTC](https://forum.mautic.org/t/sms-and-push-notifications-translations-automatically-choose-language-in-campaign/18721/1 "2021-03-25T19:20:29Z")

</div>

Mautic has a convenient feature with emails which allows you to create a single email, and then add many translated versions of that email. And then within a campaign you can choose to send that master email. The campaign will select the appropriate translated version for each user based on their locale.

I installed the Twilio and OneSignal plugins and see that you can pre-create messages (like with email). And you can assign them a language (like with email). But there does not appear to be a feature for associating translated versions with a master message. Which means that in the campaign builder I might have to add a condition branch for each locale when I want to send an SMS or push. So if I have 7 languages and want to send a single SMS, I’d have to add 7 conditions…one for each locale.

My question is this: is there a better way that I’m missing? I will consider coding a better way if I need to.

Thanks

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 26, 2021, 7:37am UTC](https://forum.mautic.org/t/sms-and-push-notifications-translations-automatically-choose-language-in-campaign/18721/2 "2021-03-26T07:37:45Z")

</div>

Hi, you can use the campaign decision tree for this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/89aaac3cadd59be1fc819c9f01a490910fe6497f.png)

Language preference can be checked as:

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/cf0e2c46fa29e56d274694959cfcefaf15592fcf.png)

---

<div class="post-metadata">

**Author:** ![jmakar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jmakar/32/2247_2.png) [@jmakar](https://forum.mautic.org/u/jmakar)\
**Post date:** [March 26, 2021, 2:09pm UTC](https://forum.mautic.org/t/sms-and-push-notifications-translations-automatically-choose-language-in-campaign/18721/3 "2021-03-26T14:09:05Z")

</div>

Joeyk - thanks for the reply! Is that tree more efficient than flattening it out like this in the image below?

 ![tree](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e4b16737f5dd7fdeca65d2702723dfcfa432ec41.png)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 26, 2021, 6:02pm UTC](https://forum.mautic.org/t/sms-and-push-notifications-translations-automatically-choose-language-in-campaign/18721/4 "2021-03-26T18:02:17Z")

</div>

So what happens if the language is Italian?

---

<div class="post-metadata">

**Author:** ![jmakar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jmakar/32/2247_2.png) [@jmakar](https://forum.mautic.org/u/jmakar)\
**Post date:** [March 26, 2021, 11:54pm UTC](https://forum.mautic.org/t/sms-and-push-notifications-translations-automatically-choose-language-in-campaign/18721/5 "2021-03-26T23:54:49Z")

</div>

I think what you’re asking is how to handle a default. So if there is an unsupported locale, how do we catch it. If _possible_, we could add one more condition check which uses a regex to check if the locale appears in a string of concatenated locales. Would have to test of course. But if ‘yes’, do nothing, if ‘no’, then we default to English or whatever the default should be.

The concatenated string could be something like en|de|fr.

Even this I’m not in love with though. I’ll probably at least look into improving this through code.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 29, 2021, 1:56pm UTC](https://forum.mautic.org/t/sms-and-push-notifications-translations-automatically-choose-language-in-campaign/18721/6 "2021-03-29T13:56:45Z")

</div>

What I was saying is, that in my version English is the default, fallback language.  
In yours there was no fall back language.  
Joey
