Skip to content

Commit

Permalink
Merge branch 'main' into revert-towncrier-name
Browse files Browse the repository at this point in the history
  • Loading branch information
stevepiercy committed Aug 23, 2024
2 parents 0dee17b + 913670f commit af76a62
Show file tree
Hide file tree
Showing 94 changed files with 2,856 additions and 3,308 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -85,13 +85,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -133,13 +133,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -181,13 +181,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -229,13 +229,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -277,13 +277,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -324,13 +324,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -372,13 +372,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -420,13 +420,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -469,13 +469,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -571,14 +571,14 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots

# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down Expand Up @@ -627,13 +627,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000 http://localhost'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos-seamless
Expand Down Expand Up @@ -677,13 +677,13 @@ jobs:
wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000 http://localhost'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: packages/volto/cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down
2 changes: 1 addition & 1 deletion apps/plone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
"bundlewatch": "0.3.3",
"circular-dependency-plugin": "5.2.2",
"css-loader": "5.2.7",
"cypress": "13.6.6",
"cypress": "13.13.2",
"cypress-axe": "1.5.0",
"cypress-file-upload": "5.0.8",
"deep-freeze": "0.0.1",
Expand Down
32 changes: 16 additions & 16 deletions docs/source/configuration/multilingual.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ myst:

# Multilingual

Volto provide support for Plone's Multilingual feature. You need to install Multiligual
support in Plone (`plone.app.multilingual` add-on), that comes available by default since
Plone 5 and can be installed in Plone's control panel.
Volto provides support for Plone's multilingual feature through the Plone core add-on `plone.app.multilingual`.
It is included with Plone 5 and later.
You can enable it through the {guilabel}`Add-ons` control panel in the administrative interface.


## Volto configuration

You need to enable multilingual in Volto's configuration object:
You need to enable multilingual in Volto's configuration object.

```js
import config from '@plone/volto/registry'
Expand All @@ -28,22 +29,21 @@ config.settings = {
}
```

Declare the language you want to support in your site in the `supportedLanguages` array,
and which is the default language of your site.
Declare the language you want to support in your site in the `supportedLanguages` array, and which is the default language of your site.

```{warning}
The default language and the supported languages must match the one set in the Plone
side, and those should be set using GenericSetup using your policy package, or
manually via the Languages control panel, i.e. en for English, or pt-br for Portuguese (Brazil)
The default language and the supported languages must match those set in the Plone backend.
Those should be set either using GenericSetup using your policy package or manually via the {guilabel}`Languages` control panel.
Examples include `en` for English, or `pt-br` for Portuguese (Brazil).
```

## Features

Volto Multilingual features include:
Volto multilingual includes the following features.

- Language detector that detects the language preference (cookie) and redirects to the related language root folder
- Language switcher that allows user to switch between languages
- Add menu entries that allows to create and link a new content with the original one in one of the supported languages set in the site
- When users use the language switcher to change language from a translated content, they are redirected to the linked content (within the same translation group)
- Manual link two objects (Manage translations link in More menu)
- Manual deletion of a link (unlink) between two objects (Manage translations link in More menu)
- language detector that detects the language preference from a cookie, and redirects to the related language root folder
- language switcher that allows the user to switch between languages
- adds menu entries that allows to create and link a new content item with the original one in one of the supported languages set in the site
- when users use the language switcher to change the language from a translated content, they are redirected to the linked content within the same translation group
- manually link two objects via the {guilabel}`Manage translations` link under the {guilabel}`More` menu
- manually delete a link (or unlink) between two objects ({guilabel}`Manage translations` link under the {guilabel}`More` menu)
2 changes: 1 addition & 1 deletion docs/source/contributing/acceptance-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ dispatch(
```
```{seealso}
[Testing Redux Store](https://www.cypress.io/blog/2018/11/14/testing-redux-store/)
[Testing Redux Store](https://www.cypress.io/blog/testing-redux-store)
```
Expand Down
51 changes: 42 additions & 9 deletions docs/source/contributing/developing-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,19 @@ pnpm install
```


## Start the backend and Volto
(develop-volto-start-plone-label)=

## Start Plone

Every time you want to run Volto for core development, you will need to create two terminal sessions, one for the {ref}`backend <develop-volto-start-the-backend-label>` and one for the {ref}`frontend <develop-volto-start-the-frontend-label>`.
For both sessions, change your working directory to the root of your Volto clone.

To stop either the backend or frontend, use {kbd}`ctrl-c`.


(develop-volto-start-the-backend-label)=

### Start the backend

`````{versionadded} 18.0.0-alpha.42
Persist backend data across Docker sessions.
Expand All @@ -184,10 +196,8 @@ It is intended only for development.
````
`````

Every time you want to run Volto for core development, you will need to create two terminal sessions, one for the backend and one for the frontend.
For both sessions, change your working directory to the root of your Volto clone.

In the first session, start the backend.
You can browse to the backend running at http://localhost:8080.

```shell
make backend-docker-start
Expand All @@ -206,19 +216,42 @@ docker volume rm volto-backend-data
Then run `make backend-docker-start` again to start the backend with a clean data volume.
````

Browse to the backend running at http://localhost:8080.

In the second session, start the frontend.

(develop-volto-configure-backend-language-label)=

#### Configure backend language

If you use the Docker image [`plone-backend`](https://github.com/plone/plone-backend), you can set its `LANGUAGE` environment variable, overriding the default of `en`, when you start it.

This variable is applied only when the Plone site is created.
If you persist data through restarts, you only need to do this once.
Conversely, if you create a Plone site in the wrong language, you can delete the data volume, and recreate it with the correct language.

You can either pass an environment variable into the make command to start the backend, or export an environment variable in your shell session and start the backend.

```shell
# pass method
LANGUAGE=pt-br make backend-docker-start

# export method
export LANGUAGE=pt-br
make backend-docker-start
```


(develop-volto-start-the-frontend-label)=

## Start the frontend

In the second session, start the frontend, Volto.

```shell
pnpm start
```

Browse to the frontend running at http://localhost:3000.

To stop either the backend or frontend, use {kbd}`ctrl-c`.


(developing-core-run-commands-for-pnpm-workspaces-label)=

Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing/install-docker.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Install [Docker Desktop](https://docs.docker.com/get-docker/) for your operating system.
Install [Docker Desktop](https://docs.docker.com/get-started/get-docker/) for your operating system.
Docker Desktop includes all Docker tools.

```{note}
Expand Down
2 changes: 1 addition & 1 deletion packages/volto-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "12.1.5",
"axe-core": "4.8.4",
"cypress": "13.6.6",
"cypress": "13.13.2",
"cypress-axe": "1.5.0",
"cypress-file-upload": "5.0.8"
},
Expand Down
5 changes: 4 additions & 1 deletion packages/volto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ MAKEFLAGS+=--no-builtin-rules
# Project settings (read from repo root)
include ../../variables.mk

# Allow setting the language for backend-docker-start. Default is `en`.
LANGUAGE ?=en

# Recipe snippets for reuse

CHECKOUT_BASENAME="$(shell basename $(shell realpath ./))"
Expand Down Expand Up @@ -100,7 +103,7 @@ release-notes-copy-to-docs: ## Copy release notes into documentation

.PHONY: backend-docker-start
backend-docker-start: ## Starts a Docker-based backend for development
docker run -it --rm --name=backend -p 8080:8080 -v volto-backend-data:/data -e SITE=Plone -e ADDONS='$(KGS)' $(DOCKER_IMAGE)
docker run -it --rm --name=backend -p 8080:8080 -v volto-backend-data:/data -e SITE=Plone -e ADDONS='$(KGS)' -e LANGUAGE='$(LANGUAGE)' $(DOCKER_IMAGE)

.PHONY: frontend-docker-start
frontend-docker-start: ## Starts a Docker-based frontend for development
Expand Down
Loading

0 comments on commit af76a62

Please sign in to comment.