This article explains how to set your learner’s locales, group access, and school language via OAuth 2.0. Contact us if you are interested in this option.
Setting your Learners’ Preferred Locales
By default, the Users API Endpoint should return the data as listed below.
{
‘id’: UNIQUE_LEARNER_ID,
‘first_name’: LEARNER_FIRST_NAME,
‘last_name’: LEARNER_LAST_NAME,
‘email’: LEARNER_EMAIL
}
If you already have a locale management mechanism within your own product, you may also pass another variable preferred_locale in this endpoint response as seen below:
{
‘id’: UNIQUE_LEARNER_ID,
‘first_name’: LEARNER_FIRST_NAME,
‘last_name’: LEARNER_LAST_NAME,
‘email’: LEARNER_EMAIL,
‘preferred_locale’: LOCALE_CODE
}
The learner’s preferred locale will be visible on the Person Profile page.
Managing Group Access
Locale management can either be used in conjunction with a Default Group setting, or with group access management via OAuth 2.0. Click here to learn more about managing group access via OAuth 2.0.
When locales are used with group management, you can assign courses to learners based on their locale. For example, learners who speak Spanish should be enrolled into Spanish courses, and learners who speak Chinese should be enrolled into Chinese courses. The locale or sub-locale will be appended to the end of the group name and the learner will be enrolled into the corresponding group on Northpass.
To illustrate how these variables work together, we’ve shown an example below. This example below assumes a Default Group called “All Learners” and managing group access via OAuth 2.0. This example also assumes the set of pre-created groups on Northpass listed on the right below.
- Adele would be placed into All learners (fr)
- She did not have any groups assigned to her by the authenticating platform, and a default group was chosen for the school. Additionally, she has a preferred locale of fr-FR, the closest of which is fr. She will be placed in All learners (fr).
- Ling would be placed into Control Group (zh-CN)
- He has a group assigned to him that matches a group in Northpass. Additionally, he has the preferred locale of zh-CN. He will be placed into Control Group (zh-CN)
- Maria would be placed into All learners
- She did not have any groups assigned to her by the authenticating platform, and a default group was chosen for the school. Additionally, she has a preferred locale of es, which does not have a match. She would be placed into the default All learners group.
Managing School Website Language
When using locale management via OAuth 2.0, the auxiliary language of the School Website will automatically change to match the learner’s preferred locale.
If you have utilized any custom templates, you may optionally upload different templates for each language. Click here to learn more about managing custom templates. This is recommended if you have overridden any of Northpass' default text, such as any hard-coded text would not be automatically translated.
To do this, simply add the locale code to the file extension of the template that you would like to customize. For example, if you wanted to have an English, Italian, and Portuguese version of your _course.html.sktl file, you would upload the following files:
- _course.html.sktl (English)
- _course.it.html.sktl (Italian)
- _course.pt.html.sktl (Portuguese)
Comments
0 comments
Article is closed for comments.