From 4874dec44c7af1eb67a42341445c57c3660ff69a Mon Sep 17 00:00:00 2001 From: Giulia Ghisini Date: Tue, 26 Oct 2021 10:29:30 +0200 Subject: [PATCH] chore: updated to volto14 --- babel.config.js | 18 ++- locales/de/LC_MESSAGES/volto.po | 20 +++- locales/en/LC_MESSAGES/volto.po | 20 +++- locales/es/LC_MESSAGES/volto.po | 20 +++- locales/eu/LC_MESSAGES/volto.po | 20 +++- locales/fr/LC_MESSAGES/volto.po | 20 +++- locales/it/LC_MESSAGES/volto.po | 20 +++- locales/ja/LC_MESSAGES/volto.po | 20 +++- locales/nl/LC_MESSAGES/volto.po | 20 +++- locales/pt/LC_MESSAGES/volto.po | 20 +++- locales/pt_BR/LC_MESSAGES/volto.po | 20 +++- locales/ro/LC_MESSAGES/volto.po | 20 +++- locales/volto.pot | 26 ++-- package.json | 7 +- src/i18n.js | 183 ----------------------------- 15 files changed, 244 insertions(+), 210 deletions(-) delete mode 100644 src/i18n.js diff --git a/babel.config.js b/babel.config.js index a900a75..2f4e1e8 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1 +1,17 @@ -module.exports = require('@plone/volto/babel'); +module.exports = function (api) { + api.cache(true); + const presets = ['razzle/babel']; + 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/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index da32e00..5326e2e 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index 1f90733..a871103 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "Add menu path" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "Add menu item" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "Delete" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "Delete menu path" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "Delete menu item" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "Select a menu item" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "Select a menu path" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "In evidence" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "Link" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "Type an external url, or select an internal url clicking on the right button" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "Secondary menu" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "Selected menu'" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "Menu items" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "Move menu item down" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "Move menu item up" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "Root path" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "Title" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "Visible" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index da32e00..5326e2e 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "" diff --git a/locales/eu/LC_MESSAGES/volto.po b/locales/eu/LC_MESSAGES/volto.po index da32e00..5326e2e 100644 --- a/locales/eu/LC_MESSAGES/volto.po +++ b/locales/eu/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index da32e00..5326e2e 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index 3dd2963..1037b95 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "Aggiungi radice di navigazione" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "Aggiungi un elemento del menu" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "Elimina il menu" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "Elimina" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "Elimina la voce di menu" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "Seleziona una voce di menu" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "Seleziona una radice di navigazione" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "In evidenza" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "Link" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "Scrivi un url esterno o seleziona un URL interno cliccando sul bottone a destra" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "Menu secondario" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "Menu selezionato" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "Voci del menu" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "Sposta dopo" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "Sposta prima" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "Radice del menu" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "Titolo" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "Visibile" diff --git a/locales/ja/LC_MESSAGES/volto.po b/locales/ja/LC_MESSAGES/volto.po index da32e00..5326e2e 100644 --- a/locales/ja/LC_MESSAGES/volto.po +++ b/locales/ja/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "" diff --git a/locales/nl/LC_MESSAGES/volto.po b/locales/nl/LC_MESSAGES/volto.po index da32e00..5326e2e 100644 --- a/locales/nl/LC_MESSAGES/volto.po +++ b/locales/nl/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "" diff --git a/locales/pt/LC_MESSAGES/volto.po b/locales/pt/LC_MESSAGES/volto.po index da32e00..5326e2e 100644 --- a/locales/pt/LC_MESSAGES/volto.po +++ b/locales/pt/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "" diff --git a/locales/pt_BR/LC_MESSAGES/volto.po b/locales/pt_BR/LC_MESSAGES/volto.po index da32e00..5326e2e 100644 --- a/locales/pt_BR/LC_MESSAGES/volto.po +++ b/locales/pt_BR/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "" diff --git a/locales/ro/LC_MESSAGES/volto.po b/locales/ro/LC_MESSAGES/volto.po index da32e00..5326e2e 100644 --- a/locales/ro/LC_MESSAGES/volto.po +++ b/locales/ro/LC_MESSAGES/volto.po @@ -11,74 +11,92 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - #: widget/SecondaryMenuConfigurationWidget +#: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu path msgid "secondarymenu-add-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Add menu item msgid "secondarymenu-addmenuitem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete msgid "secondarymenu-delete-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Delete menu path msgid "secondarymenu-delete-menupath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Delete menu item msgid "secondarymenu-deletemenuitem-button" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu item msgid "secondarymenu-emptyActiveMenuItem" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Select a menu path msgid "secondarymenu-emptyActiveMenuPath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: In evidence msgid "secondarymenu-inevidence" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Link msgid "secondarymenu-linkUrl" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Type an external url, or select an internal url clicking on the right button msgid "secondarymenu-linkUrl_description" msgstr "" #: components/SecondaryMenu +# defaultMessage: Secondary menu msgid "secondarymenu-menu-arialabel" msgstr "" #: components/SecondaryMenu +# defaultMessage: Selected menu msgid "secondarymenu-menu-selected" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Menu items msgid "secondarymenu-menuitems-header" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item down msgid "secondarymenu-move-menuitem-down" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Move menu item up msgid "secondarymenu-move-menuitem-up" msgstr "" #: widget/SecondaryMenuConfigurationWidget +# defaultMessage: Root path msgid "secondarymenu-rootpath" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Title msgid "secondarymenu-title" msgstr "" #: widget/SecondaryMenuConfigurationForm +# defaultMessage: Visible msgid "secondarymenu-visible" msgstr "" diff --git a/locales/volto.pot b/locales/volto.pot index 78f2514..bf12069 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,17 +1,17 @@ msgid "" - msgstr "" - "Project-Id-Version: Plone\n" - "POT-Creation-Date: 2021-03-31T10:34:36.883Z\n" - "Last-Translator: Plone i18n \n" - "Language-Team: Plone i18n \n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=utf-8\n" - "Content-Transfer-Encoding: 8bit\n" - "Plural-Forms: nplurals=1; plural=0;\n" - "Language-Code: en\n" - "Language-Name: English\n" - "Preferred-Encodings: utf-8\n" - "Domain: volto\n" +msgstr "" +"Project-Id-Version: Plone\n" +"POT-Creation-Date: 2021-10-26T08:29:03.310Z\n" +"Last-Translator: Plone i18n \n" +"Language-Team: Plone i18n \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8\n" +"Domain: volto\n" #: widget/SecondaryMenuConfigurationWidget # defaultMessage: Add menu path diff --git a/package.json b/package.json index 2d7f559..4496e25 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,14 @@ "devDependencies": { "release-it": "*" }, + "dependencies": { + "@plone/scripts": "*" + }, "peerDependencies": { - "@plone/volto": ">=12.0.0" + "@plone/volto": ">=14.0.0" }, "scripts": { - "i18n": "NODE_ENV=production node src/i18n.js", + "i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon", "release": "release-it" } } diff --git a/src/i18n.js b/src/i18n.js deleted file mode 100644 index c1f0f63..0000000 --- a/src/i18n.js +++ /dev/null @@ -1,183 +0,0 @@ -/* eslint no-console: 0 */ -/** - * i18n script. - * @module scripts/i18n - */ - -const { find, keys, map, concat, reduce } = require('lodash'); -const glob = require('glob').sync; -const fs = require('fs'); -const Pofile = require('pofile'); -const babel = require('@babel/core'); - -/** - * Extract messages into separate JSON files - * @function extractMessages - * @return {undefined} - */ -function extractMessages() { - map(glob('src/**/*.js?(x)'), (filename) => { - babel.transformFileSync(filename, {}, (err) => { - if (err) { - console.log(err); - } - }); - }); -} - -/** - * Get messages from separate JSON files - * @function getMessages - * @return {Object} Object with messages - */ -function getMessages() { - return reduce( - concat( - {}, - ...map( - // We ignore the existing customized shadowed components ones, since most - // probably we won't be overriding them - // If so, we should do it in the config object or somewhere else - glob( - 'build/messages/src/**/*.json', - // , { - // ignore: 'build/messages/src/customizations/**', - // } - ), - (filename) => - map(JSON.parse(fs.readFileSync(filename, 'utf8')), (message) => ({ - ...message, - filename: filename.match(/build\/messages\/src\/(.*).json$/)[1], - })), - ), - ), - (current, value) => { - let result = current; - if (current.id) { - result = { - [current.id]: { - defaultMessage: current.defaultMessage, - filenames: [current.filename], - }, - }; - } - - if (result[value.id]) { - result[value.id].filenames.push(value.filename); - } else { - result[value.id] = { - defaultMessage: value.defaultMessage, - filenames: [value.filename], - }; - } - return result; - }, - ); -} - -/** - * Convert messages to pot format - * @function messagesToPot - * @param {Object} messages Messages - * @return {string} Formatted pot string - */ -function messagesToPot(messages) { - return map(keys(messages).sort(), (key) => - [ - ...map(messages[key].filenames, (filename) => `#: ${filename}`), - `# defaultMessage: ${messages[key].defaultMessage}`, - `msgid "${key}"`, - 'msgstr ""', - ].join('\n'), - ).join('\n\n'); -} - -/** - * Pot header - * @function potHeader - * @return {string} Formatted pot header - */ -function potHeader() { - return `msgid "" - msgstr "" - "Project-Id-Version: Plone\\n" - "POT-Creation-Date: ${new Date().toISOString()}\\n" - "Last-Translator: Plone i18n \\n" - "Language-Team: Plone i18n \\n" - "MIME-Version: 1.0\\n" - "Content-Type: text/plain; charset=utf-8\\n" - "Content-Transfer-Encoding: 8bit\\n" - "Plural-Forms: nplurals=1; plural=0;\\n" - "Language-Code: en\\n" - "Language-Name: English\\n" - "Preferred-Encodings: utf-8\\n" - "Domain: volto\\n" - -`; -} - -/** - * Format header - * @function formatHeader - * @param {Array} comments Array of comments - * @param {Object} headers Object of header items - * @return {string} Formatted header - */ -function formatHeader(comments, headers) { - return [ - ...map(comments, (comment) => `# ${comment}`), - 'msgid ""', - 'msgstr ""', - ...map(keys(headers), (key) => `"${key}: ${headers[key]}\\n"`), - '', - ].join('\n'); -} - -/** - * Sync po by the pot file - * @function syncPoByPot - * @return {undefined} - */ -function syncPoByPot() { - const pot = Pofile.parse(fs.readFileSync('locales/volto.pot', 'utf8')); - - map(glob('locales/**/*.po'), (filename) => { - const po = Pofile.parse(fs.readFileSync(filename, 'utf8')); - - fs.writeFileSync( - filename, - `${formatHeader(po.comments, po.headers)} - ${map(pot.items, (item) => { - const poItem = find(po.items, { msgid: item.msgid }); - return [ - `${map(item.references, (ref) => `#: ${ref}`).join('\n')}`, - `msgid "${item.msgid}"`, - `msgstr "${poItem ? poItem.msgstr : ''}"`, - ].join('\n'); - }).join('\n\n')}\n`, - ); - }); -} - -// Main tasks -console.log('Extracting messages from source files...'); -extractMessages(); -console.log('Synchronizing messages to pot file...'); -// We only write the pot file if it's really different -const newPot = `${potHeader()}${messagesToPot(getMessages())}\n`.replace( - /"POT-Creation-Date:(.*)\\n"/, - '', -); -const oldPot = fs - .readFileSync('locales/volto.pot', 'utf8') - .replace(/"POT-Creation-Date:(.*)\\n"/, ''); - -if (newPot !== oldPot) { - fs.writeFileSync( - 'locales/volto.pot', - `${potHeader()}${messagesToPot(getMessages())}\n`, - ); -} -console.log('Synchronizing messages to po files...'); -syncPoByPot(); -console.log('done!');