- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2015 03:39 AM
I need to translate the text used in HTML/XML fields and there doesn't appear to be a way to do this via the normal methods. I therefore want to include an if statement within the HTML/XML to change the text, however I don't know the function for getting the language the user has logged in with (via the language picker). I'm not a coder at all, sadly, so please excuse me, but the logic I want is this:
get the users/sessions language
if language is french display 'bonjour'
if language is spanish display 'hola'
else display 'hello'
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2015 02:45 AM
Hi Wayne,
Try this:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<p style="padding-left:13px; padding-top:10px;"><a onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'incident')">
<b>${gs.getMessage('Attach files')}</b> <img width="16" height="16" border="0" src="images/icons/attachment.gifx" title="${gs.getMessage('Attach any documents relating to your request')}"></img></a></p>
</j:jelly>
Then create 2 or more messages in the sys_ui_message table like this
The translation will be automatic based on the user language, as long as you have created the messages for each language. In the picture above i've added dutch translations so you can see how it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2015 04:49 AM
I may not have marked this as a question as I can't see the options to mark it as answered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2015 12:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2015 09:25 AM
done. Feel free to mark helpfuls and correct as you see fit!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2015 07:31 AM
I actually need to translate the words 'Attach files' and 'Attach any documents relating to your request' within this code. This script is a UI Page that I add to Record Producers for adding attachments to Incidents. I just don't know where to begin to do this. Well, other than var lang = gs.getSession().getLanguage();
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<p style="padding-left:13px; padding-top:10px;"><a onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'incident')">
<b>Attach files</b> <img width="16" height="16" border="0" src="images/icons/attachment.gifx" title="Attach any documents relating to your request"></img></a></p>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2015 02:45 AM
Hi Wayne,
Try this:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<p style="padding-left:13px; padding-top:10px;"><a onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'incident')">
<b>${gs.getMessage('Attach files')}</b> <img width="16" height="16" border="0" src="images/icons/attachment.gifx" title="${gs.getMessage('Attach any documents relating to your request')}"></img></a></p>
</j:jelly>
Then create 2 or more messages in the sys_ui_message table like this
The translation will be automatic based on the user language, as long as you have created the messages for each language. In the picture above i've added dutch translations so you can see how it works.