Skip to content

Commit

Permalink
Merge pull request #1617 from pelias/language-specific-label-formats
Browse files Browse the repository at this point in the history
Language specific label formats
  • Loading branch information
orangejulius authored Mar 31, 2022
2 parents 04617ba + b5e0a62 commit 8d72ac1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion middleware/assignLabels.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const _ = require('lodash');

const defaultLabelGenerator = require('pelias-labels');

function setup(labelGenerator) {
Expand All @@ -16,7 +18,7 @@ function assignLabel(req, res, next, labelGenerator) {
}

res.data.forEach(function (result) {
result.label = labelGenerator(result);
result.label = labelGenerator(result, _.get(req, 'clean.lang.iso6393'));
});

next();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"morgan": "^1.8.2",
"pelias-compare": "^0.1.16",
"pelias-config": "^5.0.1",
"pelias-labels": "^1.16.1",
"pelias-labels": "^1.19.0",
"pelias-logger": "^1.2.0",
"pelias-microservice-wrapper": "^1.10.0",
"pelias-model": "^9.0.0",
Expand Down

0 comments on commit 8d72ac1

Please sign in to comment.