- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 05:44 AM
Hi All,
In service portal, we have a widget called "Language Picker" that allows the user to switch between the Languages.
But My need is to display the KB articles according to the switched Language
For example, if user selects 'Japanese' in Language Picker, the Kb articles in Japanese Language must only be visible to the User
Can anyone help on this??
Thanks in Advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2017 03:45 AM
Hi Robbie,
As of my understanding, the "Language Picker" widget in the Service portal is working as below:
i)When user selects a specific language in the "Language picker", the "Language(preferred_language)" field in "Sys_user" table is getting updated
So,In "KB View 2" widget, I just added the below code to get 'Language' field Value
data.language = gs.getUser().getLanguage();--->(In server script)
And queried it in 'kb_knowledge' table(In 'getDocuments()')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2017 01:30 AM
Hi Salome,
How did you go?
Please mark this response as correct and helpful via your post link (Displaying Kb articles according to the Language in Language Picker) to help others with the same question.
Thanks,
Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2017 03:45 AM
Hi Robbie,
As of my understanding, the "Language Picker" widget in the Service portal is working as below:
i)When user selects a specific language in the "Language picker", the "Language(preferred_language)" field in "Sys_user" table is getting updated
So,In "KB View 2" widget, I just added the below code to get 'Language' field Value
data.language = gs.getUser().getLanguage();--->(In server script)
And queried it in 'kb_knowledge' table(In 'getDocuments()')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2020 12:34 AM
Hello Robbie,
Can you please elaborate more on this, we also have the language picker enabled in our portal, when users change the language to french they cannot view the knowledge articles written in english and how to make them view the all the knowledge articles irrespective of the language selected in the language picker.
I work in domain seperated instance and do you have any workaround apart from enabling the system property "glide.knowman.enable_multi_language_search".
Thanks,
Prerana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2021 08:30 PM
Hi Could you provide the detail how your configuration work?
I want to modify kb view2 but it is not avaliable.
I clone KB view2 and add this code in server script.
data.language = gs.getUser().getLanguage();
and added "gr.addQuery('language', data.language);"
function getDocuments(kb) {
var d = [];
var gr = new GlideRecordSecure('kb_knowledge');
gr.addQuery('kb_knowledge_base', kb);
gr.addQuery('workflow_state', 'published');
gr.addQuery('valid_to', '>=', (new GlideDate()).getLocalDate().getValue());
//get KB based on user language
gr.addQuery('language', data.language);
gr.orderBy('short_description');
gr.query();
but it was not work well.
Please advice.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2017 05:43 AM
Hi Salome,
Great - glad we got there? Was my advice helpful? Please mark accordingly.
Thanks,
Robbie