Spring boot application for adding i18n support to portlets and soffits using i18next
This application makes heavy use of the factory pattern. This makes it easy to add new portlets/soffits to the translation service. To add a new portlet/soffit, first make a new model that extends Transalations that has all of the translation information. For anything that is shared across all portlets/soffits it can be added to Transalations.java. Then to make a translation service, implement the ITranslationsService interface and have a @Component("portlet_name")
annotation on the class.
When creating a new @Component
that component's name needs to be appended to the application.properties file with the rest of the cac he names. The Cacheable
annotation should follow the following format @Cacheable(value = "portlet_name", key = "{ #root.methodName, #languageCode }")
To view the translations go to /api/v1/locales/{porlet_name}/{lng}/{ns}
. If no portlet/soffit name is found, it will return a 404.
./gradlew clean assemble
Copy over the compiled war file to tomcat or use the built in tomcat ./gradlew bootRun