Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customizable labels for blockTypes #215

Closed

Conversation

Amitom
Copy link
Contributor

@Amitom Amitom commented Feb 13, 2017

Hi Jyoti,

I will try, step by step, to add "translations" capabilities in the components. First : blockType displayNames :)

@Amitom Amitom closed this Feb 17, 2017
@space11
Copy link

space11 commented Mar 26, 2019

@Amitom Hi, Im struggling when try to use custom labels for blockTypes. Is there any manual on that feature ?
Thanks.

@space11
Copy link

space11 commented Mar 26, 2019

I tried to use displayNames property but with no joy.

const documentEditorToolBarOptions = {
  options: [
    'inline',
    'blockType',
    'list',
    'colorPicker',
    'link',
    'image',
  ],
  blockType: {
    inDropdown: true,
    options: [
      'Normal',
      'H1',
      'H2',
      'H3',
      'H4',
      'H5',
      'H6',
      'Blockquote',
    ],
    displayNames: [
      { label: 'Normal', displayName: 'Normal', style: 'unstyled' },
      { label: 'H1', displayName: 'Heading 1', style: 'header-one' },
      { label: 'H2', displayName: 'Heading 2', style: 'header-two' },
      { label: 'H3', displayName: 'Heading 3', style: 'header-three' },
      { label: 'H4', displayName: 'Heading 4', style: 'header-four' },
      { label: 'H5', displayName: 'Heading 5', style: 'header-five' },
      { label: 'H6', displayName: 'Heading 6', style: 'header-six' },
      { label: 'Blockquote', displayName: 'Blockquote', style: 'blockquote' },
    ],
    className: undefined,
    component: undefined,
    dropdownClassName: undefined,
  },
};
 

@Amitom
Copy link
Contributor Author

Amitom commented Mar 26, 2019

Hi @space11 , this feature disappeared with translations support, search for "translation" in this page to know how to change locale.

@space11
Copy link

space11 commented Mar 29, 2019

@Amitom Thanks man.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants