How to pre-set Language in servicenow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 03:32 AM
How to pre-set language to local language?
For example:
User country is Spain, then the language pre-set needs to be done as spanish.
How to achieve this ?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 03:44 AM
You can set the default language for an instance.
Do this after activating the plugin for the desired language.
Before selecting a new default language, activate the plugin for the desired language in System Definition > Plugins.
The default global language for the system is set in System Properties > System Localization.
This property defines the language that users with a role see if a language is not specified in their user record.
Users without a role see the default guest language, as described in User-specific language.
Please hit like and mark my response as correct if that helps
Regards,
Sonali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 08:44 PM
Hi @Sonali Nimbalk1 ,
We already have some user records which we needs to change manually . If user has Austria country then by pre-set language he should see German language ,How to achieve this with script? as they are many user records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 04:23 AM
@Buddy 1,
The most common way is to do this as part of the transform script or import logic as users populate the [sys_user] table (e.g from AD / LDAP etc). So in your example you could have a loop that checks for the Country and then set the "preferred_language" field on the user record (providing the language has been installed and set-up), then it will set the preference for the user accordingly,
Many thanks,
kind regards
Director of Globalization Deployment, Internationalization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 12:26 AM
var user = new GlideRecord('sys_user');
user,addQuery("country", "!=", " ");
user.query();
while(user.next())
{
var user_pre = new GlideRecord('sys_user_preference');
user_pre.initialize();
user_pre.name="user.language";
user_pre.user = user.sys_id;
if(user.country=="Austria")
{
user_pre.value = "at";
}
else if(user.country=="France") // add another country
{
user_pre.value = "fr"; // add another country code
}
user_pre.insert();
}
Please hit like and mark my response as correct if that helps.
Regards,
Sonali