Comments (8)
Example of init with all possible resource keys
<script type="application/javascript">
ConsentCookie.init({
'general': {
'gdpr': {
'contact': ''
},
'consentwall': {
'enabled': true,
'timeout': 1000,
}
},
'apps': {
'endpoint': '',
'consent': {
'cc': {
'initstate': 'optin'
},
'iq': {
'initstate': 'optin'
},
'ga': {
'initstate': 'optin'
},
'gtm': {
'initstate': 'optin'
}
}
},
'design': {
'layout': {
'position': 'right'
},
'colorscheme': {
'primary': '',
'secondary': '',
}
},
'resources': {
nl: {
general: {
on: 'Aan',
off: 'Uit',
close: 'Sluiten',
moreInfo: 'Meer informatie',
},
menu: {
applications: 'Jouw instellingen',
about: 'Over ConsentCookie',
open: 'ConsentCookie openen',
close: 'ConsentCookie sluiten',
disabled: 'accepteer eerst',
},
applications: {
title: 'Jouw instellingen',
moreInfo: 'Meer informatie over deze applicaties',
moreInfoLink: 'https://www.consentcookie.nl',
actions: {
gdpr: 'Recht op...',
},
detail: {
moreInfo: 'Meer informatie over',
gdprInfo: 'Contact over jouw AVG rechten',
},
profile: {
title: 'Jouw profiel',
loading: 'Profiel wordt opgehaald',
noPlugin: 'Deze applicatie heeft geen publiek profiel beschikbaar',
noProfile: 'Geen profiel beschikbaar',
},
},
about: {
title: 'Over ConsentCookie',
text: '', // When empty it takes the default
},
consent: {
title: 'ConsentCookie!',
text: '', // When empty it takes the default
button: 'Ok!',
infolink: 'https://www.consentcookie.nl',
},
}
}
});
</script>
The nl in the resource stands for the language code. To add a translation for another language add a new resource node with the language code of the chosen language.
<script type="application/javascript">
ConsentCookie.init({
resources: {
'nl': {
general: {
on: 'Aan',
off: 'Uit',
close: 'Sluiten',
moreInfo: 'Meer informatie',
},
},
'en-US': {
general: {
on: 'On',
off: 'Off',
close: 'Close',
moreInfo: 'More information',
},
},
'de': {
general: {
on: 'Auf',
off: 'Aus',
close: 'Schließen',
moreInfo: 'Mehr Informationen',
},
},
}
});
</script>
(Don`t mind the bad translations)
from consentcookie.
@StevenChoo can you check the questionmarks in this comment.
Tests
Test 1 Check if all fields are changed by filling them in JSON
In Dutch I tested with an extra letter for the first word in the json, so the difference between standard CC and the text in the json would be visible.
- Are for all the available fields the changes visible.
general:
- on: 'Aaan',
- off: 'Uitt',
❓ close: 'Sluiiten', - moreInfo: 'MMeer info', (gebruikt op Consent pagina voor de infolink)
menu
- applications: 'jJouw instellingen' (mouseover in menu)
- about: 'oOver ConsentCookie', (mouseover in menu)
- open: 'cConsentCookie openen',(mouseover in menu)
- close: 'cConsentCookie sluiten',(mouseover in menu)
- disabled: 'aaccepteer eerst',(mouseover in menu)
applications:
- title: 'jjJouw instellingen',
❓ moreInfo: 'mMeer informatie over deze applicaties',
❓ moreInfoLink: 'https://www.consentcookie.eu',
actions:
❓ gdpr: 'RRecht op...',
detail:
- moreInfo: 'MMeer informatie over',
- gdprInfo: 'CContact over jouw AVG rechten',
profile:
- title: 'JJouw profiel',
- loading: 'PProfiel wordt opgehaald',
- noPlugin: 'DDeze applicatie heeft geen publiek profiel beschikbaar',
- noProfile: 'GGeen profiel beschikbaar',
about:
- title: 'OOver ConsentCookie',
- text: 'ttext', // When empty it takes the default
consent
- title: 'CConsentCookie!',
- text: 'ttxt', // When empty it takes the default
- button: 'OOk!',
- infolink: 'https://www.consentcookie.eu',
Test 2 Change default language in Chrome
- Does the text change to another language when selecting another default language in Chrome
Test 3 Default language Chrome is not available.
A Only one language
Tested with only Russian in the preferred list
- Is the default dutch when the preferred chrome language is not available
- Expect Dutch translation because the preferred language Russian is not available.
B Preferred language not available, second preference 'en-US'
Tested with Russian preferred second 'en-US', third 'de' and fourth 'nl'. Because dutch is the default in the ConsentCookie code I expect this is used in stead of 'en-US'
- Expect Dutch translation because the preferred language Russian is not available.
In future the check might take into account that 'en-US' has a higher preference then 'nl'. Should be new improvement.
Test 4 Language doesn't have all the fields
Used 'de' as preferred language, but only filled 4 fields with text.
- If not all the fields are available in the language are the other fields shown in the default language Dutch
Testdata used
Tested this in Chrome by putting a language in the settings advanced on top.
Dutch: nl
English US: en-US
German: de
json
<script src="//cdn.humanswitch.services/cc/consentcookie/consentcookie.min.js"></script>
<script type="application/javascript">
ConsentCookie.init({
'general': {
'gdpr': {
'contact': 'https://www.christianvriens.com'
},
'consentwall': {
'enabled': true,
'timeout': 1000,
}
},
'apps': {
'endpoint': '',
'consent': {
'cc': {
'initstate': 'optin'
},
'iq': {
'initstate': 'optin'
},
'ga': {
'initstate': 'optin'
},
'gtm': {
'initstate': 'optin'
}
}
},
'design': {
'layout': {
'position': 'right'
},
'colorscheme': {
'primary': '',
'secondary': '',
}
},
'resources': {
'nl': {
general: {
on: 'Aaan',
off: 'Uitt',
close: 'Sluiiten',
moreInfo: 'MMeer info',
},
menu: {
applications: 'jJouw instellingen',
about: 'oOver ConsentCookie',
open: 'cConsentCookie openen',
close: 'cConsentCookie sluiten',
disabled: 'aaccepteer eerst',
},
applications: {
title: 'jjJouw instellingen',
moreInfo: 'mMeer informatie over deze applicaties',
moreInfoLink: 'https://www.consentcookie.eu',
actions: {
gdpr: 'RRecht op...',
},
detail: {
moreInfo: 'MMeer informatie over',
gdprInfo: 'CContact over jouw AVG rechten',
},
profile: {
title: 'JJouw profiel',
loading: 'PProfiel wordt opgehaald',
noPlugin: 'DDeze applicatie heeft geen publiek profiel beschikbaar',
noProfile: 'GGeen profiel beschikbaar',
},
},
about: {
title: 'OOver ConsentCookie',
text: 'ttext', // When empty it takes the default
},
consent: {
title: 'CConsentCookie!',
text: 'ttxt', // When empty it takes the default
button: 'OOk!',
infolink: 'https://www.consentcookie.eu',
},
},
'en-US': {
general: {
on: 'on',
off: 'off',
close: 'close',
moreInfo: 'More more',
},
menu: {
applications: 'Your configuration',
about: 'About CC',
open: 'Open CC',
close: 'Close CC',
disabled: 'First accepts',
},
applications: {
title: 'Your configuration',
moreInfo: 'More info about this app',
moreInfoLink: 'https://www.consentcookie.eu',
actions: {
gdpr: 'Your rights on .. ',
},
detail: {
moreInfo: 'More info',
gdprInfo: 'Contact us about your GDPR rights',
},
profile: {
title: 'Your profile',
loading: 'Get profile',
noPlugin: 'This app doesnt have a public profile',
noProfile: 'No profile available',
},
},
about: {
title: 'About CC',
text: 'This is en text', // When empty it takes the default
},
consent: {
title: 'CC!',
text: 'this is en text', // When empty it takes the default
button: 'Agree!',
infolink: 'https://www.consentcookie.eu',
}
},'de': {
general: {
on: 'Auf',
off: 'Aus',
close: 'Schließen',
moreInfo: 'Mehr Informationen',
},
}
}
});
</script>
from consentcookie.
My suggestion with with previous comment: If text with questionmark isn't used remove it.
#47 (comment)
from consentcookie.
@StevenChoo shouldn't the field 'general': 'moreinfo' be with 'consent'?
And if this is changed will existing users still be able to use this in CC?
❓ create improvement issue for this
from consentcookie.
@StevenChoo shouldn't the field 'general': 'moreinfo' be with 'consent'?
And if this is changed will existing users still be able to use this in CC?
question create improvement issue for this
Need to check this out
from consentcookie.
My suggestion with with previous comment: If text with questionmark isn't used remove it.
#47 (comment)
All text referenced in the config are beeing used. If not its a bug.
from consentcookie.
question close: 'Sluiiten',
Removed from default config due to not beeing used.
question gdpr: 'RRecht op...',
Is used for the link shown at every application for requesting GDPR actions. It is only shown when the GDPR option is used
question moreInfo: 'mMeer informatie over deze applicaties',
question moreInfoLink: 'https://www.consentcookie.eu',
It seems to be removed since v0.6.0
Created issue for this: #58
from consentcookie.
Fixed
from consentcookie.
Related Issues (20)
- use of ConsentCookie.off function results in error
- Alwayson tracker toggle shows 'off' instead of on HOT 2
- ConsentCookie API changes #23 regression bug HOT 2
- application logo icons optional HOT 1
- Update webpack 1 HOT 1
- Where is the tracker list? HOT 1
- Default and fallback language HOT 2
- Language codes reference to available languages HOT 4
- Set default language through CC API HOT 2
- ConfigService getDefault
- Navigate within consentcookie using API HOT 3
- Add default language: en
- Consentcookie option to persit on top domain HOT 1
- ConsentCookie not working properly on mobile devices
- ConsentCookie plugin selection
- reintroduce application detail info HOT 1
- scrollbar missing HOT 2
- missing icon shows 'broken' image HOT 1
- You were added to awesome-humane-tech
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consentcookie.