Common property's types differ when comparing default GVL and translations.
See original GitHub issueI noticed that typing of common properties in GVL and translations differ.
Here’s an example: GVL url: https://vendorlist.consensu.org/v2/vendor-list.json Translations url: https://vendorlist.consensu.org/v2/purposes-fr.json
If you compare types of objects in purposes
, specialPurposes
, features
, specialFeatures
and stacks
you can see that in GVL those properties are maps while in translation files they are provided as arrays.
GVL purposes:
"purposes": {
"1": {
"id": 1,
"name": "Store and/or access information on a device",
"description": "Cookies, device identifiers, or other information can be stored or accessed on your device for the purposes presented to you.",
"descriptionLegal": "Vendors can:\n* Store and access information on the device such as cookies and device identifiers presented to a user."
},
...
}
Translated purposes:
"purposes": [
{
"1": {
"id": 1,
"name": "Stocker et/ou accéder à des informations stockées sur un terminal",
"description": "Les cookies, identifiants de votre terminal ou autres informations peuvent être stockés ou consultés sur votre terminal pour les finalités qui vous sont présentées.",
"descriptionLegal": "Les partenaires peuvent :\n* Stocker des informations et accéder à des informations stockées sur le terminal, comme les cookies et les identifiants du terminal présentés à un utilisateur.\n"
}
},
...
]
I’m writing this because API becomes inconsistent if you’re changing the language.
So if you’re using default language GVL, you have purposes as maps while if you change lanugage with changeLanguage
, purposes become arrays.
I would recommend to unify this format (and always use IntMap), otherwise it’s inconsistent and can provide you with wrong information (e.g.: fetching with [id] returns the results both for maps and array but the result differs).
Here’s a sample of runnable code exposing this issue:
import { GVL } from '@iabtcf/core';
GVL.baseUrl = "http://cmp.mysupercoolcmp.com/";
let gvl = new GVL();
gvl.readyPromise.then(() =>{
console.log("Purpose one from default GVL: ", gvl.purposes[1]);
gvl.changeLanguage("fr").then(() => {
console.log("Purpose one from translations: ", gvl.purposes[1]) ;
});
});
P.S.: I would also mention that provided link in documentation is pointing to translations of TCF v1.1 framework and not to translations for v2.0 (For the full list of iab provided language translations click here.
section of documentation).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5
Thanks for raising this issue. We’re still finalising the translations and will get the format issue fixed asap. On your other points the purpose archives can be found here:
https://vendorlist.consensu.org/v2/archives/purposes/v22/purposes-fr.json
And the vendorListVersion inconsistency with the GVL has been fixed now, so the version in the translations will match the GVL.
This will not happen again. We were testing the release process for the translations and although they were publicly available, they had not been fully tested and finalised. Everything is looking good now, so we will be issuing comms to the community that the translations are ready and available.