Template implementation of React i18n with translations in DB.
Backend implemented in Spring Boot with JPA. DB is H2, just for sample purposes.
Implementation stack (the latest possible to date):
IntelliJ version 21.1+ is required, as it is the earliest supporting Java 16.
In addition, NodeJS version 10+ is required in order to run React.
In order for the application to run under IntelliJ, the following should be added to the compiler JVM settings (again due to Lombok vs. Java 16 incompatibility)
Settings > Build, Execution, Deployment > Compiler > Build process VM options:
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED
If you can't/won't have Java 16+ as main JVM (JAVA_HOME), use the toolchains.xml file (put it in your .m2 user directory)
To add a new locale, e.g. lo
:
lo.svg
) to static/flagslo
) to locales in i18n.jslocale=lo
in DBTo add or edit an existing domain properties you have to configure .env file. This file can be located externally on the actual environment. See https://github.com/motdotla/dotenv#readme for more information.
If you need more than the already configured environments, add another domain variable as well as a boolean that points in which domain you build for.
For further reference, please consider the following sections:
The following guides illustrate how to use some features concretely: