Skip to content

Commit

Permalink
schema modifications to simplify edition
Browse files Browse the repository at this point in the history
  • Loading branch information
ionlizarazu committed Mar 12, 2024
1 parent 658f949 commit 87e4820
Show file tree
Hide file tree
Showing 6 changed files with 315 additions and 176 deletions.
108 changes: 79 additions & 29 deletions 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-03-08T16:09:08.899Z\n"
"POT-Creation-Date: 2024-03-12T22:32:22.558Z\n"
"Last-Translator: Plone i18n <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"Content-Type: text/plain; charset=utf-8\n"
Expand All @@ -14,81 +14,131 @@ msgstr ""
"Domain: volto\n"

#. Default: "Above"
#: schema
#: messages
msgid "Above"
msgstr ""

#. Default: "Below"
#: schema
#: messages
msgid "Below"
msgstr ""

#. Default: "Character to use as decimal"
#: messages
msgid "Character to use as decimal"
msgstr ""

#. Default: "Character to use as thousands separator"
#: messages
msgid "Character to use as thousands separator"
msgstr ""

#. Default: "CountUp block configuration"
#: schema
#: messages
msgid "CountUp block configuration"
msgstr ""

#. Default: "Decimal character to use"
#: schema
msgid "Decimal character to use"
#. Default: "Decimal separator"
#: messages
msgid "Decimal separator"
msgstr ""

#. Default: "Delay, number of seconds to wait until the counter starts"
#: schema
msgid "Delay, number of seconds to wait until the counter starts"
#. Default: "Delay"
#: messages
msgid "Delay"
msgstr ""

#. Default: "Duration"
#: schema
#: messages
msgid "Duration"
msgstr ""

#. Default: "Duration of the count up"
#: schema
msgid "Duration of the count up"
#. Default: "Duration in seconds, by default, 2"
#: messages
msgid "Duration in seconds, by default, 2"
msgstr ""

#. Default: "End"
#: messages
msgid "End"
msgstr ""

#. Default: "End number"
#: schema
msgid "End number"
#. Default: "Final number for the countUp"
#: messages
msgid "Final number for the countUp"
msgstr ""

#. Default: "HTML tag that will be used to render the title"
#: schema
#: messages
msgid "HTML tag that will be used to render the title"
msgstr ""

#. Default: "Number of decimal characters"
#: schema
msgid "Number of decimal characters"
#. Default: "Number of decimals to render"
#: messages
msgid "Number of decimals to render"
msgstr ""

#. Default: "Nª of Decimals"
#: messages
msgid "Nª of Decimals"
msgstr ""

#. Default: "Position"
#: messages
msgid "Position"
msgstr ""

#. Default: "Position of the title tag"
#: schema
#: messages
msgid "Position of the title tag"
msgstr ""

#. Default: "Prefix"
#: messages
msgid "Prefix"
msgstr ""

#. Default: "Prefix that will be shown before the number"
#: schema
#: messages
msgid "Prefix that will be shown before the number"
msgstr ""

#. Default: "Start number"
#: schema
msgid "Start number"
#. Default: "Seconds to wait until the counter starts"
#: messages
msgid "Seconds to wait until the counter starts"
msgstr ""

#. Default: "Start"
#: messages
msgid "Start"
msgstr ""

#. Default: "Starting number for the countUp"
#: messages
msgid "Starting number for the countUp"
msgstr ""

#. Default: "Suffix"
#: messages
msgid "Suffix"
msgstr ""

#. Default: "Suffix that will be shown after the number"
#: schema
#: messages
msgid "Suffix that will be shown after the number"
msgstr ""

#. Default: "Thousands separator"
#: schema
#: messages
msgid "Thousands separator"
msgstr ""

#. Default: "Title HTML tag"
#: messages
msgid "Title HTML tag"
msgstr ""

#. Default: "Title of the counter"
#: schema
#: messages
msgid "Title of the counter"
msgstr ""
2 changes: 1 addition & 1 deletion src/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const CountUpBlockEdit = (props) => {

const intl = useIntl();

const schema = CountUpBlockSchema(intl);
const schema = CountUpBlockSchema(intl, data);

return (
<>
Expand Down
4 changes: 2 additions & 2 deletions src/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export const BlockViewComponent = ({ data }) => {
decimal,
decimals,
separator,
delay,
delay = 2,
} = data;

// Title config
const { title, titleTag, titlePosition } = data;
const { title, titleTag, titlePosition = 'above' } = data;
const TitleTag = titleTag || 'h2';

return (
Expand Down
111 changes: 111 additions & 0 deletions src/messages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import { defineMessages } from 'react-intl';

const messages = defineMessages({
countupblockconfig: {
id: 'CountUp block configuration',
defaultMessage: 'CountUp block configuration',
},
start: {
id: 'Start',
defaultMessage: 'Start',
},
startHelp: {
id: 'Starting number for the countUp',
defaultMessage: 'Starting number for the countUp',
},
end: {
id: 'End',
defaultMessage: 'End',
},
endHelp: {
id: 'Final number for the countUp',
defaultMessage: 'Final number for the countUp',
},
duration: {
id: 'Duration',
defaultMessage: 'Duration',
},
durationHelp: {
id: 'Duration in seconds, by default, 2',
defaultMessage: 'Duration in seconds, by default, 2',
},
prefix: {
id: 'Prefix',
defaultMessage: 'Prefix',
},
prefixHelp: {
id: 'Prefix that will be shown before the number',
defaultMessage: 'Prefix that will be shown before the number',
},
suffix: {
id: 'Suffix',
defaultMessage: 'Suffix',
},
suffixHelp: {
id: 'Suffix that will be shown after the number',
defaultMessage: 'Suffix that will be shown after the number',
},
decimal: {
id: 'Decimal separator',
defaultMessage: 'Decimal separator',
initialValue: ',',
},
decimalHelp: {
id: 'Character to use as decimal',
defaultMessage: 'Character to use as decimal',
},
decimals: {
id: 'Nª of Decimals',
defaultMessage: 'Nª of Decimals',
},
decimalsHelp: {
id: 'Number of decimals to render',
defaultMessage: 'Number of decimals to render',
},
separator: {
id: 'Thousands separator',
defaultMessage: 'Thousands separator',
initialValue: '.',
},
separatorHelp: {
id: 'Character to use as thousands separator',
defaultMessage: 'Character to use as thousands separator',
},
delay: {
id: 'Delay',
defaultMessage: 'Delay',
},
delayHelp: {
id: 'Seconds to wait until the counter starts',
defaultMessage: 'Seconds to wait until the counter starts',
},
title: {
id: 'Title of the counter',
defaultMessage: 'Title of the counter',
},
titleTags: {
id: 'Title HTML tag',
defaultMessage: 'Title HTML tag',
},
titleTagsHelp: {
id: 'HTML tag that will be used to render the title',
defaultMessage: 'HTML tag that will be used to render the title',
},
titlePosition: {
id: 'Position',
defaultMessage: 'Position',
},
titlePositionHelp: {
id: 'Position of the title tag',
defaultMessage: 'Position of the title tag',
},
above: {
id: 'Above',
defaultMessage: 'Above',
},
below: {
id: 'Below',
defaultMessage: 'Below',
},
});
export default messages;
Loading

0 comments on commit 87e4820

Please sign in to comment.