Enable Language Selector in service portal menu

akhil_kusa
ServiceNow Employee
ServiceNow Employee

I am trying to enable Language Selector in Service portal main menu. As per the documentation, I am able to enable the property (glide.sp.portals.language_selector_enabled). and copy the sys_id's of portals to the value. But cannot see the lang selector on the the portal header widget. Am I missing anything? Would really appreciate help on this.

PS: I am using Portal Polaris Header in the theme.

1 ACCEPTED SOLUTION

akhil_kusa
ServiceNow Employee
ServiceNow Employee

I was able to fix this. I don't have any language plugin other than English installed in my instance. As English is default, the language selector was not showing up. After installing couple of other language plugins, I am able to see the Language selector.

View solution in original post

3 REPLIES 3

RyanCastaldi
Tera Contributor

Hi, I am not familiar with the Portal Polaris Header widget but I believe this could be the issue. Try switching to the Stock Header to confirm the language selector displays as expected. If it does, you can update the Portal Polaris Header widget to display the language selector.

 

To add the language selector to a header widget, enter the below code into the Body HTML template:

<!-- Language Selector Menu -->
<sp-widget widget="::data.langSelector"></sp-widget>

Then enter the below code into the Server script:

data.langSelector = pm.isActive('com.glide.i18n')? $sp.getWidget('sp-lang-selector') : "";

 

You can view this code in the Stock header widget.

akhil_kusa
ServiceNow Employee
ServiceNow Employee

I was able to fix this. I don't have any language plugin other than English installed in my instance. As English is default, the language selector was not showing up. After installing couple of other language plugins, I am able to see the Language selector.