Skip to content

Latest commit

 

History

History
81 lines (50 loc) · 4.1 KB

CONTRIBUTING.md

File metadata and controls

81 lines (50 loc) · 4.1 KB

Contributing to OpenStreetMap Welcome Tool

Translation

Crowdin

You want to add a new language ?

Request a new language by creating a new issue ; the translation is managed via Crowdin, once the language is added to Crowndin, you'll be able to translate it here: https://crowdin.com/project/osm-welcome-tool

You want to contribute to the translation of the tool in your own language ?

Translation is managed via Crowdin, go to https://crowdin.com/project/osm-welcome-tool to contribute!


Add a new region

You want to use the Welcome Tool in your region and the region is not available yet ?

A region can be any geographical region defined by a geometry. It can be a whole country, a province, a city, a neighborhood, ...

There are only 2 steps to add a new region to the tool:

  • Add your region to the config/regions.yaml file:
    • Create a new key (lowerspace, not special characters, in English) ;
    • Add the name property with the name (in English) of your region ;
    • Add the flag property with the flag emoji of the country your region is in ;
    • You don't have to worry about the osmcha.id id, we'll take care of that ;
  • Add a GeoJSON for your region in the assets/regions folder.
    You can use http://polygons.openstreetmap.fr/ to easily create a (simplified) GeoJSON file for a specific OSM relation.
    Please keep your file under 100Ko!

Create a Pull Request with those 2 steps and we'll take it from there!


Add or update message template(s) for your region

You want to add or update a message template for your region ?

All messages templates are Markdown files stored in the templates/messages folder.

The messages templates Markdown files are classified under

The filename can be anything you want but should be a "slug" version of the template name property (see below): all lowercase, separated with dashes, no special characters.

Each message template file has a YAML front matter containing the following properties:

  • name: name of the template (that's what will be displayed in the templates list) ;
  • title: title of the message that will be sent to the user ;

After the YAML front matter, you can put any text using Markdown formatting. You can also use placeholders (for example, {{ mapper.displayName }} will be replaced by the username of the mapper).

Create a Pull Request with the new (or updated files)!

What variables/placeholders can you use in your template ?

  • Region (see regions.yaml):

    • region.name: Name of the region
    • region.flag: Flag (emoji) of the region
    • region.key: Name key of the region
    • region.continent: Continent key of the region
  • Mapper (see Mapper.php):

    • mapper.id: Mapper's OpenStreetMap identifier
    • mapper.displayName: Mapper's OpenStreetMap display name
    • mapper.image: Mapper's OpenStreetMap profile picture (URL)
    • mapper.accountCreated|format_datetime(): Mapper's OpenStreetMap account creation datetime (see Twig documentation)
    • mapper.changesetsCount: Mapper's count of OpenStreetMap changesest (at the time of detection by the Welcome Tool)
  • Current user connected to the app (see User.php):

    • app.user.id: OpenStreetMap identifier of the user
    • app.user.displayName: OpenStreetMap display name of the user
    • app.user.image: OpenStreetMap profile picture (URL) of the user