embed-privacy icon indicating copy to clipboard operation
embed-privacy copied to clipboard

Add thumbnail support for Polylang

Open oldrup opened this issue 1 year ago • 5 comments

Bug/Problem

I'm using Polylang to provide multiple languages on my website.

The default embed settings for Youtube, includes a default (edit:not background) FEATURED image (the red YouTube logo) as shown in this screenshot below:

image

If I add a translation to that embed, fields are being copied over from the EN to the DA version, and I can change the wording "click here to.." and the link to the privacy policy accordingly.

However, the default featured image (YouTube logo), does not transfer. I can upload or choose my own logo from the media library, but I cannot select the URL to the default logo bundled with Embed Privacy, as it isn't added to the media library (nor should it be, IMO).

image

How do you guys handle embeds in different languages, and the logos?

What am I missing?

Steps to reproduce

  1. Install Embed Privacy 1.9.0
  2. Install Polylang
  3. Add a language
  4. Add a copy of an Embed to the new language
  5. Watch the translated text to work fine, but the default featured to be missing.

Version

1.9.0

Link

https://oldrup.dk/mere-fart-mindre-tracking-med-embed-privacy/

Environment info

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

oldrup avatar Apr 17 '24 10:04 oldrup

Of course, one workaround, is to right-click the featured image (YouTube logo, Spotify logo, etc) when viewing an embed in the original language, download it, and upload it to the translated embeds. No big deal, but doesn't seem like the intended workflow.

oldrup avatar Apr 17 '24 10:04 oldrup

Since for danish the embed provider is youtube-da, Embed Privacy is searching for a file assets/images/embed-youtube-da.png instead of assets/images/embed-youtube.png.

Seems to be fixable by checking whether Polylang is active and is not the default locale. If so, remove the -<locale> from the embed provider name.

As a workaround, you can filter for embed_privacy_logo_path_youtube-da and embed_privacy_logo_url_youtube-da to update the path/URL accordingly.

MatzeKitt avatar Apr 17 '24 18:04 MatzeKitt

As a workaround, you can filter for embed_privacy_logo_path_youtube-da and embed_privacy_logo_url_youtube-da to update the path/URL accordingly.

Ah okay. I thought I was just doing it wrong. This is an edge case, with a completely viable workaround. I'll live just fine having to uploade three or four embed logos. For now. Don't stress over this, but consider it as a possible enhancement in the future.

oldrup avatar Apr 17 '24 19:04 oldrup

I will if you let it open. 😂

MatzeKitt avatar Apr 17 '24 19:04 MatzeKitt

I coded Z80 machine code in the 80's. But github is a apparently a challenge. Not aging well. 😂

oldrup avatar Apr 17 '24 19:04 oldrup

The now added change allows embed provider names with either -<locale> or -<number> and removes them where necessary.

MatzeKitt avatar Jul 13 '24 12:07 MatzeKitt