Comments (2)
Implemented the default and fallback language options.
Example:
ConsentCookie.init({
'general': {
'language': {
'default': 'fr',
'fallback': 'en'
}
},
'resources': {
'nl': {
'about': {
'title': 'Dutch',
},
},
'en': {
'about': {
'title': 'English',
},
},
'fr': {
'about': {
'title': 'French',
},
},
'en-US': {
'about': {
'title': 'en-US',
},
}
}
});
The example above shows a config with 4 languages defined, nl
, en
, fr
and en-US
.
Following the flow of the description the language in ConsentCookie is changed.
To test the fallback config, change the browser language to something not configured, like German and remove the default option. To see the changes, check the title of the about screen.
from consentcookie.
Test results
Default language ✔️
Used example script on my GTM demo page. As expected, the title ' French' appeared in the About screen.
Fallback language ✔️
Used example script on my GTM demo page. Removed all my languages in Google Chrome and added only the (not supported) "Danish" language. As expected, the title ''English' appeared in the About screen.
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
- Multilanguage support HOT 8
- application logo icons optional HOT 1
- Update webpack 1 HOT 1
- Where is the tracker list? HOT 1
- 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.