inverse-inc / packetfence

PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC) solution. Boasting an impressive feature set including a captive-portal for registration and remediation, centralized wired and wireless management, powerful BYOD management options, 802.1X support, layer-2 isolation of problematic devices; PacketFence can be used to effectively secure networks small to very large heterogeneous networks.
https://packetfence.org
GNU General Public License v2.0
1.3k stars 276 forks source link

web admin: frontend ignore list of locales returned by backend #6019

Open nqb opened 3 years ago

nqb commented 3 years ago

Describe the bug We recently add a new language (Norwegian) upstream but we missed to update list of locales returned by backend through API.

After I did it, I noticed that:

To Reproduce Steps to reproduce the behavior:

  1. Create a new connection profile
  2. Try to add "no" as new language under Captive portal tab

=> Language is missing.

Expected behavior New language should be available.

Additional context It looks like there is a static list of languages on frontend here

So I suppose frontend doesn't take into account locales returned by backend.

satkunas commented 3 years ago

Languages are defined in the backend.

/usr/local/pf/sbin/pfperl-api get -M OPTIONS '/api/v1/config/connection_profile/test'| jq '.meta.locale.item.allowed'
[
  {
    "text": "en_US",
    "value": "en_US"
  },
  {
    "text": "es_ES",
    "value": "es_ES"
  },
  {
    "text": "fr_FR",
    "value": "fr_FR"
  },
  {
    "text": "fr_CA",
    "value": "fr_CA"
  },
  {
    "text": "de_DE",
    "value": "de_DE"
  },
  {
    "text": "he_IL",
    "value": "he_IL"
  },
  {
    "text": "it_IT",
    "value": "it_IT"
  },
  {
    "text": "nb_NO",
    "value": "nb_NO"
  },
  {
    "text": "nl_NL",
    "value": "nl_NL"
  },
  {
    "text": "pl_PL",
    "value": "pl_PL"
  },
  {
    "text": "pt_BR",
    "value": "pt_BR"
  }
]
jrouzierinverse commented 3 years ago

@nqb Please advice was change from no to nb_NO in commit 890895d5c25c7836bda03ac7affaa8b86309c30f Which is in the list of available languages.