[Tile-serving] [osm2pgsql-dev/osm2pgsql] Some way of passing global params? With internationalization as example (Discussion #2317)

iboates notifications at github.com
Sun Apr 13 11:15:54 UTC 2025


I was playing around with themepark for the first time today, specifically with regards to admin boundaries (as you probably saw in my PR)  and I was wondering how I might be able to pick out internationalized names (e.g. `name:en`, `name:de`, `name:fr`) without having to modify the lua code. Is it possible to pass a kind of global param that is accessible by osm2pgsql/themepark? Because then you could have a helper function like (in Python because I don't know Lua off the top of my head):

```
LANGUAGE = "en"  # Passed as global param upon script invokation

def tag_i18n(tag_name, language):
    if "{tags[language]}:{tag_name}" is None:
        return {tag_name}
    return "{tags[language]}:{tag_name}"

print(f"This place is called {tag_i18n('name')}.")
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2317
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/2317 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20250413/3f996e6c/attachment.htm>


More information about the Tile-serving mailing list