diff --git a/Makefile b/Makefile index fb30954..a553dce 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ RESET=`tput sgr0` YELLOW=`tput setaf 3` PLONE_VERSION=6 -VOLTO_VERSION=17.6.0 +VOLTO_VERSION=17.7.0 ADDON_NAME='@kitconcept/volto-slider-block' ADDON_PATH='volto-slider-block' @@ -56,6 +56,8 @@ build-live: ## Build Addon live .PHONY: build-addon build-addon: ## Build Addon dev + @echo "$(GREEN)==> Removing node_modules $(RESET)" + rm -rf node_modules @echo "$(GREEN)==> Build Addon development container $(RESET)" ${DEV_COMPOSE} build addon-dev diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..51bd52b --- /dev/null +++ b/babel.config.js @@ -0,0 +1,17 @@ +module.exports = function (api) { + api.cache(true); + const presets = ['razzle']; + const plugins = [ + [ + 'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work + { + messagesDir: './build/messages/', + }, + ], + ]; + + return { + plugins, + presets, + }; +}; diff --git a/locales/ca/LC_MESSAGES/volto.po b/locales/ca/LC_MESSAGES/volto.po new file mode 100644 index 0000000..d390ded --- /dev/null +++ b/locales/ca/LC_MESSAGES/volto.po @@ -0,0 +1,95 @@ +# Víctor Fernández de Alba , 2023 +msgid "" +msgstr "" +"Project-Id-Version: Plone\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: YEAR-MO-DA HO:MI +ZONE\n" +"PO-Revision-Date: 2019-07-02 00:11+0200\n" +"Last-Translator: Víctor Fernández de Alba \n" +"Language: \n" +"Language-Team: Català \n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Language-Code: ca\n" +"Language-Name: Catalan\n" +"Preferred-Encodings: utf-8\n" +"Domain: plone\n" +"X-Is-Fallback-For: ca-ad ca-es ca-fr ca-it\n" + +#: components/schema +# defaultMessage: Add item +msgid "Add item" +msgstr "Afegir element" + +#: components/schema +# defaultMessage: Description +msgid "Description" +msgstr "Descripció" + +#: components/DotsAndArrows +# defaultMessage: Go to slide +msgid "Go to slide" +msgstr "Vés a slide" + +#: components/schema +# defaultMessage: Headtitle +msgid "Headtitle" +msgstr "Títol de capçalera" + +#: components/schema +# defaultMessage: Image override +msgid "Image override" +msgstr "Imatge" + +#: components/schema +# defaultMessage: Item +msgid "Item" +msgstr "Element" + +#: components/schema +# defaultMessage: Items +msgid "Items" +msgstr "Elements" + +#: components/DotsAndArrows +# defaultMessage: Next slide +msgid "Next slide" +msgstr "Següent slide" + +#: components/DefaultBody +#: components/View +# defaultMessage: Please choose an existing content as source for this element +msgid "Please choose an existing content as source for this element" +msgstr "Si us plau, escolleixi un contingut existent per aquest element" + +#: components/DotsAndArrows +# defaultMessage: Previous slide +msgid "Previous slide" +msgstr "Anterior slide" + +#: components/DefaultBody +# defaultMessage: Select target +msgid "Select target" +msgstr "Selecciona un contingut" + +#: components/schema +# defaultMessage: Slider +msgid "Slider" +msgstr "Slider" + +#: components/schema +# defaultMessage: Target +msgid "Target" +msgstr "" + +#: components/schema +# defaultMessage: Title +msgid "Title" +msgstr "Títol" + +#: components/DefaultBody +# defaultMessage: More info +msgid "moreInfo" +msgstr "Més informació" diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index 7327720..3263fd0 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -26,6 +26,11 @@ msgstr "Element hinzufügen" msgid "Description" msgstr "Beschreibung" +#: components/DotsAndArrows +# defaultMessage: Go to slide +msgid "Go to slide" +msgstr "Gehe zu Slide" + #: components/schema # defaultMessage: Headtitle msgid "Headtitle" @@ -46,22 +51,36 @@ msgstr "Element" msgid "Items" msgstr "Elemente" +#: components/DotsAndArrows +# defaultMessage: Next slide +msgid "Next slide" +msgstr "Nächster Slide" + #: components/DefaultBody #: components/View # defaultMessage: Please choose an existing content as source for this element msgid "Please choose an existing content as source for this element" msgstr "Bitte wählen sie einen existierenden Inhalt als Quelle für dieses Element aus" +#: components/DotsAndArrows +# defaultMessage: Previous slide +msgid "Previous slide" +msgstr "Vorheriger Slide" + +#: components/DefaultBody +# defaultMessage: Select target +msgid "Select target" +msgstr "Ziel" + #: components/schema # defaultMessage: Slider msgid "Slider" msgstr "Slider" -#: components/DefaultBody #: components/schema -# defaultMessage: Source -msgid "Source" -msgstr "Quelle" +# defaultMessage: Target +msgid "Target" +msgstr "Ziel" #: components/schema # defaultMessage: Title diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index e30d629..949a6f5 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -21,6 +21,11 @@ msgstr "" msgid "Description" msgstr "" +#: components/DotsAndArrows +# defaultMessage: Go to slide +msgid "Go to slide" +msgstr "" + #: components/schema # defaultMessage: Headtitle msgid "Headtitle" @@ -41,21 +46,35 @@ msgstr "" msgid "Items" msgstr "" +#: components/DotsAndArrows +# defaultMessage: Next slide +msgid "Next slide" +msgstr "" + #: components/DefaultBody #: components/View # defaultMessage: Please choose an existing content as source for this element msgid "Please choose an existing content as source for this element" msgstr "" +#: components/DotsAndArrows +# defaultMessage: Previous slide +msgid "Previous slide" +msgstr "" + +#: components/DefaultBody +# defaultMessage: Select target +msgid "Select target" +msgstr "" + #: components/schema # defaultMessage: Slider msgid "Slider" msgstr "" -#: components/DefaultBody #: components/schema -# defaultMessage: Source -msgid "Source" +# defaultMessage: Target +msgid "Target" msgstr "" #: components/schema diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index b948842..7e6c41b 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -30,6 +30,11 @@ msgstr "Añadir elemento" msgid "Description" msgstr "Descripción" +#: components/DotsAndArrows +# defaultMessage: Go to slide +msgid "Go to slide" +msgstr "Ver slide" + #: components/schema # defaultMessage: Headtitle msgid "Headtitle" @@ -50,22 +55,36 @@ msgstr "Elemento" msgid "Items" msgstr "Elementos" +#: components/DotsAndArrows +# defaultMessage: Next slide +msgid "Next slide" +msgstr "Siguiente slide" + #: components/DefaultBody #: components/View # defaultMessage: Please choose an existing content as source for this element msgid "Please choose an existing content as source for this element" msgstr "Elija un contenido existente como fuente para este elemento" +#: components/DotsAndArrows +# defaultMessage: Previous slide +msgid "Previous slide" +msgstr "Anterior slide" + +#: components/DefaultBody +# defaultMessage: Select target +msgid "Select target" +msgstr "" + #: components/schema # defaultMessage: Slider msgid "Slider" msgstr "Slider" -#: components/DefaultBody #: components/schema -# defaultMessage: Source -msgid "Source" -msgstr "Fuente" +# defaultMessage: Target +msgid "Target" +msgstr "" #: components/schema # defaultMessage: Title diff --git a/locales/nl/LC_MESSAGES/volto.po b/locales/nl/LC_MESSAGES/volto.po index 315d0c6..3accb0d 100644 --- a/locales/nl/LC_MESSAGES/volto.po +++ b/locales/nl/LC_MESSAGES/volto.po @@ -25,6 +25,11 @@ msgstr "Item toevoegen" msgid "Description" msgstr "Omschrijving" +#: components/DotsAndArrows +# defaultMessage: Go to slide +msgid "Go to slide" +msgstr "" + #: components/schema # defaultMessage: Headtitle msgid "Headtitle" @@ -45,22 +50,36 @@ msgstr "Item" msgid "Items" msgstr "Items" +#: components/DotsAndArrows +# defaultMessage: Next slide +msgid "Next slide" +msgstr "" + #: components/DefaultBody #: components/View # defaultMessage: Please choose an existing content as source for this element msgid "Please choose an existing content as source for this element" msgstr "Kies een bestaand item als bron voor dit element" +#: components/DotsAndArrows +# defaultMessage: Previous slide +msgid "Previous slide" +msgstr "" + +#: components/DefaultBody +# defaultMessage: Select target +msgid "Select target" +msgstr "" + #: components/schema # defaultMessage: Slider msgid "Slider" msgstr "Slider" -#: components/DefaultBody #: components/schema -# defaultMessage: Source -msgid "Source" -msgstr "Bron" +# defaultMessage: Target +msgid "Target" +msgstr "" #: components/schema # defaultMessage: Title diff --git a/locales/volto.pot b/locales/volto.pot index 5b9a59e..67ee092 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2022-11-24T15:56:27.444Z\n" +"POT-Creation-Date: 2023-12-14T11:35:27.943Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -23,6 +23,11 @@ msgstr "" msgid "Description" msgstr "" +#: components/DotsAndArrows +# defaultMessage: Go to slide +msgid "Go to slide" +msgstr "" + #: components/schema # defaultMessage: Headtitle msgid "Headtitle" @@ -43,21 +48,35 @@ msgstr "" msgid "Items" msgstr "" +#: components/DotsAndArrows +# defaultMessage: Next slide +msgid "Next slide" +msgstr "" + #: components/DefaultBody #: components/View # defaultMessage: Please choose an existing content as source for this element msgid "Please choose an existing content as source for this element" msgstr "" +#: components/DotsAndArrows +# defaultMessage: Previous slide +msgid "Previous slide" +msgstr "" + +#: components/DefaultBody +# defaultMessage: Select target +msgid "Select target" +msgstr "" + #: components/schema # defaultMessage: Slider msgid "Slider" msgstr "" -#: components/DefaultBody #: components/schema -# defaultMessage: Source -msgid "Source" +# defaultMessage: Target +msgid "Target" msgstr "" #: components/schema diff --git a/news/39.bugfix b/news/39.bugfix new file mode 100644 index 0000000..4feef22 --- /dev/null +++ b/news/39.bugfix @@ -0,0 +1 @@ +Fix a11y issues @sneridagh diff --git a/src/components/DefaultBody.jsx b/src/components/DefaultBody.jsx index 76a3c92..96f47f7 100644 --- a/src/components/DefaultBody.jsx +++ b/src/components/DefaultBody.jsx @@ -18,9 +18,9 @@ const messages = defineMessages({ id: 'moreInfo', defaultMessage: 'More info', }, - source: { - id: 'Source', - defaultMessage: 'Source', + selectTarget: { + id: 'Select target', + defaultMessage: 'Select target', }, }); @@ -83,7 +83,7 @@ const SliderBody = ({ e.target.blur()} /> diff --git a/src/components/DotsAndArrows.jsx b/src/components/DotsAndArrows.jsx index 581f4d0..39bf140 100644 --- a/src/components/DotsAndArrows.jsx +++ b/src/components/DotsAndArrows.jsx @@ -1,15 +1,32 @@ import { Icon } from '@plone/volto/components'; +import { useIntl, defineMessages } from 'react-intl'; import rightArrowSVG from '@plone/volto/icons/right-key.svg'; import leftArrowSVG from '@plone/volto/icons/left-key.svg'; +const messages = defineMessages({ + previousButton: { + id: 'Previous slide', + defaultMessage: 'Previous slide', + }, + nextButton: { + id: 'Next slide', + defaultMessage: 'Next slide', + }, + goToSlide: { + id: 'Go to slide', + defaultMessage: 'Go to slide', + }, +}); + export const DotButton = (props) => { const { children, index, ...restProps } = props; + const intl = useIntl(); return ( @@ -18,12 +35,13 @@ export const DotButton = (props) => { export const PrevButton = (props) => { const { children, ...restProps } = props; + const intl = useIntl(); return (