Description
There is a critical issue with the @iabtechlabtcf/core library where advanced language codes are not properly preserved during the TC string encoding and decoding process.
Problem Statement
When advanced language codes such as PT-BR (Portuguese - Brazil) or SR-LATN (Serbian - Latin script) are used, the implementation incorrectly defaults to English (EN) instead of preserving the specified language code as required by the IAB TCF specification.
Affected Component
Current Behavior
SR-LATN has been added to the supported language Set in ConsentLanguages.ts
- During the encoding process, when advanced language codes like
SR-LATN or PT-BR are specified, the implementation defaults to English (EN)
- When the TC string is decoded, the language shows as
EN instead of the originally specified advanced language code (SR-LATN, PT-BR, etc.)
Expected Behavior
The full language code (e.g., SR-LATN, PT-BR) should be preserved throughout the encoding and decoding process, ensuring that the exact language specification is maintained in the TC string.
Impact
This issue affects:
- Consent strings generated for regions requiring specific language variants (e.g., Brazilian Portuguese, Serbian Latin script)
- Decoding accuracy when reading consent strings
- Compliance with IAB TCF specifications for language handling
Steps to Reproduce
- Set the consent language to an advanced language code (e.g.,
SR-LATN or PT-BR)
- Generate/encode the TC string
- Decode the TC string
- Observe that the decoded language shows as
EN (English) instead of the specified advanced language code (SR-LATN or PT-BR)
Description
There is a critical issue with the
@iabtechlabtcf/corelibrary where advanced language codes are not properly preserved during the TC string encoding and decoding process.Problem Statement
When advanced language codes such as
PT-BR(Portuguese - Brazil) orSR-LATN(Serbian - Latin script) are used, the implementation incorrectly defaults to English (EN) instead of preserving the specified language code as required by the IAB TCF specification.Affected Component
ConsentLanguages.tsmodules/core/src/model/ConsentLanguages.tsin the iabtcf-es repositoryCurrent Behavior
SR-LATNhas been added to the supported language Set inConsentLanguages.tsSR-LATNorPT-BRare specified, the implementation defaults to English (EN)ENinstead of the originally specified advanced language code (SR-LATN,PT-BR, etc.)Expected Behavior
The full language code (e.g.,
SR-LATN,PT-BR) should be preserved throughout the encoding and decoding process, ensuring that the exact language specification is maintained in the TC string.Impact
This issue affects:
Steps to Reproduce
SR-LATNorPT-BR)EN(English) instead of the specified advanced language code (SR-LATNorPT-BR)