Translations , need to add German Language also in the below On Change script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 05:04 AM
When selecting German Language also it was showing English Choices only, so need to include German choices in the script, kindly help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 07:32 AM
The proper way would be to retrieve the choices via a GlideAjax call.
The simplified way would be to check the language of the user if(g_lang == 'en'){} and hardcode also the other list of options for German.
Regards,
Hayo
Please mark the solution as correct, if the answer provided has resolved your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 09:55 AM
Hi Lubbere,
I have created Countries translated also, but here we are countries would be selected as region based.
On the script we written that only. but the issue is not translated the countries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 12:18 PM
Hi Lubbers,
I have called the GlideAjax call. but it's not working kindly help me
var ajax = new GlideAjax('global.TranslationsPayrollCountry');
// ajax.addParam('sysparm_name','getCountry');
// ajax.addParam('sysparm_region', region);
// ajax.getXMLAnswer(function (answer) {
// alert('hi');
// g_form.addInfoMessage("00 " + answer);
// var user = JSON.parse(answer);
// var id = user.userSysid ;
// alert(user);
// var name = user.userName;
// });
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 07:44 AM
@prudhviraj1,
Ok so there's a few things to unpack here. The first being, adding choices in code like this is not best-practice as in introduced unnecessary technical debt, it's also not the intended design for how translated choices work.
Here's my blog post on why "hard-coded" strings are bad practice, here's my blog post on how the 5 translation tables work (in your case it should be entries in [sys_choice] without using any scripts for the translations - so you should look to refactor your client script,
And finally, here's our training course on NowLearning on how Localization works across the platform,
Many thanks,
kind regards
Director of Globalization Deployment, Internationalization