ComUneInfo You'd most likely have to modify the MediaEmbed plugin... we don't code them, just enable them. You can probably edit the embeds, not sure how you'd make every site your locale though.

It seems that the plugin call an external link to generate the frame content:
https://s9e.github.io/iframe/2/facebook.min.html#{@type}{@id} (Git) then this page call the us version of Facebook components: //connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5

I found it in CachedDefinitionCollection.php:

'facebook'=>[
	'attributes'=>[],
	'example'=>[
		'https://www.facebook.com/FacebookDevelopers/posts/10151471074398553',
		'https://www.facebook.com/video/video.php?v=10150451523596807',
		'https://www.facebook.com/photo.php?fbid=10152476416772631',
		'https://www.facebook.com/ign/videos/10153762113196633/',
		'https://www.facebook.com/southamptonfc/videos/vb.220396037973624/1357764664236750/'
	],
	'extract'=>[
		'@/(?!(?:apps|developers|graph)\\.)[-\\w.]*facebook\\.com/(?:[/\\w]+/permalink|(?!pages/|groups/).*?)(?:/|fbid=|\\?v=)(?\'id\'\\d+)(?=$|[/?&#])@',
		'@facebook\\.com/(?\'user\'\\w+)/(?\'type\'post|video)s?/@',
		'@facebook\\.com/video/(?\'type\'post|video)\\.php@'
	],
	'homepage'=>'https://www.facebook.com/',
	'host'=>['facebook.com'],
	'iframe'=>[
		'data-s9e-livepreview-ignore-attrs'=>'style',
		'onload'=>'var c=new MessageChannel;c.port1.onmessage=function(e){{style.height=e.data+\'px\'}};contentWindow.postMessage(\'s9e:init\',\'https://s9e.github.io\',[c.port2])',
		'src'=>'https://s9e.github.io/iframe/2/facebook.min.html#{@type}{@id}'
	],
	'name'=>'Facebook',
	'scrape'=>[],
	'tags'=>['social']
],

The fact is that this page is common for all those who use the plugin, may be i can try to create my own iframe page and change link in CachedDefinitionCollection.php

The only evolution i can see is to deploy frame pages on the package instead of a public website, it will be more customizable but maybe it's like that for a specific reason i don't know.

    It works.
    I duplicate and hosted my own page with the URL locale modified for fr_FR.

    But it's not clean to modify plugin directly.
    At next update, shazam !

    I'm not developper, so i have questions:

    • How to make it adaptive ? A new option on the plugin ?
    • Value in db is stored in short format (fr), facebook must be called in full locale format (fr_FR), how to deal with that ?
    • Moving public pages as local pages with a generic way to define locale values on call ? Good solution ? Performance ?

    All this is just a reflexion not a request 🙂
    Did someone had the same need ?

      ComUneInfo You are the first person to have requested this, I doubt you are the only one that needs this though. Issue with this is that to make it extensible, the extension would extremely increase in complexity, so it is probably best that a different extension is made to extend MediaEmbed.

        ComUneInfo The code you have to modify is in a separate web page so whatever you do you'd have to host your own copy of the page to do it.

        ComUneInfo The only evolution i can see is to deploy frame pages on the package instead of a public website, it will be more customizable but maybe it's like that for a specific reason i don't know.

        As the author/maintainer of the library/pages involved I can give you the real reasons:

        1. It's infinitely easier both for me and for the library's consumers to have those pages hosted somewhere public rather than bundled with the library as some sort of HTML assets.
        2. Hosting the iframes on a different domain than the page that displays them makes them act as a sandbox. The third party JavaScript that gets embedded on the s9e.github.io domain cannot interact with your page.

        Anyway, I've just updated the Facebook iframe on GitHub to add some support for locales. If your browser announces that it prefers pages in French then the Facebook interface should appear in French. It should be noted that it may not work for all languages because there's a difference between the browser's configuration and the kind of value Facebook expects but it should work for most. Otherwise, it should default to en_US. For now I consider this feature experimental but if nobody reports any issues then it'll become permanent.

          JoshyPHP Thanks, i was sure there is reason for, your explaination is pretty clear.
          I also have to thanks you again for this update.

          I spend few minutes after reading your post to get back the s9e extension back to normal and test it (so excited).
          On my side and as expected it works for French language, hoping other languages to be tested with this result.

          This little update is a great thing to get flarum ans your plugin usable in most of languages and be more popular.

          Great job, thanks again for this !

          4 days later

          Hi,

          I installed it by unfortunatelly Youtube link videos are not embedded ?!

            ProgWeb Admin area > Extensions > FoF Formatting (hover) > Click three dots > Settings > Enable what you want (for YouTube and other sites MediaEmbed) > Save > Control Panel > Clear cache

              Thanks all !

              I tought it will detect automatically youtube links and then show the video, but finally I have to use MEDIA BBCODE in order to show the video.

              It will be nice if the detection is automatic.

              Thanks again

                ProgWeb Can you share settings modal's pic and today's log file. I'm not developer but maybe i can help.

                It's not a bug , it just that Youtube, vimeo links need to be inserted inside MEDIA tag in order to work.

                You can check with the developer 🙂

                Thank you for your help, really appreciated 🙂

                  ProgWeb You don't need any media tag. Just paste the URL. Here's example from my Flarum:

                  *P.S.: For this example, i only paste imgur url in text area.

                    it's not coverting pictures, do you guys know what is wrong with this one:
                    https://teknikforum.com/d/74919-taksimde-tinerciler-ituluyu-oldurdu (change the topic's picture link, now its taking it from local)

                    there should be a picture at the top of the post.

                    note: inspect shows me that not found this link:
                    https:// teknikforum.com/api/fof/secure-https/https%3A%2F%2Fimage.piri.net%2Fresim%2Fimagecrop%2F2019%2F09%2F08%2F10%2F29%2Fresized_1008f-0546c6d5halit.jpg

                      • [deleted]

                      • Edited

                      sanwhere I see a 404 error here. The underlying link appears to be

                      Note the % appendages which are usually because of spaces, or characters that have not translated properly. I think the link should be

                      https://teknikforum.com/api/fof/secure-https://image.piri.net/resim/imagecrop/resized_1008f-0546c6d5halit.jpg

                      But this spits out

                      {"errors":[{"status":"404","code":"route_not_found"}]}