npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@webflorist/privacy-policy-text

v1.5.4

Published

Open source texts for a GDPR compliant privacy policy in german and english. Available as php or json.

Downloads

36

Readme

Privacy Policy Texts in German and English

Latest Stable Composer Version Latest Stable npm Version License

This package includes open source texts for a GDPR conform privacy policy of a website. They come in php and json files to be used by common translation frameworks.

Table Of Contents

Demo

An demo application with the texts included in this package is avaliable at:
https://privacy-policy-vue-demo.netlify.app/

This demo uses the package webflorist/privacy-policy-vue.

Features

  • Languages
    Currently the package includes texts in german and english language.

  • Singular/Plural
    The files are provided both from singular and plural viewpoints.
    (e.g. My website... vs Our website...)

  • Formats
    Currently the package includes files in php as well as json format.

  • Included Texts

    • A general intro text
    • Listing of GDPR rights
    • Text to introduce data controller
    • General data security text (SSL, etc.)
    • Cookies information
    • Information on data processing of third party data processors:
      • Webhosting
      • Web analytics
      • Interactive maps
      • Sending of emails (e.g. contact forms)
    • Disclaimer regarding outgoing links

Ecosystem

This package is mainly meant as a backend package for other implementations, which use it to provide a privacy policy component to a certain framework.

The following companion packages are currently available: | Package | Framework | | --------------------------------------------------------------------------------- | ------------------------- | | webflorist/privacy-policy-vue | Vue | | webflorist/privacy-policy-laravel | Laravel |

Installation

Using composer:

composer require webflorist/privacy-policy-text

Using npm:

npm install --save @webflorist/privacy-policy-text

Using yarn:

yarn add @webflorist/privacy-policy-text

Usage

In Javascript

The ESM module exports the following stuff:

  • Objects structured as { de: Object, en: Object} including the translation strings with the corresponding interpolation format:
export const colonPrefixSingular : object
export const colonPrefixPlural : object
export const curlyWrapSingular : object
export const curlyWrapPlural : object
export const doubleCurlyWrapSingular : object
export const doubleCurlyWrapPlural : object
export const defaultProcessors : object
export function renderText(text: string): string

Check out the Vue component of webflorist/privacy-policy-vue for an example implementation.

Here is and example using a singular viewpoint and a translation library with curly-wrap interpolations:

import { curlyWrapSingular, renderText } from '@webflorist/privacy-policy-text'
import { translate, provideTranslations } from 'my-favourite-translation-library

provideTranslations({
    de: curlyWrapSingular.de,
    en: curlyWrapSingular.en,
})

const interpolations = {
    'webhosting_processor': 'Netlify Inc.',
    'analytics_service': 'Google Analytics',
    'analytics_processor': 'Google Ireland Limited',
    'maps_service': 'Google Maps',
    'maps_processor': 'Google LLC',
    'send_emails_service': 'Twilio Sendgrid',
    'send_emails_processor': 'Twilio Inc.',
}

// Custom translation function, which uses renderText
// from @webflorist/privacy-policy-text after translation.
const t = (key) => {
    return renderText(translate(key, interpolations))
}

return `
<p>${t('intro_content.p1')}</p>
<p>${t('intro_content.p2')}</p>
<section>
    <h2>${t('gdpr_rights.title')}</h2>
    <p>${t('gdpr_rights.content.p1')}</p>

    ...
`

Interpolations

(Replacing Parameters In Translation Strings)

Any dynamic parts of the language files can be interpolated by the translation-library of your choice. The following formats are supported (each with corresponding json and php files):

  • with colon prefix (:key)
    (e.g. used by Laravel)
  • wrapped with curly braces ({key})
    (e.g. used by Vue I18n)
  • wrapped with double curly braces ({{key}})
    (e.g. used by i18next)

The following interpolations are present in the language files:

{
    // Name of the webhosting service
    'webhosting_service': 'Netlify Platform',
    // Company name of the webhosting processor
    'webhosting_processor': 'Netlify Inc.',

    // Name of the analytics service
    'analytics_service': 'Google Analytics',
    // Company name of the analytics processor
    'analytics_processor': 'Google Ireland Limited',

    // Name of the maps service
    'maps_service': 'Google Maps',
    // Company name of the maps processor
    'maps_processor': 'Google LLC',

    // Name of the email sending service
    'send_emails_service': 'Twilio Sendgrid',
    // Company name of the email sending processor
    'send_emails_processor': 'Twilio Inc.',
}

Markdown Functionality

The language files include some markdown functionality:

  • **Bold Elements**
  • and [Links to](#anchors)

The package includes a renderText(text) function to render these markdowns. The package exports this function. So usage would be as follows:

In Javascript:

import { renderText } from '@webflorist/privacy-policy-text'

renderText(myTranslatedString)

Disclaimer

The included text should be suitable for a GDPR-compliant website.

I however do not take any responsibility whatsowever for that.

License

This package is open-sourced software licensed under the MIT license.