Skip to content

Commit

Permalink
Merge pull request #3 from MEOM/update/copy
Browse files Browse the repository at this point in the history
Update copy text.
  • Loading branch information
samikeijonen authored Jan 18, 2023
2 parents 8815f4d + 0028a5b commit 7729f8a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
12 changes: 6 additions & 6 deletions inc/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
*/
function render_block( $block_content, $block ) {
/**
* Filters the condition when to add Cookiebot message to the embed block.
*
* @param string $condition Condition.
* @param string $block_content The block content about to be appended.
* Filters the condition when to add Cookiebot message to the embed block.
*
* @param string $condition Condition.
* @param string $block_content The block content about to be appended.
* @param array $block The full block, including name and attributes.
*/
*/
$condition = apply_filters( 'meom_cookiebot_embed_condition', 'core/embed' === $block['blockName'] && 'youtube' === $block['attrs']['providerNameSlug'], $block_content, $block );

if ( $condition ) {
$cookie_text = '<div class="wp-block-embed__cookiebot-message cookieconsent-optout-marketing"><p>';
$cookie_text .= sprintf( __( 'Please <a href="%s">accept marketing-cookies</a> to watch this video.', 'meom-cookiebot-embed' ), 'javascript:Cookiebot.renew()' );
$cookie_text .= sprintf( __( 'Oops! This video will not be shown because you have disabled the marketing cookies. To see the video, <a href="%s">accept marketing cookies</a>.', 'meom-cookiebot-embed' ), 'javascript:Cookiebot.renew()' );
$cookie_text .= '</p></div>';

$block_content = str_replace( '</figure>', $cookie_text . '</figure>', $block_content );
Expand Down
Binary file modified languages/meom-cookiebot-embed-fi.mo
Binary file not shown.
25 changes: 17 additions & 8 deletions languages/meom-cookiebot-embed-fi.po
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: MEOM Cookiebot embed\n"
"POT-Creation-Date: 2022-12-09 10:41+0200\n"
"PO-Revision-Date: 2022-12-09 10:42+0200\n"
"POT-Creation-Date: 2023-01-18 12:39+0200\n"
"PO-Revision-Date: 2023-01-18 12:41+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fi\n"
Expand All @@ -16,18 +16,20 @@ msgstr ""
"X-Poedit-WPHeader: meom-cookiebot-embed.php\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
"_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
"X-Poedit-SearchPathExcluded-1: vendor\n"

#: inc/filters.php:21
#: inc/filters.php:30
#, php-format
msgid "Please <a href=\"%s\">accept marketing-cookies</a> to watch this video."
msgid ""
"Oops! This video will not be shown because you have disabled the marketing "
"cookies. To see the video, <a href=\"%s\">accept marketing cookies</a>."
msgstr ""
"Hyväksy <a href=\"%s\">markkinointievästeet</a>, jotta voit nähdä tämän "
"videon."
"Oho! Tämä video ei näy, koska olet kieltänyt markkinointievästeiden käytön. "
"Nähdäksesi videon, <a href=\"%s\">käy hyväksymässä markkinointievästeet</a>."

#. Plugin Name of the plugin/theme
msgid "MEOM Cookiebot embed"
Expand All @@ -46,3 +48,10 @@ msgstr ""
#. Author URI of the plugin/theme
msgid "https://www.meom.fi/"
msgstr ""

#, php-format
#~ msgid ""
#~ "Please <a href=\"%s\">accept marketing-cookies</a> to watch this video."
#~ msgstr ""
#~ "Hyväksy <a href=\"%s\">markkinointievästeet</a>, jotta voit nähdä tämän "
#~ "videon."
8 changes: 5 additions & 3 deletions languages/meom-cookiebot-embed.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: MEOM Cookiebot embed\n"
"POT-Creation-Date: 2022-12-09 10:41+0200\n"
"POT-Creation-Date: 2023-01-18 12:39+0200\n"
"PO-Revision-Date: 2022-12-08 16:43+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -22,9 +22,11 @@ msgstr ""
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
"X-Poedit-SearchPathExcluded-1: vendor\n"

#: inc/filters.php:21
#: inc/filters.php:30
#, php-format
msgid "Please <a href=\"%s\">accept marketing-cookies</a> to watch this video."
msgid ""
"Oops! This video will not be shown because you have disabled the marketing "
"cookies. To see the video, <a href=\"%s\">accept marketing cookies</a>."
msgstr ""

#. Plugin Name of the plugin/theme
Expand Down

0 comments on commit 7729f8a

Please sign in to comment.