OpenVeo Core server

API Docs for: 7.0.0
Show:

I18nController

Extends Controller
Module: core-controllers

Summary

Defines a controller to handle requests relative to internationalization.

Constructor

I18nController

Syntax

I18nController

()

Summary

Methods

getAdminDictionaryAction

Syntax

getAdminDictionaryAction

(
  • request
  • response
  • next
)

Summary

Gets a dictionary, with restricted access, by its name.

To restrict access to the dictionary, all dictionaries with restricted access must be prefixed by "admin-". If no dictionary is found, a JSON 404 Not Found response is send back to the client.

Parameters:

  • request Request

    ExpressJS HTTP Request

    • params Object

      Request's parameters

      • dictionary String
        The name of the dictionary
      • code String
        Language code of the dictionary
  • response Response

    ExpressJS HTTP Response

  • next Function

    Function to defer execution to the next registered middleware

getDictionaryAction

Syntax

getDictionaryAction

(
  • request
  • response
  • next
)

Summary

Gets a public dictionary of translations by its name.

Parameters:

  • request Request

    ExpressJS HTTP Request

    • params Object

      Request's parameters

      • dictionary String
        The name of the dictionary
      • code String
        Language code of the dictionary
  • response Response

    ExpressJS HTTP Response

  • next Function

    Function to defer execution to the next registered middleware

Example:

{
  ENGLISH: 'Anglais',
  FRENCH: 'Français',
  ...
}

If no dictionary is found, a JSON 404 Not Found response is send back.