How to use WYSIHTML5 translation?

Asked

Viewed 335 times

0

The documentation says the following:

You can use Bootstrap-wysihtml5 in other Languages. There are some Translations available in the src/locales directory. You can include your desired one after the plugin and pass its key to the editor. Example:

$('#some-textarea').wysihtml5({locale: "pt-BR"});

But I’m still not able to summon her. What may be happening?

Libraries:

<link rel="stylesheet" href="public/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
<script src="public/plugins/bootstrap-wysihtml5/locales/bootstrap-wysihtml5.pt-BR.js"></script>
<script src="public/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>

Script:

$(function () {
  //bootstrap WYSIHTML5 - text editor
  $('.textarea').wysihtml5({
    locale: "pt-BR",
    toolbar:
    {
      "font-styles": true, // Font styling, e.g. h1, h2, etc.
      "emphasis": true, // Italics, bold, etc.
      "lists": true, // (Un)ordered lists, e.g. Bullets, Numbers.
      "html": false, // Button which allows you to edit the generated HTML.
      "link": false, // Button to insert a link.
      "image": false, // Button to insert an image.
      "color": false, // Button to change color of font
      "blockquote": true, // Blockquote,
      parser: function(html) {
          return html.text();
      }
    }
  });
});
  • shall be for the absence ); in the penultimate } ?

  • 1

    From what I understand you should carry /bootstrap-wysihtml5.pt-BR.js finally, that is, after bootstrap3-wysihtml5.all.min.js.

  • @André, there is more code below and forgot to close in the above section.

  • @Sam, wow. I’m sorry for the ignorance, but where does it say (and why) that it should be loaded after? But it worked.

  • 1

    You’re saying here: You can include your desired one after the plugin... after the plugin

  • @Sam, our had totally disregarded this section Stylesheets (but what formatting Trash).

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.