Skip to content

Commit

Permalink
Docs: Introduce companyNames option in readme #CCM-25
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Nov 19, 2021
1 parent d5bf67b commit 06637bc
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 17 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ initLmcCookieConsentManager( // when loaded as a module, these options are passe
|---------------|----------|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| `defaultLang` | string | 'cs' | Default language. One of `cs`, `de`, `en`, `hu`, `pl`, `ru`, `sk`, `uk`. This language will be used when autodetect is disabled or when it fails. |
| `autodetectLang`| string | true | Autodetect language from the browser. If autodetect fails or if unsupported language is detected, fallback to `defaultLang`.<br>When disabled, force language to `defaultLang`. |
| `companyNames`| array | ['LMC'] | Array of strings with company names. Adjust only when the consent needs to be given to multiple companies. |
| `config` | Object | {} | Override default config of the underlying library. For all parameters see [original library](https://github.com/orestbida/cookieconsent#all-available-options). |
| `on*` callbacks| function | (cookie, cookieConsent) => {} | See below for configurable callbacks. |
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"esbuild": "^0.13.6",
"husky": "^7.0.2",
"jest": "^27.3.1",
"jest-each": "^27.3.1",
"npm-run-all": "^4.1.5",
"postcss": "^8.3.6",
"postcss-cli": "^9.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/LmcCookieConsentManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const defaultOptions = {
* @param {function} [args.onAccept] - Callback to be executed when any consent is detected (either given right now or already saved previously)
* @param {function} [args.onAcceptOnlyNecessary] - Callback to be executed when consent with only necessary cookies is detected (either given right now or already saved previously)
* @param {function} [args.onAcceptAll] - Callback to be executed when consent with all cookies is detected (either given right now or already saved previously)
* @param {array} [args.companyNames] - Array of strings with company names used to parametrized translations
* @param {array} [args.companyNames] - Array of strings with company names. Adjust only when the consent needs to be given to multiple companies.
* @param {Object} [args.config] - Override default config. See https://github.com/orestbida/cookieconsent/blob/master/Readme.md#all-available-options
* @returns {Object} Instance of the underlying CookieConsent component. For available API, see https://github.com/orestbida/cookieconsent#apis--configuration-parameters
*/
Expand Down
5 changes: 2 additions & 3 deletions src/languages/__tests__/langConfig.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import each from 'jest-each';
import { config as configCs } from '../cs';
import { config as configDe } from '../de';
import { config as configEn } from '../en';
Expand All @@ -8,7 +7,7 @@ import { config as configRu } from '../ru';
import { config as configSk } from '../sk';
import { config as configUk } from '../uk';

each([
describe.each([
['cs', configCs],
['de', configDe],
['en', configEn],
Expand All @@ -17,7 +16,7 @@ each([
['ru', configRu],
['sk', configSk],
['uk', configUk],
]).describe('config %s', (name, config) => {
])('config %s', (name, config) => {
it('should return localization object', () => {
expect(config({ companyNames: ['test1', 'test2', 'test3'] })).toMatchSnapshot();
});
Expand Down
4 changes: 2 additions & 2 deletions src/languages/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const extra = {

/**
* @param {Object} [messages] - Object with extra messages
* @param {array} [args.companyNames] - Array of strings with company names used to parametrized translations
* @param {array} [messages.companyNames] - Array of strings with company names used to parametrized translations
* @returns {Object} Object with translated messages
*/
export const config = (messages) => {
Expand All @@ -23,7 +23,7 @@ export const config = (messages) => {
lang.companies,
)} ${addSeparators(
lang.companyNames,
extra.and,
lang.and,
)} k využívání souborů Cookies a dalších identifikátorů ve vašem zařízení. Použití těchto Cookies a dalších identifikátorů usnadní navigaci na stránkách, zobrazení personalizovaného obsahu, cílený marketing, analýzu využívání našich produktů a služeb.
Více informací naleznete na stránce <a href="https://www.lmc.eu/cs/cookies" target="_blank">Používání cookies</a>.`,
primary_btn: {
Expand Down
2 changes: 1 addition & 1 deletion src/languages/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const extra = {

/**
* @param {Object} [messages] - Object with extra messages
* @param {array} [args.companyNames] - Array of strings with company names used to parametrized translations
* @param {array} [messages.companyNames] - Array of strings with company names used to parametrized translations
* @returns {Object} Object with translated messages
*/
export const config = (messages) => {
Expand Down
2 changes: 1 addition & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const extra = {

/**
* @param {Object} [messages] - Object with extra messages
* @param {array} [args.companyNames] - Array of strings with company names used to parametrized translations
* @param {array} [messages.companyNames] - Array of strings with company names used to parametrized translations
* @returns {Object} Object with translated messages
*/
export const config = (messages) => {
Expand Down
2 changes: 1 addition & 1 deletion src/languages/hu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const extra = {

/**
* @param {Object} [messages] - Object with extra messages
* @param {array} [args.companyNames] - Array of strings with company names used to parametrized translations
* @param {array} [messages.companyNames] - Array of strings with company names used to parametrized translations
* @returns {Object} Object with translated messages
*/
export const config = (messages) => {
Expand Down
2 changes: 1 addition & 1 deletion src/languages/pl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const extra = {

/**
* @param {Object} [messages] - Object with extra messages
* @param {array} [args.companyNames] - Array of strings with company names used to parametrized translations
* @param {array} [messages.companyNames] - Array of strings with company names used to parametrized translations
* @returns {Object} Object with translated messages
*/
export const config = (messages) => {
Expand Down
4 changes: 2 additions & 2 deletions src/languages/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const extra = {

/**
* @param {Object} [messages] - Object with extra messages
* @param {array} [args.companyNames] - Array of strings with company names used to parametrized translations
* @param {array} [messages.companyNames] - Array of strings with company names used to parametrized translations
* @returns {Object} Object with translated messages
*/
export const config = (messages) => {
Expand All @@ -23,7 +23,7 @@ export const config = (messages) => {
lang.companies,
)} ${addSeparators(
lang.companyNames,
extra.and,
lang.and,
)} на использование файлов cookie и других идентификаторов на Вашем устройстве. Использование файлов cookie и других идентификаторов облегчит навигацию по сайту, отображения персонализированного контента, целевой маркетинг, анализ использования наших продуктов и услуг.
Для получения дополнительной информации см. раздел <a href="https://www.lmc.eu/en/cookies/" target="_blank">использование файлов cookie</a>.`,
primary_btn: {
Expand Down
4 changes: 2 additions & 2 deletions src/languages/sk.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const extra = {

/**
* @param {Object} [messages] - Object with extra messages
* @param {array} [args.companyNames] - Array of strings with company names used to parametrized translations
* @param {array} [messages.companyNames] - Array of strings with company names used to parametrized translations
* @returns {Object} Object with translated messages
*/
export const config = (messages) => {
Expand All @@ -23,7 +23,7 @@ export const config = (messages) => {
lang.companies,
)} ${addSeparators(
lang.companyNames,
extra.and,
lang.and,
)} k využívaniu súborov Cookies a ďalších identifikátorov vo vašom zariadení. Použitie týchto cookies a ďalších identifikátorov uľahčí navigáciu na stránkach, zobrazenie personalizovaného obsahu, cielený marketing, analýzu využívania našich produktov a služieb.
Viac informácií nájdete na stránke <a href="https://www.lmc.eu/sk/cookies" target="_blank">Používanie cookies</a>.`,
primary_btn: {
Expand Down
4 changes: 2 additions & 2 deletions src/languages/uk.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const extra = {

/**
* @param {Object} [messages] - Object with extra messages
* @param {array} [args.companyNames] - Array of strings with company names used to parametrized translations
* @param {array} [messages.companyNames] - Array of strings with company names used to parametrized translations
* @returns {Object} Object with translated messages
*/
export const config = (messages) => {
Expand All @@ -23,7 +23,7 @@ export const config = (messages) => {
lang.companies,
)} ${addSeparators(
lang.companyNames,
extra.and,
lang.and,
)} на використання файлів cookie та інших ідентифікаторів на Вашому пристрої. Використання цих файлів cookie та інших ідентифікаторів полегшить навігацію по сайту, відображення персоналізованого контенту, цільовий маркетинг, аналіз використання наших продуктів і послуг.
Для отримання додаткової інформації див. розділ <a href="https://www.lmc.eu/en/cookies/" target="_blank">Використання файлів cookie</a>.`,
primary_btn: {
Expand Down

0 comments on commit 06637bc

Please sign in to comment.