Internationalisation
Corteza allows you to fully translate most aspect of the system. From the user interface to custom Low Code configurations such as modules and their fields.
User interface translations are provided via static .yaml
files which are bundled into the corteza-server
docker image.
If you wish to upload additional or modified translations, you will need to do some server-side configuration.
Configuring the system
Applying the following steps will allow your Corteza instance to serve customized translations.
Corteza will ignore translations for languages that are not defined in the |
Prepare the file structure
Create a new directory on the server running Corteza.
📁 my-corteza
📄 docker-compose.yaml
📄 .env
📁 my-locale (1)
📁 src (2)
1 | We will use the my-locale directory to hold our custom translations and any corresponding metadata. |
2 | The src directory will hold the translation files and appropriate configuration files. |
System configurations
Firstly define the volume in your docker-compose.yaml
file.
An example following the above file system would look like this:
version: '3.5'
services:
// ...
// Additional services here
// ...
server:
image: cortezaproject/corteza:${VERSION}
restart: always
env_file: [ .env ]
depends_on: [ db ]
volumes: ["./my-locale:/my-locale"] (1)
// ...
// Additional configurations here
// ...
// ...
// Additional services here
// ...
1 | This is where you mount the volume. |
Secondly, you need to tell Corteza where the translations are located at.
This is done by the LOCALE_PATH
.env
variable.
An example following the above setup would look like this:
// ...
// Additional configurations here
// ...
LOCALE_PATH=../my-locale/src (1)
// ...
// Additional configurations here
// ...
1 | This is where you define the path.
If you wish to define multiple paths, use the colon (: ) as the delimiter.
To exemplify; LOCALE_PATH="../my-locale-en/src:../my-locale-de/src" .
When multiple paths are used, defiitions are overriden in the same order as defined |
Managing available languages
The languages that you wish to support by your Corteza instance must be defined by the LOCALE_LANGUAGES
.env
variable.
Languages can be defined using a simple language tag, such as en
and sl
.
If you need to be more specific you can use region suffix, such as en-US
and en-UK
.
Corteza will try to detect the language from the request headers and serve appropriate translation.
If you want to define multiple languages, you need to separate them with a comma (,
).
LOCALE_LANGUAGES="en,de,it"
Development environment
Corteza provides some helpful utilities for debugging and general translations that can be enabled with the following .env
variables.
Variable | Description |
---|---|
The |
|
The |