embed-privacy
embed-privacy copied to clipboard
Add thumbnail support for Polylang
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:
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).
How do you guys handle embeds in different languages, and the logos?
What am I missing?
Steps to reproduce
- Install Embed Privacy 1.9.0
- Install Polylang
- Add a language
- Add a copy of an Embed to the new language
- 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
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.
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.
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.
I will if you let it open. 😂
I coded Z80 machine code in the 80's. But github is a apparently a challenge. Not aging well. 😂
The now added change allows embed provider names with either -<locale> or -<number> and removes them where necessary.