How to Translate Alert (banner) in the Workspace as per the user language preference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Community!
I want to Translate the Alert message in the workspace as per the user language preference. The Alert should be like a banner which can't be removed throughout the user session. I have created the Alert. Please check the screenshot added.
I want the Content to be translated as per the user language. So in the message field I am adding the text using the "Bind data or use scripts". In that I am using the Formulas section and using Translate method. Please check the screenshot.
After that I am clicking on Apply. But still, it is showing as blank. please check the below screenshot.
Can you please let me know why it is happening like this. And please confirm me if it is the right way to Translate the Text. Thank you.
- Labels:
-
Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hey @Imran4,
The blank message is a syntax problem, not a translation problem: in your second screenshot the text inside TRANSLATE() is typed as raw, unquoted text. The formula editor needs a quoted string literal as the argument, and on top of that, that formula language uses a period ( . ) as the concatenation operator, exactly like you can see in your own CONCAT example: CONCAT("Welcome, " . @context.session.user.firstName). Your sentence has several periods in it, so an unquoted version doesn't just fail to parse as text, it gets chopped up at every full stop. Fix the formula first:
TRANSLATE("This account has opted out of AI processing. Case data must not be used, processed, or shared with any AI-based tool or service.")That gets you past the blank field, but wrapping text in TRANSLATE() only makes it eligible for translation, it doesn't invent the translated copy for you. Before you call this done, run through these:
- Quoted string: the whole message must be inside double quotes as one literal passed to TRANSLATE(text), same as the CONCAT example uses quotes around "Welcome, ".
- sys_ui_message records: create one record per language in System UI > Messages (sys_ui_message), all using the exact same Key, with the Message field holding the translated text for that language. TRANSLATE() looks up a match here for the session language and falls back to your base string if nothing matches.
- I18N plugin: the I18N: Internationalization plugin has to be active, otherwise English is the only language option available regardless of what you configure in Messages.
- Test user's language: confirm the Preferred Language on the test user's sys_user record is actually set to the target language, since the correct sys_ui_message entry only shows if the session language differs from the default.
Your banner persistence itself (the non-dismissible bar carrying across the CS1437899 and CS0146621 tabs in your first screenshot) is already working fine, so no changes needed there, it's purely the message binding that needs the quotes and the language records behind it.
References
- Create and customize alert messages in UI Builder
- Need to translate a configurable workspace? check this
- UI Builder Translatable for Dynamic Text
- Helpers.translate function UI Builder
Thank you,
Vikram Karety
Octigo Solutions INC