giacomo / ngx-cookie-consent

Angular multi-language module to display a cookie consent banner without other dependencies.
https://www.npmjs.com/package/@localia/ngx-cookie-consent
MIT License
16 stars 7 forks source link

Dynamic Language Update for Consent Manager and Cookie Handling Service #21

Closed sai-gmbh closed 1 month ago

sai-gmbh commented 1 month ago

Hi,

I have a question regarding dynamically updating the language in the consent manager in sync with the website language. Currently, I see you have a service (NgxCookieConsentService), but it's not publicly exported, so I'm unable to trigger the language change in the consent manager when the website language changes.

Is there any recommended way or service available to achieve this? Additionally, is there a service provided to deactivate Google Analytics if cookies haven't been allowed, apart from the example shown for Google videos in your StackBlitz demo?

Ideally, I’m looking for a service that:

Provides a method to read all cookies and expose them as BehaviorSubject. Offers an additional method where a user can input a cookie name and retrieve a filtered result as an observable. Or am I possibly missing something?

Thanks a lot for your work in building and maintaining this library continuously!

Best regards,

giacomo commented 1 month ago

@sai-gmbh i will take a look into it.

sai-gmbh commented 1 month ago

@giacomo Any update??

giacomo commented 1 month ago

@sai-gmbh working on it ;)

could you please check this.cookieManagerService.cookieUpdated$ basically it is a Subject and it is always called when updating a cookie.

giacomo commented 1 month ago

@sai-gmbh relased with v3.1.0

see example: https://github.com/giacomo/ngx-cookie-consent/blob/572ee78b746df6957ff3118a3df84d7a4d700f53/src/app/pages/home/home.component.ts#L23