eckinox / tinymce-bundle

TinyMCE 6 integration for your Symfony apps and forms
MIT License
20 stars 2 forks source link

Setup lang ? #6

Closed xorgxx closed 6 months ago

xorgxx commented 1 year ago

Hi i'm trying to set fr lang.

           ->add('content', TinymceType::class, [
                "attr" => [
                    "selector" => 'post_content',
                    "language_url" => '/public/bundles/tinymce/ext/tinymce/langs/fr_FR.js', // path from the root of your web application — / — to the language pack(s)
                    "language" => 'fr_FR',
                    "skin" => "oxide",
                    "plugins" => 'code image link lists',
                    "toolbar" => 'undo redo | styles | bold italic underline forecolor backcolor | link image code | align | bullist numlist',
                    "menubar" => true
                ],
            ])

all render is there excepte lang still en_EN

thank to help

EmilePerron commented 1 year ago

Hey @xorgxx,

I see that you've added the FR language pack - that's good.

I think the issue here is that you're setting the language and language_url attributes on the TinyMCE web component itself. If you look at the TinyMCE web component documentation, you'll find that these options do not exist for the web component.

What you need to do in this case is look at the Setting additional configuration options part of the docs. It explains how to use the config  attribute to provide extra configs that aren't supported via attributes.

A more detailed example of a similar issue was provided here: https://github.com/eckinox/tinymce-bundle/issues/4#issuecomment-1405032707

Hope that helps!