-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
label_cpc_purpose_desc is not taken from locale.json #192
Comments
We'll check it. Meanwhile, can you try to put your labels directly into the oil configuration? |
Unfortunately, I cannot reproduce this problem. Currently, there are different possibilities to configure texts for the Opt-In Layer and its CPC. I tested all of them. The minimum configuration is as follows:
In this case no texts are configured and the default locale configuration of the layer is used. The layer correctly shows 'Purpose' for Second option is configuration of locale directly within layer configuration in the web page. Here is my example (not all keys are configured to have a simple example here):
The Opt-In Layer correctly shows "Verwendungszweck:" for Third option is usage of a remotely accessable locale json as shown in this example:
My remotely accessable locale.json contains the following definitions (again, not all keys are configured to have a simple example here):
The Opt-In Layer correctly shows "Verwendungszweck:" for As already said I tested all three options and they worked for me. Could you post your configuration please? Then it may be easier to find the problem. |
Sorry for the long delay, I have been on vacation and without internet access. I have pinpointed the issue, I think. My intention was to have an external locale.json containing a default localized version of all texts that may be used for several sites and have these sites override specific texts (well, really just label_intro would be sufficient) with their own oil-configuration. I had hoped that the texts-objects from locale.json and the on-page oil-configuration would be merged in a way that would give precendence to the local configuration while retaining all keys from the external json that are not defined in the local config. As soon as I remove the locale-key from the onpage configuration, the texts set in locale_url are being shown as intended. Here is my config which is causing the issue: {
"publicPath": "//consent.some-domain.tld/1.2.2-SNAPSHOT/",
"poi_activate_poi": true,
"poi_hub_origin": "//consent.some-domain.tld",
"poi_hub_path": "/1.2.2-SNAPSHOT/hub.html",
"poi_subscriber_set_cookie": true,
"poi_group_name": "MyGroupName",
"advanced_settings": true,
"theme": "small light",
"cpc_type": "tabs",
"locale": {
"localeId": "deDE_01",
"version": 1,
"texts" :{
"label_intro": "My site-specific intro"
}
},
"locale_url": "//consent.some-domain.tld/locale/deDE_01_locale.json"
} and consent.some-domain.tld/locale/deDE_01_locale.json is the same as here https://github.com/as-ideas/oil/blob/master/test/fixtures/config/deDE_01_locale.json. As I said: if I remove locale from the configuration, all is well, although a site can no longer set their own text. Is there some way to achieve the desired behaviour or does each site need their full locale.json, even though there may just be minor differences (for example the company name in the intro)? |
Sorry for the delay. We were very busy the last month with another project. The expected behaviour you described is exactly the behaviour that is implemented in the opt-in layer. I tried it with your configuration (except with another locale_url, publicPath and poi-hub configuration) - and it worked for me perfectly. So this is a little bit mysterious. Are there any messages on the JS console? |
I just did another test case, this time using oil.1.2.5-RELEASE. If I have just "locale_url" pointing to my json file, all is well. If I add the "locale" property, the texts from the "locale_url" are being ignored and it falls back to the english default locale for anything not configured in the "locale" property in the advanced settings tab. Console shows no error messages, it even says "Fetching data from url: //[myhost]/locale/deDE_01_locale.json", there's no CORS error or anything. localeId and version properties are the same in both locale property and external json file, but I tried with different values in locale and locale_url, which didn't change the result. So this works fine, though it will of course display the intro from the json file:
while this here just displays the "My Custom Intro" and "Mehr Informationen" from the json-file, but english texts everywhere when I click on "Mehr Informationen":
For the time being, I'll work around the problem by creating a separate json file for each case, but it would be nice if I could just customize the intro if I actually need to customize it and still use everything else from the json file. Just for to avoid confusion: This is the full config that is causing the problem:
You should see the issue as soon as you click on the "Mehr Informationen" button. The inital opt in layer actually looks fine, it's just the advanced settings view that falls back to english locale. |
Ok, the hint to the CPC was helpful. I guess the problem is that your remotely retrieved
The problem with the vendor list is that IAB provides an english version only. Translated purposes texts can be retrieved from special urls like
|
Thank you for your last detailed description. Now I could reproduce the problem that affects labels with prefix 'label_cpc_purpose' only. |
Found and fixed the issue: Current procedure:
This means that the current implementation does only use the "missing labels". Solution: Currently only missing labels are overwritten. This does not make sense. You can simply take anything that is not defined from the localeUrl. |
Fixed with #228 |
When advanced_settings is set to true, label_cpc_purpose_desc is always rendered literally as "label_cpc_purpose_desc" instead of being replaced with the value from the language json.
The text was updated successfully, but these errors were encountered: