Skip to content

Commit

Permalink
ES needs 2 letter lang code.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihneadb committed May 24, 2019
1 parent 214dd8a commit 479b176
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion middleware/changeLanguage.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function updateDocs( req, res, translations ){
res.data.forEach( function( doc, p ){

// update name.default to the request language (if available)
translateNameDefault(doc, requestLanguage);
translateNameDefault(doc, req.clean.lang.iso6391);

// skip invalid records
if( !doc || !doc.parent ){ return; }
Expand Down
3 changes: 2 additions & 1 deletion test/unit/middleware/changeLanguage.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ module.exports.tests.success_conditions = (test, common) => {
const req = {
clean: {
lang: {
iso6393: 'requested language'
iso6393: 'requested language',
iso6391: 'requested language'
}
}
};
Expand Down

0 comments on commit 479b176

Please sign in to comment.