Skip to content

Commit

Permalink
updated locales to remove Table of Contents from HorizontalMenu and D…
Browse files Browse the repository at this point in the history
…efaultTocRender ToC templates

- Since the fallback would never resolve to true there is no point in referencing them
  instead we show Table of contents if there are no headings to show
  • Loading branch information
ichim-david committed Sep 26, 2024
1 parent a4a46b7 commit 4276b93
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 36 deletions.
3 changes: 1 addition & 2 deletions packages/volto/locales/ca/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3558,8 +3558,7 @@ msgid "Table"
msgstr "Taula"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "Taula de continguts"

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3557,8 +3557,7 @@ msgid "Table"
msgstr "Tabelle"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "Inhaltsverzeichnis"

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3552,8 +3552,7 @@ msgid "Table"
msgstr ""

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr ""

Expand Down
5 changes: 2 additions & 3 deletions packages/volto/locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3559,10 +3559,9 @@ msgid "Table"
msgstr "Tabla"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "Tabla de contenidos"
msgstr ""

#. Default: "Tabular view"
#: config/Views
Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/eu/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3559,8 +3559,7 @@ msgid "Table"
msgstr "Taula"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "Edukien taula"

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/fi/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3557,8 +3557,7 @@ msgid "Table"
msgstr "Taulukkoa"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "Sisällys"

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3559,8 +3559,7 @@ msgid "Table"
msgstr "Table"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "Table des matières"

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/hi/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3552,8 +3552,7 @@ msgid "Table"
msgstr "तालिका"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "सारांश की तालिका"

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3552,8 +3552,7 @@ msgid "Table"
msgstr "Tabella"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "Indice dei contenuti"

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/ja/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3557,8 +3557,7 @@ msgid "Table"
msgstr "テーブル"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "目次"

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/nl/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3556,8 +3556,7 @@ msgid "Table"
msgstr ""

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr ""

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/pt/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3557,8 +3557,7 @@ msgid "Table"
msgstr "Tabela"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr ""

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/pt_BR/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3558,8 +3558,7 @@ msgid "Table"
msgstr "Tabela"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "Tabela de conteúdos"

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/ro/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3552,8 +3552,7 @@ msgid "Table"
msgstr "Tabel"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "Cuprins"

Expand Down
5 changes: 2 additions & 3 deletions packages/volto/locales/volto.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: 2024-08-10T17:00:27.117Z\n"
"POT-Creation-Date: 2024-09-26T14:41:55.000Z\n"
"Last-Translator: Plone i18n <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"Content-Type: text/plain; charset=utf-8\n"
Expand Down Expand Up @@ -3554,8 +3554,7 @@ msgid "Table"
msgstr ""

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr ""

Expand Down
3 changes: 1 addition & 2 deletions packages/volto/locales/zh_CN/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3558,8 +3558,7 @@ msgid "Table"
msgstr "表格"

#. Default: "Table of Contents"
#: components/manage/Blocks/ToC/variations/DefaultTocRenderer
#: components/manage/Blocks/ToC/variations/HorizontalMenu
#: components/manage/Blocks/ToC/View
msgid "Table of Contents"
msgstr "表格内容"

Expand Down
4 changes: 2 additions & 2 deletions packages/volto/src/components/manage/Blocks/ToC/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*/
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl } from 'react-intl';
import cx from 'classnames';
import { Message } from 'semantic-ui-react';
import { messages } from '@plone/volto/components/manage/Blocks/ToC/Schema';
import { injectIntl } from 'react-intl';
import config from '@plone/volto/registry';
import { withBlockExtensions } from '@plone/volto/helpers';

Expand Down Expand Up @@ -171,7 +171,7 @@ const View = (props) => {
aria-label={title && !data.hide_title ? title : ''}
className={cx('table-of-contents', variation?.id)}
>
{props.mode === 'edit' && !data.title && !tocEntries.length && (
{props.mode === 'edit' && !title && !tocEntries.length && (
<Message>{props.intl.formatMessage(messages.toc)}</Message>
)}

Expand Down

0 comments on commit 4276b93

Please sign in to comment.