Skip to content

Commit 9f95b25

Browse files
DennisOSRMCopilot
andauthored
fix: respect browser language preference (#442)
* Don’t force OSRM_LANGUAGE in index.html Remove default OSRM_LANGUAGE so browser language detection is used when no config.json provides a language. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: selection --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 78fa270 commit 9f95b25

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
// In all other cases (dev, browser), leave it undefined to use public services
2323
OSRM_CENTER: '38.8995,-77.0269',
2424
OSRM_ZOOM: 13,
25-
OSRM_LANGUAGE: 'en',
2625
OSRM_DEFAULT_LAYER: 'streets'
2726
// OSRM_BACKEND and OSRM_MODES will be set by config.json if available
2827
};

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ var controlOptions = {
171171
containerClassName: options.lrm.containerClassName,
172172
alternativeClassName: options.lrm.alternativeClassName,
173173
stepClassName: options.lrm.stepClassName,
174-
language: 'en', // we are injecting own translations via osrm-text-instructions
174+
language: mergedOptions.language, // we are injecting own translations via osrm-text-instructions
175175
showAlternatives: options.lrm.showAlternatives,
176176
units: mergedOptions.units,
177177
serviceUrl: leafletOptions.services[0].path,

0 commit comments

Comments
 (0)