valhalla / valhalla/valhalla

Accept-Language header support

Open
#4,948 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
6.2k
Forks
981
Avg merge
2d 14h
Merged PRs (30d)
14

Description

Getting localized directions to users is something that's interesting to me, and I'm wondering if there's a better way than the current approach of specifying a single 2 letter language code. Setting a language code in the query string or POST body is fine if you know, for example, that you need directions in Korean AND you also know that Valhalla supports Korean (it doesn't :P). But maybe the user also understands some other supported language which they'd prefer over English directions?

There's a web standard for this already; both web browsers and (good) mobile HTTP clients send a useful hierarchy of wants in the Accept-Language header, and some APIs (like Pelias) take this into account to automatically localize content. Valhalla could improve the UX by supporting this header too, parsing the priority list, and identifying a language for the response based on what's supported.

Is there interest in supporting this directly in Valhalla? If so, I'd be happy to take a swing at implementation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.