BoxLang 🚀 A New JVM Dynamic Language Learn More...
This is an extension for Preside that provides the ability to perform multilingual REST requests.
The extension provides a system configuration screen that allows you to configure:
Accept-language is a standard HTTP header field, see Wikipedia for details.
If for any reason both headers are supplied, then Accept-language takes precedence.
The following language formats can be used:
In case of an invalid language code, the system falls back to the default language. The concept only works if your application deals with multilingual Preside objects. Documentation: Preside - Multilingual content
See following example requests
curl -X GET --header 'Accept-language: de-DE' 'http://servername:serverport/api/myrestapiendpoint/'
curl -X GET --header 'Accept-language: en' 'http://servername:serverport/api/myrestapiendpoint/'
curl -X GET --header 'X-LANGUAGE: fr-FR' 'http://servername:serverport/api/myrestapiendpoint/'
Install the extension to your application via either of the methods detailed below (Git submodule / CommandBox) and then enable the extension by opening up the Preside developer console and entering:
extension enable preside-ext-rest-i18n
reload all
From the root of your application, type the following command:
git submodule add https://bitbucket.org/hwsdev/preside-ext-rest-i18n.git application/extensions/preside-ext-rest-i18n
From the root of your application, type the following command:
box install preside-ext-rest-i18n
$
box install preside-ext-rest-i18n