Improve README.md

This commit is contained in:
Flo Edelmann 2020-10-23 12:07:52 +02:00
parent 3d2ca156f4
commit 065453338b

View file

@ -83,9 +83,9 @@ To develop:
0. Make a fork and clone the repository. 0. Make a fork and clone the repository.
1. Install `npm`. Linux: `sudo apt install npm` (or your favourite package manager), windows: install nodeJS: https://nodejs.org/en/download/ 1. Install `npm`. Linux: `sudo apt install npm` (or your favourite package manager), Windows: install nodeJS: https://nodejs.org/en/download/
2. Run `npm install` to install the dependencies 2. Run `npm install` to install the dependencies
3. Run `npm run start` to build and host a local testversion 3. Run `npm run start` to build and host a local testversion at http://localhost:1234/index.html
4. By default, the 'bookcases'-theme is loaded. In order to load another theme, use `layout=themename` or `userlayout=true#<layout configuration>`. Note that the custom URLs (e.g. `bookcases.html`, `aed.html`, ...) _don't_ exist on the development version. (These are automatically generated from a template on the server). 4. By default, the 'bookcases'-theme is loaded. In order to load another theme, use `layout=themename` or `userlayout=true#<layout configuration>`. Note that the custom URLs (e.g. `bookcases.html`, `aed.html`, ...) _don't_ exist on the development version. (These are automatically generated from a template on the server).
To deploy: To deploy:
@ -101,8 +101,8 @@ Help to translate mapcomplete.
A theme has translations into the preset.json (`assets/themes/themename/themename.json`). To add a translation: A theme has translations into the preset.json (`assets/themes/themename/themename.json`). To add a translation:
1. Modify `"language"` to contain the new language, e.g. `"language":"nl"` becomes `"language": ["nl", "en"]` 1. Modify `"language"` to contain the new language, e.g. `"language": "nl"` becomes `"language": ["nl", "en"]`
2. Add extra strings to the texts. If it used to be a single-language theme, one can replace the strings, e.g.: `"description":"Welcome to Open Bookcase Map"` to `"description": {"en":"Welcome to Open Bookcase Map", "nl": "Welkom bij de OpenBoekenruilkastenKaart", "fr": "Bienvenue sûr la carte des petites bibliotheques"}`. If the correct language is not found, it'll fallback to antoher supported language. 2. Add extra strings to the texts. If it used to be a single-language theme, one can replace the strings, e.g.: `"description": "Welcome to Open Bookcase Map"` to `"description": {"en": "Welcome to Open Bookcase Map", "nl": "Welkom bij de OpenBoekenruilkastenKaart", "fr": "Bienvenue sûr la carte des petites bibliotheques"}`. If the correct language is not found, it'll fallback to another supported language.
3. If you notice missing translations in the core of MapComplete, fork this project, open [the file containing all translations](https://github.com/pietervdvn/MapComplete/blob/master/UI/i18n/Translations.ts), add add a language string there 3. If you notice missing translations in the core of MapComplete, fork this project, open [the file containing all translations](https://github.com/pietervdvn/MapComplete/blob/master/UI/i18n/Translations.ts), add add a language string there
4. Send a pull request to update the languages, I'll gladly add it! It doesn't have to be a complete translation from the start ;) 4. Send a pull request to update the languages, I'll gladly add it! It doesn't have to be a complete translation from the start ;)
@ -112,19 +112,19 @@ Did you make an awesome theme that you want to share with the OpenStreetMap comm
In order to include your theme: In order to include your theme:
0) Make sure the theme has an english version. This makes it easier for me to understand what is going on. The more other languages, the better of course! 0) Make sure the theme has an English version. This makes it easier for me to understand what is going on. The more other languages, the better of course!
1) Fork this repository 1) Fork this repository
2) Go to `assets/themes` and create a new directory `yourtheme` 2) Go to `assets/themes` and create a new directory `yourtheme`
3) Create a new file `yourtheme.json`, paste the theme configuration in there. You can find your theme configuration in the customThemeBuilder (the tab with the Floppy) 3) Create a new file `yourtheme.json`, paste the theme configuration in there. You can find your theme configuration in the customThemeBuilder (the tab with the *Floppy disk* icon)
4) Copy all the images in this new directory: external assets can suddenly break and leak privacy 4) Copy all the images into this new directory: external assets can suddenly break and leak privacy
- Make sure the license is suitable, preferable a Creative Commons license. Attribution can be added at the bottom of this document - Make sure the license is suitable, preferable a Creative Commons license. Attribution can be added at the bottom of this document
- If an SVG-version is available, use the SVG-version - If an SVG version is available, use the SVG version
- Make sure all the links in `yourtheme.json` are updated. You can use `"./assets/themes/yourtheme/yourimage.svg" instead of the HTML link - Make sure all the links in `yourtheme.json` are updated. You can use `./assets/themes/yourtheme/yourimage.svg` instead of the HTML link
5) Add your theme to the code base: 5) Add your theme to the code base:
- Open [AllKnownLayouts.ts](https://github.com/pietervdvn/MapComplete/blob/master/Customizations/AllKnownLayouts.ts) - Open [AllKnownLayouts.ts](https://github.com/pietervdvn/MapComplete/blob/master/Customizations/AllKnownLayouts.ts)
- Add an import statatement, e.g. `import * as fritures from "../assets/themes/yourtheme/yourthemes.json" - Add an import statatement, e.g. `import * as yourtheme from "../assets/themes/yourtheme/yourthemes.json";`
- Add your theme to the `LayoutList`, by adding a line `FromJSON.LayoutFromJSON(maps)` - Add your theme to the `LayoutList`, by adding a line `FromJSON.LayoutFromJSON(yourtheme)`
6) Test your theme: run the project as described above 6) Test your theme: run the project as described [above](#Dev)
7) Happy with your theme? Time to open a Pull Request! 7) Happy with your theme? Time to open a Pull Request!
8) Thanks a lot for improving MapComplete! 8) Thanks a lot for improving MapComplete!