Search code examples
javascriptreactjsgrapesjs

Can I change toolbar language in grapesjs?


I use grapejs, and I need to change the text language. There is 'i81n' for labels, but I couldn't find anything for inputs like this as you can see i change the label language with i18n but selectbox's options are still english Also if it's possible, As you can see in the pic I need to change the placeholder for text input and the title 'text' above it


Solution

  • I Found how to change inputs. You have to change your props one by one. You can find the details in https://github.com/artf/grapesjs/issues/2712#issuecomment-615763048

    And for the second issue you have to add your i18n file domComponents. in my scenario it's like this

    var _default = {domComponents: {
    names: {
      '': 'Kutu',
      wrapper: 'Gövde',
      text: 'Metin',
      comment: 'Yorum',
      image: 'Görsel',
      video: 'Video',
      label: 'Etiket',
      link: 'Link',
      map: 'Harita',
      tfoot: 'Tablo alt',
      tbody: 'Tablo gövde',
      thead: 'Tablo başlık',
      table: 'Tablo',
      row: 'Satır',
      cell: 'Hücre'
    }...}..}
    

    Document for this is here : https://grapesjs.com/docs/modules/I18n.html#plugin-development