Setting the locale in the Portal

Overview

The user interface of the Portal is available in two languages: English and French. Change the locale settings in the configuration file of the Portal to choose the language for the user interface. The locale settings also determine the format of date and time expressions in the Portal.

Weeks are numbered in the Portal to identify weekly periods along the year. Depending on your location, weeks may start on a different day of the week. For instance, in some countries the week starts on Monday, whereas in other countries the week starts on Sunday. In different regions, there are different conventions as well to specify which week is the first week of the year. Configure the Portal to specify both the first day of the week and the first week of the year depending on your local conventions.

Language and date-time format

Basically, there are three possible configurations: International English, US English, and French. By default, the Portal is set to international English, which is different from US English only in the format of dates and time. In international English, days come first in dates and time is expressed in 24 hours format; whereas in US English, months come first in dates and time is expressed in a 12 hours format with the AM or PM suffix. Find examples of the differences among the three formats in the table below.

International EnglishUS EnglishFrench

Locale settings

en_CH

en_UK

en_US

fr

fr_CH

Date format

Jan '14

7 Sep

21.09.14

Jan '14

Sep 7

09/21/14

janv. 14

7 sept.

21.09.14

Time Format

14:45:12

15:00 today

02:45:12pm

3pm today

14:45:12

15:00 aujourd'hui

To set the locale in the Portal:

  1. Log in to the CLI of the Portal appliance.

  2. Optional: If the Portal has no configuration file yet, that is, if portal.conf does not exist in folder /var/nexthink/portal/conf, create it by copying the defaults from the sample configuration file: sudo -u nxportal cp /var/nexthink/portal/conf/portal.conf.sample \ /var/nexthink/portal/conf/portal.conf

  3. Edit the configuration file of the Portal: sudo vi /var/nexthink/portal/conf/portal.conf

  4. Set the default locale option by typing in the following line. For example, to set the locale to French:globalconfig.portal.user.default-locale = "fr"

  5. Save your changes and quit the editor by typing: :wq

  6. Restart the Portal to apply your settings: sudo systemctl restart nxportal

Setting the first day of the week

Days are numbered from 0 (Sunday) to 6 (Saturday). To specify the first day of the week, set it as the first element of the week-days array, followed by the next four days, in the configuration file:

  1. Log in to the CLI of the Portal appliance.

  2. Optional: If the Portal has no configuration file yet, that is, if portal.conf does not exist in folder /var/nexthink/portal/conf, create it by copying the defaults from the sample configuration file: sudo cp -u nxportal /var/nexthink/portal/conf/portal.conf.sample \ /var/nexthink/portal/conf/portal.conf

  3. Edit the configuration file of the Portal: sudo vi /var/nexthink/portal/conf/portal.conf

  4. Add the following line to set the first day of the week:

    • For example, to set day 1 (Monday) as the first day of the week, as it is common in most of Europe and other parts of the world that follow the ISO standard, type in: globalconfig.portal.portal.week-days = [1, 2, 3, 4, 5]

    • Alternatively, to set the day 0 (Sunday) as the first day of the week, as it is custom in the UK and the USA, type in: globalconfig.portal.portal.week-days = [0, 1, 2, 3, 4]

    • And to set day 6 (Saturday) as the first day, as it is usual in islamic countries, type in:globalconfig.portal.portal.week-days = [6, 0, 1, 2, 3]

  5. Save your changes and quit the editor by typing: :wq

  6. Restart the Portal to apply your settings: sudo systemctl restart nxportal

Specifying the first week of the year

Because the Portal numbers weeks to let you navigate through weekly periods, it is important for the Portal to know which week is considered to be the first week of the year in your region. The configuration setting for determining the first week of the year is related to the convention for choosing the first day of the week. It is expressed by a number that, when subtracted by the number which represents the first day of the week, indicates the latest day of the week that must belong to the new year (it has to lie in January) for the whole week to be regarded as the first week of the new year.

There are three standard values for indicating the first week of the year for different regions of the globe:

  • ISO: 4 When substracted by 1 (Monday), it yields 3. Three days after Monday is Thursday.

  • North American: 6 When substracted by 0 (Sunday), it yields 6. Six days after Sunday is Saturday.

  • Islamic: 12 When substracted by 6 (Saturday), it yields 6. Six days after Saturday is Friday.

As an example, let us look at the transition from 2015 to 2016 for each one of the standard regions:

  • In a region following the ISO standard, the first days of the new year fall in the week from Monday, Dec 28th 2015 till Sunday, Jan 3rd 2016. Since Thursday of that week is on Dec 31st 2015, it is not in January of the new year. So that is not the first week of 2016, but the last week of 2015. The first week of 2016 goes from Jan 4th till Jan 10th 2016.

  • In a North American region, the week with days in both years goes from Sunday, Dec 27th 2015 to Saturday, Jan 2nd 2016. Because Saturday lies in January 2016, this week is reckoned to be the first week of the year.

  • In an Islamic region, the week that marks the transition between the two years goes from Saturday, Dec 26th 2015 to Friday, Jan 1st 2016. Since Friday lies in January 2016, this week is then regarded as the first week of the year.

Note that in regions that follow either the North American or the Islamic conventions, it is enough that the last day of the week falls into January of the new year for the whole week to be the first one of the year.

To set the value for determining the first week of the year:

  1. Log in to the CLI of the Portal appliance.

  2. Optional: If the Portal has no configuration file yet, that is, if portal.conf does not exist in folder /var/nexthink/portal/conf, create it by copying the defaults from the sample configuration file: sudo -u nxportal cp /var/nexthink/portal/conf/portal.conf.sample \ /var/nexthink/portal/conf/portal.conf

  3. Edit the configuration file of the Portal: sudo vi /var/nexthink/portal/conf/portal.conf

  4. Add the following line depending on the convention followed in your region to compute the first week of the year:

    • ISO: globalconfig.portal.portal.first-week-of-year-contains = 4

    • North America: globalconfig.portal.portal.first-week-of-year-contains = 6

    • Islamic: globalconfig.portal.portal.first-week-of-year-contains = 12

  5. Save your changes and quit the editor by typing: :wq

  6. Restart the Portal to apply your settings: sudo systemctl restart nxportal

Last updated