Files
deepDiverPaul 6a4f7cac5f feat(multi-language): Add multi-language support and routing updates
Add configuration for multiple languages in the Website Manager
2026-11-30 19:47:55 +01:00

33 lines
2.4 KiB
Markdown

![Plugi](https://gitea.spenke-nordic.com/deepDiverPaul/plugi/raw/branch/main/plugi-core/dist/images/plugi-banner.png)
> A fork of [PHPagebuilder](https://github.com/HansSchouten/PHPagebuilder) by [Hans Schouten](https://github.com/HansSchouten).
Plugi is a website boilerplate with a drag-and-drop page builder.
## Quick installation
1. Use PHP 8.4 with the PDO MySQL extension and a MySQL 8 database. The supplied Docker image is based on PHP 8.4.
2. Copy `.env.dist` to `.env` and `config.dist.php` to `config.php`; set the database connection, public `BASE_URL`, and a unique admin username and password hash in `.env`.
3. Create the database and a database user, deploy the project at the web root, and make `uploads/` writable by the web server.
4. Open the site, sign in at `/admin/auth`, and follow the Website Manager database update prompt to create/update the schema.
See the [Plugi documentation](https://plugi.paulspenke.com/) for the full installation guide, including manual deployment, Docker development, security, and troubleshooting.
## Multilingual pages
In Website Manager settings, enable the languages the site should use and select a default site language from that enabled list. Older installations without a saved `default_language` continue to use their saved `admin_language` value until a default is saved.
Each page translation has its own editable route. New routes use `/slug` for the default language and `/{locale}/slug` for other enabled languages. Saving a changed route adds a leading slash, removes trailing and repeated slashes (except `/`), and lowercases static path segments; route matching also ignores case and slash variants. Named parameters such as `{id}` and a trailing `*` wildcard remain supported.
Changing the default language affects new route suggestions but does not rewrite existing page URLs. Disabling a language makes its routes unavailable publicly while keeping its translations; re-enabling it restores those routes. See the [Plugi documentation](https://plugi.paulspenke.com/) for the full guide.
## Local Docker development
The supplied Compose stack uses PHP 8.4 and MySQL 8.0 and is for local development only. Copy `.env.dist` to `.env` and `config.dist.php` to `config.php`, replace the sample database and MySQL root passwords, then run:
```sh
docker compose up --build -d
```
The app is available at `http://localhost:63000`; Adminer is bound to localhost at `http://localhost:63001`.