brouter-web/CONTRIBUTING.md

61 lines
1.7 KiB
Markdown

# Contributing
BRouter is heavily based on the following libraries:
- [Leaflet](leafletjs.com/) maps library, used in conjuction with many plugins.
- [Bootstrap](https://getbootstrap.com/) design library.
- [JQuery](https://jquery.com) javascript library.
- [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/en/).
## Install dependencies
```sh
yarn
```
## Build
```sh
#for development
yarn build debug
#for release
yarn build
```
## Develop
```sh
yarn serve
```
### Develop with Docker
```sh
#to install dependencies
docker-compose run --rm install
#to serve for development
docker-compose run --rm -p 3000:3000 serve
#or
docker-compose up serve
```
## Translations
`TL;DR` if you contribute to BRouter and add some translatable content, please make sure not to modify anything in `locales` folder, except `locales/en.json`. Full explanation below.
### How internationalization works
BRouter is translated using [i18next](https://www.i18next.com/) library, via command `gulp i18next`. It extracts translatable elements into `locales/en.json` file (English version).
As soon as this file is modified, it must be uploaded to Transifex (manually) with the command `yarn push-transifex`.
Anyone can then translate BRouter directly on [Transifex](https://www.transifex.com/openstreetmap/brouter-web/) platform.
From time to time (eg. when preparing releases), we can update translated content with the command `yarn pull-transifex`. **It will overwrite all JSON files in `locales` directory**.
## License
BRouter is licensed under [MIT](LICENSE). Please make sure before adding any library that it is compatible with that. (GPL licenses are incompatible for instance).