igrigorov / spring-react-i18n-admin

0 stars 0 forks source link

Spring + React Localization (l10n) Administration

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):

Getting Started

IntelliJ

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.

Local compile JVM options

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

Maven Toolchains

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)

Further Development Instructions

New Locale

To add a new locale, e.g. lo:

New domain

To 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.

Future Development

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely: