Skip to content
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

Feature: Portuguese language #10

Merged
merged 10 commits into from
Nov 11, 2022
Merged
83 changes: 48 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Angular multi-language module to display a cookie consent banner without other d
[![Open in Codeflow](https://developer.stackblitz.com/img/open_in_codeflow.svg)](https:///pr.new/github.com/giacomo/ngx-cookie-consent)

###### Works with Angular v14+
###### Available languages: English, German, Italian
###### Available languages: English, German, Italian, Portuguese

## Installation

Expand Down Expand Up @@ -55,46 +55,59 @@ import { NgxCookieConsentModule } from '@localia/ngx-cookie-consent';

## Configuration

| Name | Type | Default | Description |
|-----------------------|----------|-------------------|------------------------------------------------------------------------------------|
| privacyPolicyUrl | string | '#' | URL to your privacy policy ⚠ required ⚠ |
| imprintUrl | string | '#' | URL to your imprint ⚠ required ⚠ |
| defaultLanguage | string | 'en' | Default language for the cookie consent banner |
| availableLanguages | string[] | ['en', 'de', 'it'] | Available languages for the cookie consent banner |
| showLanguageSwitcher | boolean | true | Show language switcher |
| showBadgeOpener | boolean | true | Show badge opener |
| openerPosition | enum | 'left-bottom' | Position of the badge eg. 'left-top', 'right-top' , 'left-bottom' , 'right-bottom' |
| customClass | string | '' | Custom class for the cookie consent banner |
| cookiePrefix | string | 'cookieconsent_' | Prefix for the cookie consent banner |
| cookieExpiryDays | number | 365 | Expiry days for the cookie consent banner |
| showCookieDetails | boolean | false | Show cookie details |
| showFunctionalCookies | boolean | true | Show functional cookies |
| functionalCookies | CookieItem[] | [] | Functional cookies |
| showMarketingCookies | boolean | true | Show marketing cookies |
| marketingCookies | CookieItem[] | [] | Marketing cookies |
| showEssentialCookies | boolean | true | Show essential cookies |
| essentialCookies | CookieItem[] | [] | Essential cookies |
| showOtherTools | boolean | true | Show other tools |
| otherTools | CookieItem[] | [] | Other tools |
| excludeRoutes | string[] | [] | Exclude routes eg. ['/privacy-policy'] |
| Name | Type | Default | Description |
|-----------------------|----------------------------------|--------------------|------------------------------------------------------------------------------------|
| privacyPolicyUrl | string | TranslatableString | '#' | URL to your privacy policy ⚠ required ⚠ |
| imprintUrl | string | TranslatableString | '#' | URL to your imprint ⚠ required ⚠ |
| defaultLanguage | string | 'en' | Default language for the cookie consent banner |
| availableLanguages | string[] | ['en', 'de', 'it'] | Available languages for the cookie consent banner |
| showLanguageSwitcher | boolean | true | Show language switcher |
| showBadgeOpener | boolean | true | Show badge opener |
| openerPosition | enum | 'left-bottom' | Position of the badge eg. 'left-top', 'right-top' , 'left-bottom' , 'right-bottom' |
| customClass | string | '' | Custom class for the cookie consent banner |
| cookiePrefix | string | 'cookieconsent_' | Prefix for the cookie consent banner |
| cookieExpiryDays | number | 365 | Expiry days for the cookie consent banner |
| showCookieDetails | boolean | false | Show cookie details |
| showFunctionalCookies | boolean | true | Show functional cookies |
| functionalCookies | CookieItem[] | [] | Functional cookies |
| showMarketingCookies | boolean | true | Show marketing cookies |
| marketingCookies | CookieItem[] | [] | Marketing cookies |
| showEssentialCookies | boolean | true | Show essential cookies |
| essentialCookies | CookieItem[] | [] | Essential cookies |
| showOtherTools | boolean | true | Show other tools |
| otherTools | CookieItem[] | [] | Other tools |
| excludeRoutes | string[] | [] | Exclude routes eg. ['/privacy-policy'] |

### CookieItem interface

| Name | Type | Description |
|-------------|--------|-------------------------------------------------------------------------------------------------------------------------------------|
|key | string | Key for the cookie eg. 'functional_google_analytics' |
|name | string | Name for the cookie eg. 'Google Analytics' |
|description | string | Description for the cookie eg. 'Google Analytics is a web analytics service offered by Google that tracks and reports website traffic.' |
|privacyPolicyUrl| string | URL to the privacy policy for the cookie eg. 'https://policies.google.com/privacy' |
|cookies | CookieDetail[] | Cookie details for the cookie |
| Name | Type | Description |
|------------------|----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| key | string | Key for the cookie eg. 'functional_google_analytics' |
| name | string | TranslatableString | Name for the cookie eg. 'Google Analytics' |
| description | string | TranslatableString | Description for the cookie eg. 'Google Analytics is a web analytics service offered by Google that tracks and reports website traffic.' |
| privacyPolicyUrl | string | TranslatableString | URL to the privacy policy for the cookie eg. 'https://policies.google.com/privacy' |
| cookies | CookieDetail[] | Cookie details for the cookie |

### CookieDetail interface

| Name | Type | Description |
|-------------|--------|-----------------------------------------------------------------------------|
|name | string | Name for the saved cookie eg. '_ga' |
|description | string | Description for the saved cookie eg. 'This cookie is used to distinguish users.' |
|duration | string | Duration for the saved cookie eg. '2 years' |
| Name | Type | Description |
|-------------|----------------------------------|----------------------------------------------------------------------------------|
| name | string | Name for the saved cookie eg. '_ga' |
| description | string | TranslatableString | Description for the saved cookie eg. 'This cookie is used to distinguish users.' |
| duration | string | TranslatableString | Duration for the saved cookie eg. '2 years' |

### TranslatableString interface

The `TranslatableString` interface is used to define a string that can be translated into multiple languages. **It is optional to use this interface. If you don't use it, the string will be used as it is.**

> ⚠ The `TranslatableString` interface if used, will automatically fall back to defaultLanguage used if no translation key defined for the desired language.

| Name | Type | Description |
|------|--------|-----------------------------------------|
| en | string | English string for the specified key |
| de | string | German string for the specified key |
| it | string | Italian string for the specified key |
| pt | string | Portuguese string for the specified key |

## Contributing

Expand Down
Loading