webflorist/privacy-policy-text
Composer 安装命令:
composer require webflorist/privacy-policy-text
包简介
Open source texts for a privacy policy in german and english. Available as php or json.
README 文档
README
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...vsOur website...) -
Formats
Currently the package includes files inphpas well asjsonformat. -
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
- An object with information about various processors (see
processors.json):
export const defaultProcessors : object
- A helper function to render the markdown functionality in the language strings:
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.
webflorist/privacy-policy-text 适用场景与选型建议
webflorist/privacy-policy-text 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.63k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 12 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「localization」 「Policy」 「english」 「privacy」 「german」 「legal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 webflorist/privacy-policy-text 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 webflorist/privacy-policy-text 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 webflorist/privacy-policy-text 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Package for convenient work with Laravel's localization features
Field for number with restricted count of digits and decimal places
DeepL API client wrapper for Laravel
Simple and configurable SilverStripe module to notify users about cookie policies
A module for CSP headers in Silverstripe.
Deepl Automated translations for Laravel lang files
统计信息
- 总下载量: 2.63k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-21