I’m struggling to think how to manage my multi-language application . I’m using a language attribute to store the user’s preferences of language, so far so good. But my problem start when I need to send a notification to another user.
Imagine this situation: user A (English) send a notification to user B(Spanish). In my workflow, as the user A is sending the notification the app text that will be send to user B will be in English, not Spanish. I don’t figure out a way to check the user preference and change the app text to other language.
For that dataType, do you have two fields? One for the notification of the sender and one notification for the receiver? Or do you have two messages? Are you using something like ChatGPT to translate the notification? Are these notificationa just already translated and in your database?
Thanks for you reply. I will give you more context:
My app controls the language using app text and the user has an attribute to allows the user change the language of the app. It is a feature of bubble.
I have a two side marketplace and when user 1 pays for a users2’s product I want to send a notification to user 2 in whatapp. I’m using a backend workflow to create this orchestration using apis. The problem is that when I send the message I’m using app text and as the user 1 is the person activating this workflow the app text in the message will be send using the user 1 language preference.
I think is not smart to save the types of notifications in data base because I have a lot of whatapp notifications ( users payments, new messages in chat, etc…)
if you know the user and you have a field on the user data type of language preference, and you have notifications in app text, then you just make the text element that is used to display the notification reference the current users language preference…but this is not necessary if using app text and the language preference is already working properly, since when a user is logged in (and they must be logged in to see notifications) the language preference should be known by the app and displaying app text properly.
That would be true in the app, but the message the user2 will receive in whatapp you be the language from the user 1, because user 1 trigged the workflow.
Okay, then instead of using app text, use an option set. Have an attribute for each notification that is of type text for the different languages you plan to support, much the same way you would have done for app text. That way you can choose the appropriate attribute (ie: message in language) conditionally based on the receivers language preference.
Yeah, that makes sense. Seems tons of work to create options for each type of whatapp notification. Bubble should create something like “run workflow as user” haha. would be a lot easier. Thanks for spend your Monday time here helping me. Wishes of a great week ahead.
You could alter the approach from option sets to a data type which will allow you to upload a CSV file, much like you could with app text. This would reduce your workload and make it easier to add more messages in the future and even add other systems messages (implying not just whatsapp but other communication channels), as well as add more supported languages.
One of the things that attracts me to the data type idea, is the fact you can use translate in Google Sheets to easily translate all messages to all the different languages you support.