Cookie Consent
This is an internationalized Cookie Consent component for vue 3.
The first category must be the essentials
category. Only Cookies in this first category are accepted per default and can't be declined.
All Cookies of other categories are declined per default.
For each Cookie you can pass optional onAccepted
and onDenied
functions, to hand in some code, which will be executed after save selection
or save all
is clicked.
Component properties
export interface Props {
categories: Array<Category>;
requiredLinks: RequiredLinksProps;
links?: Array<Link>;
useMetaCookie?: boolean;
animationDuration?: string;
minimizeAnimationDuration?: string;
hideDuration?: string;
}
Additional interfaces
export interface Category {
id: string;
label: string;
description?: string;
cookies?: Array<Cookie>;
}
export interface RequiredLinksProps {
privacy: Link;
impress: Link;
}
export interface Link {
title: string;
href: string;
}
export interface Cookie {
id: string;
name: string;
purpose: string;
provider?: string;
cookieName?: string;
cookieValidityPeriod?: string;
onAccepted?: Function;
onDenied?: Function;
privacyURL?: string;
links?: Array<Link>;
hosts?: string;
}
Use component
Import the CSS Style Declarations with
import '@avensio/cookie-consent/style.css'
and then the component with
import CookieConsent from '@avensio/cookie-consent'
now it's possible to use this component in another vue component.
Language Codes (ISO-639-1)
The language codes are listed in IANA Subtag Registry (see also IANA Protocols (Language Tags) and taken from Wikipedia | List of ISO-639-1 codes.
Every translation block of this Cookie-Consent is named after the appropriate ISO-639-1 code.
- Arabic ar
- Bulgarian bg
- Czech cs
- Danish da
- German de
- Greek el
- English en
- Spanish es
- Estonian et
- Finnish fi
- French fr
- Indian (Hindi) hi
- Croatian hr
- Hungarian hu
- Armenian hy
- Italian it
- Luxembourgian lb
- Lithuanian lt
- Latvian lv
- Dutch nl
- Norwegian no
- Polish pl
- Portuguese pt
- Romanian ro
- Russian ru
- Slovakian sk
- Slovenian sl
- Albanian sq
- Swedish sv
- Turkish tk
- Ukrainian uk
- Chinese zh
In sum 32 languages are supported, mostly from the EU and some others like arabic, indian, russian and chinese.
The source language for the translations is German. All translations were made with google translate and deepl. For some translations also Leo was used.