Skip to content

Commit

Permalink
Sending device.language in iso standard 2 characters (prebid#8789)
Browse files Browse the repository at this point in the history
Co-authored-by: Kapil Tuptewar <kapiltuptewar@L1290.local>
  • Loading branch information
2 people authored and jorgeluisrocha committed May 18, 2023
1 parent a77e1c5 commit fff7c6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,9 @@ export const spec = {
payload.device = Object.assign(payload.device, config.getConfig('device'));
}

// update device.language to ISO-639-1-alpha-2 (2 character language)
payload.device.language = payload.device.language && payload.device.language.split('-')[0];

// passing transactionId in source.tid
deepSetValue(payload, 'source.tid', conf.transactionId);

Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ describe('PubMatic adapter', function () {
expect(data.device.dnt).to.equal((navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1') ? 1 : 0);
expect(data.device.h).to.equal(screen.height);
expect(data.device.w).to.equal(screen.width);
expect(data.device.language).to.equal(navigator.language);
expect(data.device.language).to.equal(navigator.language.split('-')[0]);
expect(data.device.newkey).to.equal('new-device-data');// additional data from config
sandbox.restore();
});
Expand Down

0 comments on commit fff7c6f

Please sign in to comment.