Building requires Java 8.
"Unit" tests require a working MongoDB database at localhost:27017. We use 2.6 in the project (but it works with newer versions, such as the 3.4 one). "Integration" tests require an Internet connection and generally that the Ozwillo ecosystem (kernel, data core, etc.) is set up and in the expected condition. They are therefore more brittle and for that reason, they do not fail the build (you should make sure they pass, though).
- After cloning this repository, install the js packages
yarn install
-
Configure your application's environment
- Create an src/main/resources/application-dev.yml file (dev is the default profile)
- Configure your own properties in it :
Here is an example of properties you have to change in it :
application:
devmode: true
production: false
web:
home: https://www.ozwillo.com
kernel:
base_uri: https://kernel.ozwillo.com
client_secret: changeit
datacore:
url: https://data.ozwillo.com
systemAdminUser:
refreshToken: changeit
nonce: changeit
spring.data.mongodb.uri: mongodb://localhost/portal?connectTimeoutMS=300&journal=true
- Run Spring Boot
./gradlew bootRun
- Run webpack-dev-server
yarn start
NB. to be used, Portal features require Kernel and Datacore servers to be deployed and configured in application.yml. You can deploy your own, or ask on the ML to get access to the online Ozwillo dev environment. Also, a valid refresh_token needs to be set in the configuration (explained below).
- Front-end access:
- DEV : http://localhost:3000
- PREPROD : https://portal.ozwillo-preprod.eu
- PROD : https://portal.ozwillo.com
- Use the js client app to generate a refresh_token that must be set in file application.yml (Portal and DC credentials can be found in DC project/puppet protected repository) : https://github.com/ozwillo/ozwillo-node-client
- With the obtained new code, reset it in the application.yml file and restart the Portal app
./gradlew assemble
In package.json
file choose the instance for which you want to generate the translations.
To do so you have to replace the targetToCompile
variable with the directory name of your instance :
"lingui": {
...
"localeDir": "src/main/resources/public/locales/{targetToCompile}",
...
}
Then do a yarn compile
.
Do it for all if you need to have a multi domain site. Soon LinguiJs will integrate directly this kind of feature and this chore will be avoided.
yarn extract
will extract all tags or sentence present in the code as :
i18n._(t`somethingToTrad`)
<Trans>Something To trad</Trans>
Extracted translations will be present in the directory defined in the package.json
(cf: config & compilation).
=====================================================
Copyright (c) 2013-2018 Open Wide & Ozwillo - http://www.openwide.fr - https://www.ozwillo.com
=====================================================