Skip to content

Commit

Permalink
feat: Added i18n support - @macagua
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Sep 28, 2023
1 parent c927187 commit 06975c2
Show file tree
Hide file tree
Showing 18 changed files with 1,611 additions and 110 deletions.
13 changes: 6 additions & 7 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

1. Go to http://localhost:3000

1. Happy hacking!
1. Initialize git hooks

```Bash
cd src/addons/volto-statistic-block/
yarn prepare
```

1. Happy hacking!

### Or add @eeacms/volto-statistic-block to your Volto project

Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
Expand All @@ -48,18 +50,15 @@ Before starting make sure your development environment is properly set. See [Vol

1. Install

yarn develop
make develop
yarn

1. Start backend

docker pull plone
docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend

...wait for backend to setup and start - `Ready to handle requests`:

docker logs -f plone

...you can also check http://localhost:8080/Plone

1. Start frontend
Expand Down
58 changes: 29 additions & 29 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -215,36 +215,36 @@ pipeline {
}
}

stage('SonarQube compare to master') {
when {
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
}
allOf {
environment name: 'CHANGE_ID', value: ''
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
}
}
}
steps {
node(label: 'docker') {
script {
sh '''docker pull eeacms/gitflow'''
sh '''echo "Error" > checkresult.txt'''
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh '''set -o pipefail; docker run -i --rm --name="$BUILD_TAG-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt'''
}
// stage('SonarQube compare to master') {
// when {
// anyOf {
// allOf {
// not { environment name: 'CHANGE_ID', value: '' }
// environment name: 'CHANGE_TARGET', value: 'develop'
// }
// allOf {
// environment name: 'CHANGE_ID', value: ''
// branch 'develop'
// not { changelog '.*^Automated release [0-9\\.]+$' }
// }
// }
// }
// steps {
// node(label: 'docker') {
// script {
// sh '''docker pull eeacms/gitflow'''
// sh '''echo "Error" > checkresult.txt'''
// catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
// sh '''set -o pipefail; docker run -i --rm --name="$BUILD_TAG-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt'''
// }

publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: "Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed",
text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
detailsURL: "${env.BUILD_URL}display/redirect"
}
}
}
}
// publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: "Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed",
// text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
// detailsURL: "${env.BUILD_URL}display/redirect"
// }
// }
// }
// }

stage('Pull Request') {
when {
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@
[![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-statistic-block-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-statistic-block-develop)
[![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-statistic-block-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-statistic-block-develop)

[Volto](https://github.com/plone/volto) add-on
[Volto](https://github.com/plone/volto) add-on that provides the React Semantic UI [Statistic](https://react.semantic-ui.com/views/statistic) component as a [Block](https://6.docs.plone.org/volto/blocks/)

## Features

https://eea.github.io/volto-kitkat-frontend/?path=/story/components-statistic--default
See [Statistic Component Storybook](https://eea.github.io/eea-storybook/?path=/story/components-statistic--default).

![Statistic Block](https://github.com/raw/eea/volto-statistic-block/master/docs/volto-statistic-block.gif)
### Demo (Volto Theme)


![Statistic Block](https://github.com/raw/eea/volto-statistic-block/master/docs/docs/volto-statistic-block.gif)

### Demo (EEA Theme)

![Statistic Block](https://github.com/raw/eea/volto-statistic-block/master/docs/eea-statistic-block.gif)

## Getting started

Expand Down Expand Up @@ -51,7 +58,7 @@ Go to http://localhost:3000
],

"dependencies": {
"@eeacms/volto-statistic-block": "^1.0.0"
"@eeacms/volto-statistic-block": "*"
}
```

Expand Down
18 changes: 15 additions & 3 deletions cypress/e2e/02-dexterity-controlpanel-layout.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,33 @@ describe('ControlPanel: Dexterity Content-Types Layout', () => {
cy.get('.field-wrapper-label-1-items-2 .slate-editor div[role="textbox"]').click().type('Third Label{enter}');
cy.get('.field-wrapper-info-2-items-2 .slate-editor div[role="textbox"]').click().type('Third Extra Info{enter}');

// Three columns
cy.get('#field-widths').click().type('Three{enter}');

// Enable Animation
cy.get('label[for="field-enabled-0-animation"]').click();

// Animation Duration
cy.get('#field-duration-1-animation').click().type('5{enter}');

// Prefix
cy.get('#field-prefix-3-animation').click().type('x {enter}');

// Suffix
cy.get('#field-suffix-4-animation').click().type(' y{enter}');

cy.get('#toolbar-save').click();
cy.get('.documentFirstHeading').contains('My First Book');

// Check first item
cy.get('.statistic:nth-child(1) .value').contains('5');
cy.get('.statistic:nth-child(1) .label').contains('First Label');
cy.get('.statistic:nth-child(1) .text-center').contains('First Extra Info');

// Check second item
cy.get('.statistic:nth-child(2) .value').contains('10');
cy.get('.statistic:nth-child(2) .label').contains('Second Label');
cy.get('.statistic:nth-child(2) .text-center').contains('Second Extra Info');

// Check third item
cy.get('.statistic:nth-child(3) .value').contains('15');
cy.get('.statistic:nth-child(3) .label').contains('Third Label');
cy.get('.statistic:nth-child(3) .text-center').contains('Third Extra Info');
});
Expand Down
Binary file added docs/eea-statistic-block.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/volto-statistic-block.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
210 changes: 210 additions & 0 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,214 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: StatisticBlock/View
# defaultMessage: Add statistic items
msgid "Add statistic items"
msgstr ""

#: StatisticBlock/stylesSchema
# defaultMessage: Align
msgid "Align"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Animation
msgid "Animation"
msgstr ""

#: StatisticBlock/stylesSchema
# defaultMessage: Background when inverted
msgid "Background when inverted"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Can be formatted to fit on a dark background.
msgid "Can be formatted to fit on a dark background."
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Can present its measurement horizontally
msgid "Can present its measurement horizontally"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Columns
msgid "Columns"
msgstr ""

#: StatisticBlock/animationSchema
# defaultMessage: Decimals
msgid "Decimals"
msgstr ""

#: StatisticBlock/animationSchema
#: StatisticBlock/schema
#: StatisticBlock/stylesSchema
# defaultMessage: Default
msgid "Default"
msgstr ""

#: StatisticBlock/animationSchema
# defaultMessage: Duration (seconds)
msgid "Duration (seconds)"
msgstr ""

#: StatisticBlock/animationSchema
# defaultMessage: Enable animation
msgid "Enable animation"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Extra info
msgid "Extra info"
msgstr ""

#: StatisticBlock/stylesSchema
# defaultMessage: Extra info variation
msgid "Extra info variation"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Four
msgid "Four"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Horizontal
msgid "Horizontal"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Huge
msgid "Huge"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Inverted
msgid "Inverted"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Label
msgid "Label"
msgstr ""

#: StatisticBlock/stylesSchema
# defaultMessage: Label variation
msgid "Label variation"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Large
msgid "Large"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Link
msgid "Link"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Mini
msgid "Mini"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: One
msgid "One"
msgstr ""

#: StatisticBlock/animationSchema
# defaultMessage: Prefix
msgid "Prefix"
msgstr ""

#: StatisticBlock/stylesSchema
# defaultMessage: Primary
msgid "Primary"
msgstr ""

#: StatisticBlock/stylesSchema
# defaultMessage: Secondary
msgid "Secondary"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Size
msgid "Size"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Small
msgid "Small"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Statistic
msgid "Statistic"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Statistic block
msgid "Statistic block"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Statistic item
msgid "Statistic item"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Statistic items
msgid "Statistic items"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Styles
msgid "Styles"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Styling
msgid "Styling"
msgstr ""

#: StatisticBlock/animationSchema
# defaultMessage: Suffix
msgid "Suffix"
msgstr ""

#: StatisticBlock/stylesSchema
# defaultMessage: Tertiary
msgid "Tertiary"
msgstr ""

#: StatisticBlock/stylesSchema
# defaultMessage: Text align
msgid "Text align"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Three
msgid "Three"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Tiny
msgid "Tiny"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Two
msgid "Two"
msgstr ""

#: StatisticBlock/schema
# defaultMessage: Value
msgid "Value"
msgstr ""

#: StatisticBlock/stylesSchema
# defaultMessage: Value variation
msgid "Value variation"
msgstr ""
Loading

0 comments on commit 06975c2

Please sign in to comment.