frontend/express/app

Main dashboard process app.js

Description:
  • Main dashboard process app.js

Source:

Methods

(inner) isSelectableLang(lang) → {boolean}

Description:
  • Whether a language code may be stored as a member's preference.

    Checked against the list the dashboard actually offers rather than against a shape, because the shape is the weaker statement: locale.conf.js is the same list the language menu is built from, plugins extend it through plugins.extendModule, and both places that post here send a code straight out of that menu. So a deployment that ships extra localization files can select them, and nothing else is accepted at all.

    The shape is still checked, because the stored value reaches file paths - for example api/utils/localization.js and the plugin localization lookups - and the list is deployment configuration rather than something this route validated.

Source:
Parameters:
Name Type Description
lang string

language code as posted

Returns:

true when it is one of the configured languages

Type
boolean

(inner) paramsGenerator(obj) → {object}

Description:
  • Create params object for validation

Source:
Parameters:
Name Type Description
obj obj

express request object

Returns:

params object

Type
object