From 74179e6ec7a081558982ec6ef3f7ee59d58c58ef Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:21:59 -0500
Subject: [PATCH 001/477] New translations readme.md (Spanish)
---
i18n/es/docusaurus-plugin-content-docs/current/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/README.md b/i18n/es/docusaurus-plugin-content-docs/current/README.md
index b3b09e6bd..7fc661838 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/README.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/README.md
@@ -6,7 +6,7 @@ slug: /
Flarum es una plataforma de discusión increíblemente sencilla para su sitio web. Es rápido y fácil de usar, con todas las características que necesitas para dirigir una comunidad exitosa. It's also extremely extensible, allowing for ultimate customizability.
-![Flarum Home Screenshot](/en/img/home_screenshot.png)
+![Flarum Home Screenshot](./assets/home_screenshot.png)
## Objetivos
@@ -36,7 +36,7 @@ Esta guía de usuario te ayudará a crear tu propio foro usando Flarum y te ense
💸 The Flarum Foundation doesn't make money off of Flarum, but does have bills to pay. Donations via [GitHub Sponsors](https://github.com/sponsors/flarum) or [OpenCollective](https://opencollective.com/flarum) are always gratefully received. In the past, we've also been able to support some of our core developers financially, so they could work on Flarum part time. This wouldn't be possible without your financial support.
-🧑🤝🧑 Join [our community](https://discuss.flarum.org) to talk about Flarum development, get help with your instance, or just meet cool people! If you're experienced with Flarum, you can also help out beginners!
+🧑🤝🧑 Join [our community](https://discuss.flarum.org) to talk about Flarum development, get help with your instance, or just meet cool people! If you're experienced with Flarum, you can also help out beginners! If you're experienced with Flarum, you can also help out beginners!
🐛 If there's a bug that's bothering you, or a feature idea on your mind, we can't know about it unless you tell us! We track bugs, suggestions, and future development plans [via GitHub issues](https://github.com/flarum/core/issues). If there's already an issue open, adding likes and (constructive) additional information can be very helpful!
From 6c2eb29cb535ba9b37c321212a3f8c2e4d53dc85 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:00 -0500
Subject: [PATCH 002/477] New translations readme.md (German)
---
i18n/de/docusaurus-plugin-content-docs/current/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/README.md b/i18n/de/docusaurus-plugin-content-docs/current/README.md
index 1fb6df7c7..cc4c751c5 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/README.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/README.md
@@ -6,7 +6,7 @@ slug: /
Flarum ist eine herrlich einfache Diskussionsplattform für deine Website. Es ist schnell, kostenlos und benutzerfreundlich und bietet alle Funktionen, die du für den Betrieb einer erfolgreichen Community benötigst. Zudem ist Flarum äußerst erweiterbar und lässt sich optimal anpassen.
-![Flarum Startseite Screenshot](/en/img/home_screenshot.png)
+![Flarum Startseite Screenshot](./assets/home_screenshot.png)
## Ziele
From 454691683ef8bc4a998cbfacb3e3e8042ee2247b Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:02 -0500
Subject: [PATCH 003/477] New translations readme.md (Italian)
---
i18n/it/docusaurus-plugin-content-docs/current/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/README.md b/i18n/it/docusaurus-plugin-content-docs/current/README.md
index fee28613d..71bd5ac6d 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/README.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/README.md
@@ -6,7 +6,7 @@ slug: /
Flarum è un potente software per creare forum di discussione nel tuo sito web. Velocissimo e facile da utilizzare con tutte le feauture necessarie per la creazione del tuo forum di successo. È anche estremamente estensibile, consentendo la massima personalizzabilità.
-![Screenshot della schermata Home di Flarum](/en/img/home_screenshot.png)
+![Screenshot della schermata Home di Flarum](./assets/home_screenshot.png)
## Obiettivi
From 86cf51cd00c2847d6d342b844e5c88e5ed401466 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:03 -0500
Subject: [PATCH 004/477] New translations readme.md (Turkish)
---
i18n/tr/docusaurus-plugin-content-docs/current/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/README.md b/i18n/tr/docusaurus-plugin-content-docs/current/README.md
index 7e17cf8e2..81fa7ece6 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/README.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/README.md
@@ -6,7 +6,7 @@ slug: /
Flarum, web siteniz için oldukça basit bir tartışma platformudur. Başarılı bir topluluk yürütmek için ihtiyacınız olan tüm özelliklerle birlikte kullanımı hızlı ve kolaydır. Aynı zamanda son derece genişletilebilir olup, en üst düzeyde özelleştirilebilirliğe olanak tanır.
-![Flarum Ana Sayfa Ekran Görüntüsü](/en/img/home_screenshot.png)
+![Flarum Ana Sayfa Ekran Görüntüsü](./assets/home_screenshot.png)
## Hedefler
From 208201c8b0429b8b38b98adc7a584e3db9ac47bc Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:05 -0500
Subject: [PATCH 005/477] New translations readme.md (Chinese Simplified)
---
i18n/zh/docusaurus-plugin-content-docs/current/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/README.md b/i18n/zh/docusaurus-plugin-content-docs/current/README.md
index b98c1530a..ab766f780 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/README.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/README.md
@@ -6,7 +6,7 @@ slug: /
Flarum 是一款非常简洁的开源论坛软件。 它响应快速、简便易用,拥有打造一片成功的社区所需的所有功能。 它也极其可扩展,允许达到终极的可定制性。
-![Flarum Home Screenshot](/en/img/home_screenshot.png)
+![Flarum Home Screenshot](./assets/home_screenshot.png)
## 目标
@@ -16,7 +16,7 @@ Flarum 的前身是 [esoTalk](https://github.com/esotalk/esoTalk) 和 [FluxBB](h
* **漂亮、响应式。 ** 以人为本的论坛软件。 Flarum 被精心设计以在不同平台间保持一致性和直观性,开箱即用。
-* **强大、可扩展。** 您可以客制化、扩展或集成 Flarum 以满足您的社区需求。 Flarum 基于 [MIT 协议](https://github.com/flarum/flarum/blob/master/LICENSE) 发布。
+* **强大、可扩展。 ** 您可以客制化、扩展或集成 Flarum 以满足您的社区需求。 Flarum 基于 [MIT 协议](https://github.com/flarum/flarum/blob/master/LICENSE) 发布。
* **免费、开源。 ** Flarum 以 [MIT 许可证](https://github.com/flarum/flarum/blob/master/LICENSE) 发布。
From 355203935eb7538baa5fc46d1bb0a33fe0cb8496 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:06 -0500
Subject: [PATCH 006/477] New translations admin.md (Spanish)
---
i18n/es/docusaurus-plugin-content-docs/current/admin.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/admin.md b/i18n/es/docusaurus-plugin-content-docs/current/admin.md
index e2f0bc93c..ab3226fb4 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/admin.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/admin.md
@@ -9,5 +9,6 @@ The Admin Dashboard has the following sections, being:
- **Permissions** - Shows the permissions for each user group, and allows you to configure global and specific scopes.
- **Appearance** - Allows you to customize the forum's colors, branding and add additional CSS for customization.
- **Users** - Provides you with a paginated list of all the users in the forum, and grants you the ability to edit the user or take administrative actions.
+- **Advanced** - Allows you to configure advanced settings such as Maintenance Mode, Search drivers, and more.
-Apart from the above mentioned sections, the Admin Dashboard also allows you to manage your Extensions (including the flarum core extensions such as Tags) under the _Features_ section. Extensions which modify the forum theme, or allow you to use multiple languages are categorized under the _Themes_ and _Languages_ section respectively.
+Apart from the above-mentioned sections, the Admin Dashboard also allows you to manage your Extensions (including the flarum core extensions such as Tags) under the _Features_ section. Extensions which modify the forum theme, or allow you to use multiple languages are categorized under the _Themes_ and _Languages_ section respectively.
From 2d45cd8cffcd3eb492ef1ee28a7b5793cd0d4ffb Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:07 -0500
Subject: [PATCH 007/477] New translations admin.md (German)
---
i18n/de/docusaurus-plugin-content-docs/current/admin.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/admin.md b/i18n/de/docusaurus-plugin-content-docs/current/admin.md
index c56641a66..386f71d1a 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/admin.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/admin.md
@@ -9,5 +9,6 @@ Das Admin-Dashboard hat die folgenden Abschnitte:
- **Berechtigungen** - Zeigt die Berechtigungen für jede Benutzergruppe an und ermöglicht dir, globale und spezifische Bereiche zu konfigurieren.
- **Erscheinungsbild** - Ermöglicht es, die Farben und das Branding des Forums anzupassen und zusätzliches CSS zur Anpassung hinzuzufügen.
- **Benutzer** – Stellt dir eine paginierte Liste aller Benutzer im Forum zur Verfügung und gibt die Möglichkeit, den Benutzer zu bearbeiten oder administrative Aktionen durchzuführen.
+- **Advanced** - Allows you to configure advanced settings such as Maintenance Mode, Search drivers, and more.
-Abgesehen von den oben genannten Abschnitten ermöglicht das Admin-Dashboard auch die Verwaltung deiner Erweiterungen (einschließlich der Flarum-Core-Erweiterungen wie Tags) im Abschnitt _Features_. Erweiterungen, die das Forum-Thema ändern oder Ihnen erlauben, mehrere Sprachen zu verwenden, werden unter den Abschnitten _Themes_ bzw. _Sprachen_ kategorisiert.
+Apart from the above-mentioned sections, the Admin Dashboard also allows you to manage your Extensions (including the flarum core extensions such as Tags) under the _Features_ section. Erweiterungen, die das Forum-Thema ändern oder Ihnen erlauben, mehrere Sprachen zu verwenden, werden unter den Abschnitten _Themes_ bzw. _Sprachen_ kategorisiert.
From d2d8f352b20460cca5d2248b999e5f6264471414 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:08 -0500
Subject: [PATCH 008/477] New translations admin.md (Italian)
---
i18n/it/docusaurus-plugin-content-docs/current/admin.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/admin.md b/i18n/it/docusaurus-plugin-content-docs/current/admin.md
index 9107e5f0c..101f1c2df 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/admin.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/admin.md
@@ -1,6 +1,6 @@
# Pannello di amministrazione
-Il pannello di amministrazione di Flarum un'interfaccia user-friendly per la gestione del tuo forum. Per accedere al pannello di amministrazione, clicca sul tuo **Nome** nell'angolo in alto a destra dello schermo, e scegli **Amministrazione**. È disponibile solo per gli utenti nel gruppo [gruppo](permissions.md) "Admin".
+Il pannello di amministrazione di Flarum un'interfaccia user-friendly per la gestione del tuo forum. È disponibile solo per gli utenti nel gruppo [gruppo](permissions.md) "Admin". È disponibile solo per gli utenti nel gruppo [gruppo](permissions.md) "Admin".
The Admin Dashboard has the following sections, being:
- **Dashboard** - Shows the main Admin Dashboard, containing statistics and other relevant information.
@@ -9,5 +9,6 @@ The Admin Dashboard has the following sections, being:
- **Permissions** - Shows the permissions for each user group, and allows you to configure global and specific scopes.
- **Appearance** - Allows you to customize the forum's colors, branding and add additional CSS for customization.
- **Users** - Provides you with a paginated list of all the users in the forum, and grants you the ability to edit the user or take administrative actions.
+- **Advanced** - Allows you to configure advanced settings such as Maintenance Mode, Search drivers, and more.
-Apart from the above mentioned sections, the Admin Dashboard also allows you to manage your Extensions (including the flarum core extensions such as Tags) under the _Features_ section. Extensions which modify the forum theme, or allow you to use multiple languages are categorized under the _Themes_ and _Languages_ section respectively.
+Apart from the above-mentioned sections, the Admin Dashboard also allows you to manage your Extensions (including the flarum core extensions such as Tags) under the _Features_ section. Extensions which modify the forum theme, or allow you to use multiple languages are categorized under the _Themes_ and _Languages_ section respectively.
From fbeda67971efa91589fc17daefc46084b0e17d9f Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:09 -0500
Subject: [PATCH 009/477] New translations admin.md (Turkish)
---
i18n/tr/docusaurus-plugin-content-docs/current/admin.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/admin.md b/i18n/tr/docusaurus-plugin-content-docs/current/admin.md
index 3b3ed3318..f8969b09e 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/admin.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/admin.md
@@ -9,5 +9,6 @@ Yönetici Kontrol Panelinde aşağıdaki bölümler bulunur:
- **İzinler** - Her kullanıcı grubunun izinlerini gösterir ve genel ve belirli kapsamları yapılandırmanıza olanak tanır.
- **Görünüm** - Forumun renklerini, markasını özelleştirmenize ve özelleştirme için ek CSS eklemenize olanak tanır.
- **Kullanıcılar** - Forumdaki tüm kullanıcıların sayfalandırılmış bir listesini sağlar ve size kullanıcıyı düzenleme veya idari işlemler gerçekleştirme olanağı verir.
+- **Advanced** - Allows you to configure advanced settings such as Maintenance Mode, Search drivers, and more.
-Yönetici Kontrol Paneli, yukarıda bahsedilen bölümlerin dışında, _Özellikler_ bölümü altında Uzantılarınızı (Etiketler gibi flarum çekirdek uzantıları dahil) yönetmenize de olanak tanır. Forum temasını değiştiren veya birden fazla dil kullanmanıza olanak tanıyan uzantılar, sırasıyla _Temalar_ ve _Diller_ bölümünde kategorize edilmiştir.
+Apart from the above-mentioned sections, the Admin Dashboard also allows you to manage your Extensions (including the flarum core extensions such as Tags) under the _Features_ section. Forum temasını değiştiren veya birden fazla dil kullanmanıza olanak tanıyan uzantılar, sırasıyla _Temalar_ ve _Diller_ bölümünde kategorize edilmiştir.
From a4c2e09fb587b84831ab8144a52ef2d8d17d65f9 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:11 -0500
Subject: [PATCH 010/477] New translations admin.md (Chinese Simplified)
---
i18n/zh/docusaurus-plugin-content-docs/current/admin.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/admin.md b/i18n/zh/docusaurus-plugin-content-docs/current/admin.md
index 74a41cdbc..dfa5072e9 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/admin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/admin.md
@@ -9,5 +9,6 @@ Flarum 管理面板是一个友好的论坛管理界面。 且只对「管理组
- **权限** - 显示每个用户组的权限,并允许您配置全站和特定范围。
- **外观** - 允许您自定义论坛的颜色、图标和添加额外的 CSS 以自定义论坛样式。
- **用户** - 为您提供论坛中所有用户的分页列表,可以在此编辑或管理用户。
+- **Advanced** - Allows you to configure advanced settings such as Maintenance Mode, Search drivers, and more.
-除了以上提到的这些部分,主管理面板还通过_扩展_部分来允许你管理安装的扩展,这也包括 Flarum 的核心扩展,例如 Tags。 在 _主题 _ 和 _语言_ 模块下,您可以修改论坛主题或使用扩展以适应多语言。
+Apart from the above-mentioned sections, the Admin Dashboard also allows you to manage your Extensions (including the flarum core extensions such as Tags) under the _Features_ section. 在 _主题 _ 和 _语言_ 模块下,您可以修改论坛主题或使用扩展以适应多语言。
From 3c557bd22852c5fd1b799ee22739e9ae392099d0 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:12 -0500
Subject: [PATCH 011/477] New translations config.md (Spanish)
---
.../current/config.md | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/config.md b/i18n/es/docusaurus-plugin-content-docs/current/config.md
index cc32a6aca..1d7928457 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/config.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/config.md
@@ -11,10 +11,10 @@ Aquí hay un rápido resumen de lo que significa todo con un archivo de ejemplo:
```php
false, // activa o desactiva el modo de depuración, utilizado para solucionar problemas
- 'offline' => false, // enables or disables site maintenance mode. This makes your site inaccessible to all users (including admins).
+ 'offline' => false, // none, high, low or safe.
'database' =>
array (
- 'driver' => 'mysql', // el controlador de la base de datos, es decir, MySQL, MariaDB...
+ 'driver' => 'mysql', // the database driver, i.e. MySQL, MariaDB, PostgreSQL, SQLite
'host' => 'localhost', // el host de la conexión, localhost en la mayoría de los casos, a menos que se utilice un servicio externo
'database' => 'flarum', // el nombre de la base de datos en la instancia
'username' => 'root', // nombre de usuario de la base de datos
@@ -33,3 +33,15 @@ Aquí hay un rápido resumen de lo que significa todo con un archivo de ejemplo:
),
);
```
+
+### Maintenance modes
+
+Flarum has a maintenance mode that can be enabled by setting the `offline` key in the `config.php` file to one of the following values:
+* `none` - No maintenance mode.
+* `high` - No one can access the forum, not even admins.
+* `low` - Only admins can access the forum.
+* `safe` - Only admins can access the forum, and no extensions are booted.
+
+This can also be configured from the admin panel's advanced settings page:
+
+![Toggle advanced page](https://user-images.githubusercontent.com/20267363/277113270-f2e9c91d-2a29-436b-827f-5c4d20e2ed54.png)
From 444e5ef9e3d63d06b217ff06a75e1f6e346238c4 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:13 -0500
Subject: [PATCH 012/477] New translations config.md (German)
---
.../current/config.md | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/config.md b/i18n/de/docusaurus-plugin-content-docs/current/config.md
index 9dd3cedda..358c85523 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/config.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/config.md
@@ -11,10 +11,10 @@ Hier ist ein kurzer Überblick darüber, was alles mit einer Beispieldatei bedeu
```php
false, // aktiviert oder deaktiviert den Debug-Modus, der zum Beheben von Problemen verwendet wird
- 'offline' => false, // aktiviert oder deaktiviert den Site-Wartungsmodus. Dadurch wird deine Website für alle Benutzer (einschließlich Administratoren) unzugänglich.
+ 'offline' => false, // none, high, low or safe.
'database' =>
array (
- 'driver' => 'mysql', // der Datenbanktreiber, d.h. MySQL, MariaDB...
+ 'driver' => 'mysql', // the database driver, i.e. MySQL, MariaDB, PostgreSQL, SQLite
'host' => 'localhost', // der Host der Verbindung, in den meisten Fällen localhost, es sei denn, es wird ein externer Dienst verwendet
'database' => 'flarum', // der Name der Datenbank in der Instanz
'username' => 'root', // Datenbank-Benutzername
@@ -33,3 +33,15 @@ Hier ist ein kurzer Überblick darüber, was alles mit einer Beispieldatei bedeu
),
);
```
+
+### Maintenance modes
+
+Flarum has a maintenance mode that can be enabled by setting the `offline` key in the `config.php` file to one of the following values:
+* `none` - No maintenance mode.
+* `high` - No one can access the forum, not even admins.
+* `low` - Only admins can access the forum.
+* `safe` - Only admins can access the forum, and no extensions are booted.
+
+This can also be configured from the admin panel's advanced settings page:
+
+![Toggle advanced page](https://user-images.githubusercontent.com/20267363/277113270-f2e9c91d-2a29-436b-827f-5c4d20e2ed54.png)
From 20186b31a5d0725da2c4d2776d46bc304c5edee1 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:14 -0500
Subject: [PATCH 013/477] New translations config.md (Italian)
---
.../current/config.md | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/config.md b/i18n/it/docusaurus-plugin-content-docs/current/config.md
index 84ae4122a..c41615e85 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/config.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/config.md
@@ -11,10 +11,10 @@ Ecco una rapida panoramica di cosa significa con un file di esempio:
```php
false, // abilita o disabilita il debug mode, utilizzato per la risoluzione dei problemi
- 'offline' => false, // abilita o disabilita la modalità di manutenzione del sito. Questo rende il tuo sito inaccessibile a tutti gli utenti (compresi gli amministratori).
+ 'offline' => false, // none, high, low or safe.
'database' =>
array (
- 'driver' => 'mysql', // il driver del database, es. MySQL, MariaDB...
+ 'driver' => 'mysql', // the database driver, i.e. MySQL, MariaDB, PostgreSQL, SQLite
'host' => 'localhost', // l'host della connessione, localhost nella maggior parte dei casi a meno di non utilizzare un servizio esterno
'database' => 'flarum', // il nome del database nell'istanza
'username' => 'root', // nome utente del database
@@ -33,3 +33,15 @@ Ecco una rapida panoramica di cosa significa con un file di esempio:
),
);
```
+
+### Maintenance modes
+
+Flarum has a maintenance mode that can be enabled by setting the `offline` key in the `config.php` file to one of the following values:
+* `none` - No maintenance mode.
+* `high` - No one can access the forum, not even admins.
+* `low` - Only admins can access the forum.
+* `safe` - Only admins can access the forum, and no extensions are booted.
+
+This can also be configured from the admin panel's advanced settings page:
+
+![Toggle advanced page](https://user-images.githubusercontent.com/20267363/277113270-f2e9c91d-2a29-436b-827f-5c4d20e2ed54.png)
From f0e8d1ba80f3093447cbefbb6055e7d5682da3b2 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:16 -0500
Subject: [PATCH 014/477] New translations config.md (Turkish)
---
.../current/config.md | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/config.md b/i18n/tr/docusaurus-plugin-content-docs/current/config.md
index 59a6e2328..a83f75b3f 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/config.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/config.md
@@ -11,10 +11,10 @@ Dosya varsa, Flarum'a zaten kurulu olduğunu söyler. Ayrıca Flarum'a veritaban
```php
false, // sorunları gidermek için kullanılan hata ayıklama modunu etkinleştirir veya devre dışı bırakır
- 'offline' => false, // site bakım modunu etkinleştirir veya devre dışı bırakır. Bu, sitenizi tüm kullanıcılar (yöneticiler dahil) için erişilemez hale getirir.
+ 'offline' => false, // none, high, low or safe.
'database' =>
array (
- 'driver' => 'mysql', // veritabanı sürücüsü, yani MySQL, MariaDB...
+ 'driver' => 'mysql', // the database driver, i.e. MySQL, MariaDB, PostgreSQL, SQLite
'host' => 'localhost', // bağlantının ana bilgisayarı, harici bir hizmet kullanılmadığı sürece çoğu durumda localhost
'database' => 'flarum', // veritabanının adı
'username' => 'root', // veritabanı kullanıcı adı
@@ -22,6 +22,7 @@ Dosya varsa, Flarum'a zaten kurulu olduğunu söyler. Ayrıca Flarum'a veritaban
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '', / veritabanındaki tablolar için önek, aynı veritabanını başka bir hizmetle paylaşıyorsanız kullanışlıdır
+ 'port' => '3306', // veritabanındaki tablolar için önek, aynı veritabanını başka bir hizmetle paylaşıyorsanız kullanışlıdır
'port' => '3306', // veritabanı bağlantısının portu, MySQL ile varsayılan olarak 3306'dır
'strict' => false,
),
@@ -33,3 +34,15 @@ Dosya varsa, Flarum'a zaten kurulu olduğunu söyler. Ayrıca Flarum'a veritaban
),
);
```
+
+### Maintenance modes
+
+Flarum has a maintenance mode that can be enabled by setting the `offline` key in the `config.php` file to one of the following values:
+* `none` - No maintenance mode.
+* `high` - No one can access the forum, not even admins.
+* `low` - Only admins can access the forum.
+* `safe` - Only admins can access the forum, and no extensions are booted.
+
+This can also be configured from the admin panel's advanced settings page:
+
+![Toggle advanced page](https://user-images.githubusercontent.com/20267363/277113270-f2e9c91d-2a29-436b-827f-5c4d20e2ed54.png)
From 414e62d5d0b65b18ee6d77ce264f590ad56c4574 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:17 -0500
Subject: [PATCH 015/477] New translations config.md (Chinese Simplified)
---
.../current/config.md | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/config.md b/i18n/zh/docusaurus-plugin-content-docs/current/config.md
index e0331c835..a02122205 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/config.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/config.md
@@ -11,10 +11,10 @@
```php
false, // 启用或禁用调试模式,用于排查问题
- 'offline' => false, // 启用或禁用网站维护模式。这使得所有用户(包括管理员)无法访问您的网站。
+ 'offline' => false, // none, high, low or safe.
'database' =>
array (
- 'driver' => 'mysql', // 数据库驱动,例如 MySQL, MariaDB ……
+ 'driver' => 'mysql', // the database driver, i.e. MySQL, MariaDB, PostgreSQL, SQLite
'host' => 'localhost', // 连接的主机,除非使用外部服务,否则多数情况下是 localhost
'database' => 'flarum', // 数据库实例名
'username' => 'root', // 数据库用户名
@@ -33,3 +33,15 @@
),
);
```
+
+### Maintenance modes
+
+Flarum has a maintenance mode that can be enabled by setting the `offline` key in the `config.php` file to one of the following values:
+* `none` - No maintenance mode.
+* `high` - No one can access the forum, not even admins.
+* `low` - Only admins can access the forum.
+* `safe` - Only admins can access the forum, and no extensions are booted.
+
+This can also be configured from the admin panel's advanced settings page:
+
+![Toggle advanced page](https://user-images.githubusercontent.com/20267363/277113270-f2e9c91d-2a29-436b-827f-5c4d20e2ed54.png)
From 40746e5cad9d83cccbc203a61b0713b836968d6f Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:18 -0500
Subject: [PATCH 016/477] New translations contributing.md (Spanish)
---
.../current/contributing.md | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/contributing.md b/i18n/es/docusaurus-plugin-content-docs/current/contributing.md
index abf602d77..c0e096f07 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/contributing.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/contributing.md
@@ -16,7 +16,7 @@ Este documento es una guía para los desarrolladores que quieren contribuir con
🎠 **It's Fun!** We really enjoy working on Flarum: there's a lot of interesting challenges and fun features to build. We also have an active community on [our forums](https://discuss.flarum.org) and [Discord server](https://flarum.org/chat).
-## Configuración de desarrollo
+## En qué trabajar
Consulta nuestros próximos [Hitos](https://github.com/flarum/core/milestones) para tener una visión general de lo que hay que hacer. Consulta la etiqueta [Good first issue](https://github.com/flarum/core/labels/Good%20first%20issue) para ver una lista de temas que deberían ser relativamente fáciles de empezar. If there's anything you're unsure of, don't hesitate to ask! All of us were just starting out once.
@@ -89,21 +89,21 @@ A typical contribution workflow looks like this:
* Características *menores* que son totalmente compatibles con la versión actual de Flarum pueden ser enviadas al ultimo branch estable.
1. 🔨 **Escribe** algo de código.
- * Ver abajo sobre el [Estilo de codificación](#coding-style).
- * Características *mayores* deben enviarse siempre al branch `master`, que contiene la próxima versión de Flarum.
+ * *Correcciones de Bugs* debe enviarse al ultimo branch estable.
+ * Características *menores* que son totalmente compatibles con la versión actual de Flarum pueden ser enviadas al ultimo branch estable.
* *Major* features should always be sent to the `main` branch, which contains the upcoming Flarum release.
* Internamente utilizamos el scheme de nomenclatura `/` (eg. `tz/refactor-frontend`).
2. 🚦 **Prueba** el código.
- * Añade pruebas unitarias según sea necesario cuando arregles errores o añadas características.
+ * Ver abajo sobre el [Estilo de codificación](#coding-style).
3. 💾 Haz el **commit** de su código con un mensaje descriptivo.
- * Si su cambio resuelve un problema existente (por lo general, debería) incluir "Fixes #123" en una nueva línea, donde 123 es el número del issue.
+ * Añade pruebas unitarias según sea necesario cuando arregles errores o añadas características.
* Escriba un [buen mensaje en el commit](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
* See [here](extend/testing.md) for more information about testing in Flarum.
4. 🎁 **Envia** un Pull Request en GitHub.
- * Rellene la plantilla del pull request.
+ * Si su cambio resuelve un problema existente (por lo general, debería) incluir "Fixes #123" en una nueva línea, donde 123 es el número del issue.
* Follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification.
* *Fix* commits should describe the issue fixed, not how it was fixed.
@@ -118,11 +118,11 @@ A typical contribution workflow looks like this:
7. **Columnas** deben nombrarse según su tipo de datos:
-## Herramientas de Desarrollo
+## Estilo de Codificación
In order to keep the Flarum codebase clean and consistent, we have a number of coding style guidelines that we follow. When in doubt, read the source code.
-Don't worry if your code styling isn't perfect! StyleCI and Prettier will automatically check formatting for every pull request. This allows us to focus on the content of the contribution, not the code style.
+Don't worry if your code styling isn't perfect! StyleCI and Prettier will automatically check formatting for every pull request. StyleCI and Prettier will automatically check formatting for every pull request. This allows us to focus on the content of the contribution, not the code style.
### PHP
From e7480bb15f0e9703ce7987e905005eae0857dc13 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:19 -0500
Subject: [PATCH 017/477] New translations contributing.md (German)
---
.../docusaurus-plugin-content-docs/current/contributing.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/contributing.md b/i18n/de/docusaurus-plugin-content-docs/current/contributing.md
index 2c870c07e..2cb37231b 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/contributing.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/contributing.md
@@ -34,6 +34,11 @@ Since Flarum is so extension-driven, we highly recommend [our extension docs](ex
git clone https://github.com/flarum/flarum.git
cd flarum
+# Or, when you want to clone directly into the current directory
+git clone https://github.com/flarum/flarum.git .
+git clone https://github.com/flarum/flarum.git
+cd flarum
+
# Or, when you want to clone directly into the current directory
git clone https://github.com/flarum/flarum.git .
# Note, the directory must be empty
From 6a1108b1c9850096a94cd452b3a7459518efa15e Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:21 -0500
Subject: [PATCH 018/477] New translations contributing.md (Italian)
---
.../current/contributing.md | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/contributing.md b/i18n/it/docusaurus-plugin-content-docs/current/contributing.md
index 1d6e6b64f..c9c42e1d0 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/contributing.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/contributing.md
@@ -6,7 +6,7 @@ Prima di contribuire, leggi il [codice di condotta](code-of-conduct.md).
Questo documento è una guida per gli sviluppatori che vogliono contribuire con codice a Flarum. Se hai appena iniziato, ti consigliamo di leggere la documentazione [Per iniziare](/extend/start.md) (per ora in inglese) sul funzionamento di Flarum.
-## Su cosa lavorare
+## Contribuire a Flarum
⚡ **Have Real Impact.** There are thousands of Flarum instances, with millions of aggregate end users. By contributing to Flarum, your code will have a positive impact on all of them.
@@ -16,7 +16,7 @@ Questo documento è una guida per gli sviluppatori che vogliono contribuire con
🎠 **It's Fun!** We really enjoy working on Flarum: there's a lot of interesting challenges and fun features to build. We also have an active community on [our forums](https://discuss.flarum.org) and [Discord server](https://flarum.org/chat).
-## Setup area di sviluppo
+## Su cosa lavorare
Dai un occhiata ai nostri prossimi [Traduardi (in inglese)](https://github.com/flarum/core/milestones) per una panoramica di ciò che deve essere fatto. Consulta le [Primi problemi](https://github.com/flarum/core/labels/Good%20first%20issue) per un elenco di problemi con cui dovrebbe essere relativamente facile iniziare. Se c'è qualcosa di cui non sei sicuro, non esitare a chiedere! Abbiamo tutti cominciato dal principio.
@@ -24,7 +24,7 @@ Se hai intenzione di andare avanti e lavorare su qualcosa, commenta il problema
Dal momento che Flarum è così estendibile, consigliamo vivamente [i nostri documenti per le estensioni](extend/README.md) come riferimento quando si lavora sul core, così come per le estensioni in bundle. Si dovrebbe iniziare con [l'introduzione](extend/README.md) per una migliore comprensione della nostra filosofia di estensibilità.
-## Flusso di lavoro nello sviluppo
+## Setup area di sviluppo
### Impostare un codice locale
@@ -80,7 +80,7 @@ Alternatively, you can use tools like, [Laravel Valet](https://laravel.com/docs/
Most Flarum contributors develop with [PHPStorm](https://www.jetbrains.com/phpstorm/download/) or [Visual Studio Code](https://code.visualstudio.com/).
-## Stile del codice
+## Flusso di lavoro nello sviluppo
A typical contribution workflow looks like this:
@@ -89,21 +89,21 @@ A typical contribution workflow looks like this:
* *Funzionalità minori* che sono completamente retrocompatibili con l'attuale versione di Flarum possono essere inviate all'ultimo branch stabile.
1. 🔨 **Scrivi** un po' di codice.
- * Vedi sotto per lo [stile del codice](#stile-del-codice).
+ * * Le correzioni di bug* dovrebbero essere inviate all'ultimo branch stabile.
* *Funzionalità minori* che sono completamente retrocompatibili con l'attuale versione di Flarum possono essere inviate all'ultimo branch stabile.
* *Major* features should always be sent to the `main` branch, which contains the upcoming Flarum release.
* Internamente usiamo lo schema di denominazione `/` (es. `tz/refactor-frontend`).
2. 🚦 **Testa** il tuo codice.
- * Aggiungi unit test in base alle esigenze durante la correzione di bug o l'aggiunta di funzionalità.
+ * Vedi sotto per lo [stile del codice](#stile-del-codice).
3. 💾 **Crea dei commit** per il tuo codice con un messaggio descrittivo.
- * Se la modifica risolve un problema esistente (di solito, dovrebbe) includere "Fixes #123" in una nuova riga, dove 123 è il numero dell'issue GitHub.
+ * Aggiungi unit test in base alle esigenze durante la correzione di bug o l'aggiunta di funzionalità.
* Scrivi un [buon messaggio accompagnatorio](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
* Vedi [qui](extend/testing.md) per maggiori informazioni sui test in Flarum.
4. 🎁 **Invia** una Pull Request su GitHub.
- * Riempi i campi della richiesta.
+ * Se la modifica risolve un problema esistente (di solito, dovrebbe) includere "Fixes #123" in una nuova riga, dove 123 è il numero dell'issue GitHub.
* Follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification.
* *Fix* commits should describe the issue fixed, not how it was fixed.
@@ -118,7 +118,7 @@ A typical contribution workflow looks like this:
7. 🕺 **Festeggia** per aver contribuito a Flarum.
-## Strumenti di sviluppo
+## Stile del codice
In order to keep the Flarum codebase clean and consistent, we have a number of coding style guidelines that we follow. When in doubt, read the source code.
From 43cb9871c38ffe9014e7966443cc95c2de08a9a2 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:23 -0500
Subject: [PATCH 019/477] New translations contributing.md (Turkish)
---
.../current/contributing.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/contributing.md b/i18n/tr/docusaurus-plugin-content-docs/current/contributing.md
index f6b7b0d32..7e78dbdbf 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/contributing.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/contributing.md
@@ -16,7 +16,7 @@ Bu belge, Flarum'a kod katkısında bulunmak isteyen geliştiriciler için bir k
🎠 **It's Fun!** We really enjoy working on Flarum: there's a lot of interesting challenges and fun features to build. We also have an active community on [our forums](https://discuss.flarum.org) and [Discord server](https://flarum.org/chat).
-## Geliştirme Kurulumu
+## Ne Üzerinde Çalışmalı
Nelerin yapılması gerektiğine dair genel bir bakış için [Milestones](https://github.com/flarum/core/milestones) dönüm noktalarına göz atın. Başlaması nispeten kolay olması gereken sorunların bir listesi için [Good first issue](https://github.com/flarum/core/labels/Good%20first%20issue) etiketine bakın. If there's anything you're unsure of, don't hesitate to ask! All of us were just starting out once.
@@ -89,13 +89,13 @@ A typical contribution workflow looks like this:
* Mevcut Flarum sürümüyle geriye dönük olarak tamamen uyumlu olan *Küçük* özellikler, en son kararlı dala gönderilebilir.
1. 🔨 Bir **kod** yazın.
- * [Kodlama Stili](#Kodlama-Stili) hakkında aşağıya bakın.
- * *Ana* özellikler her zaman gelecek Flarum sürümünü içeren "ana" şubeye gönderilmelidir.
+ * *Hata düzeltmeleri* en son kararlı dala gönderilmelidir.
+ * Mevcut Flarum sürümüyle geriye dönük olarak tamamen uyumlu olan *Küçük* özellikler, en son kararlı dala gönderilebilir.
* *Major* features should always be sent to the `main` branch, which contains the upcoming Flarum release.
* Dahili olarak `/` (eg. `tz/refactor-frontend`) adlandırma şemasını kullanıyoruz.
2. 🚦 **Kodunuzu** test edin.
- * Hataları giderirken veya özellikler eklerken gerektiği gibi birim testleri ekleyin.
+ * [Kodlama Stili](#Kodlama-Stili) hakkında aşağıya bakın.
3. 💾 Kodunuzu açıklayıcı bir mesajla **işleyin**.
* Add unit tests as necessary when fixing bugs or adding features.
@@ -118,7 +118,7 @@ A typical contribution workflow looks like this:
7. 🕺 **Dance** like you just contributed to Flarum.
-## Geliştirme araçları
+## Kodlama Stili
In order to keep the Flarum codebase clean and consistent, we have a number of coding style guidelines that we follow. When in doubt, read the source code.
From 800ae2c0aa4726cabe156633e378142b32602592 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:25 -0500
Subject: [PATCH 020/477] New translations contributing.md (Chinese Simplified)
---
.../current/contributing.md | 39 +++++++++++--------
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contributing.md b/i18n/zh/docusaurus-plugin-content-docs/current/contributing.md
index db188b72f..03ef6fa6e 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/contributing.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/contributing.md
@@ -8,19 +8,19 @@
## 为什么要为Flarum做贡献?
-⚡ **作出实际影响。** 成千上万的Flarum实例,和数百万的累积最终用户, 都会因为你的贡献而受益。
+⚡ **作出实际影响。 ** 成千上万的Flarum实例,和数百万的累积最终用户, 都会因为你的贡献而受益。 都会因为你的贡献而受益。
-🔮 **塑造Flarum的未来。** 我们有很长的待办事项列表,但时间有限。 如果你愿意成为一个特性或更新的代言人,它将更有可能发生,并且你将能够实现你的愿景。 此外,我们的路线图和里程碑是由我们 [的核心开发团队](https://flarum.org/team)设定的,我们所有人都是贡献者。 影响的最佳途径是贡献。
+🔮 **塑造Flarum的未来。 ** 我们有很长的待办事项列表,但时间有限。 如果你愿意成为一个特性或更新的代言人,它将更有可能发生,并且你将能够实现你的愿景。 此外,我们的路线图和里程碑是由我们 [的核心开发团队](https://flarum.org/team)设定的,我们所有人都是贡献者。 影响的最佳途径是贡献。
-🧑💻 **成为更好的工程师。** 我们的代码库是现代化的,我们非常重视良好的工程和清晰的代码。 在设计、基础设施、性能和可扩展性方面,也有很多有趣、具有挑战性的问题需要解决。 特别的,如果你是一名学生或处于职业生涯的初期,参与 Flarum 的开发是一个培养开发技能的绝佳机会。
+🧑💻 **成为更好的工程师。 ** 我们的代码库是现代化的,我们非常重视良好的工程和清晰的代码。 在设计、基础设施、性能和可扩展性方面,也有很多有趣、具有挑战性的问题需要解决。 特别的,如果你是一名学生或处于职业生涯的初期,参与 Flarum 的开发是一个培养开发技能的绝佳机会。
-🎠 **很有趣!** 我们非常喜欢在 Flarum 上工作:有很多有趣的挑战和有趣的特性可以构建。 我们在[论坛](https://discuss.flarum.org)和 [Discord 服务器](https://flarum.org/chat)上也有一个活跃的社区。
+🎠 **很有趣! ** 我们非常喜欢在 Flarum 上工作:有很多有趣的挑战和有趣的特性可以构建。 我们在[论坛](https://discuss.flarum.org)和 [Discord 服务器](https://flarum.org/chat)上也有一个活跃的社区。
## 开发设置
请查看我们的规划 [里程碑](https://github.com/flarum/core/milestones),了解一下需要做的事情。 您可以查看[「Good first issue」](https://github.com/flarum/core/labels/Good%20first%20issue)标签中的 Issue,这些 Issue 都比较容易上手。 有任何您不确定的问题,不要犹豫,直接提问! 我们曾经都是新手。
-如果您打算揽下某项工作,请先在相关 Issue 上发表评论或创建一个新的 Issue 告知我们, 以免做无用功。
+如果您打算揽下某项工作,请先在相关 Issue 上发表评论或创建一个新的 Issue 告知我们, 以免做无用功。 以免做无用功。
由于 Flarum 是如此依赖扩展,因此在处理核心问题以及捆绑扩展时,我们强烈推荐使用[我们的扩展文档](extend/README.md)作为参考。 你应该从[介绍](extend/README.md)开始,以更好地了解我们扩展中的学问。
@@ -34,6 +34,11 @@
git clone https://github.com/flarum/flarum.git
cd flarum
+# 或者,如果你想要直接克隆到当前目录:
+git clone https://github.com/flarum/flarum.git .
+git clone https://github.com/flarum/flarum.git
+cd flarum
+
# 或者,如果你想要直接克隆到当前目录:
git clone https://github.com/flarum/flarum.git .
# Note, the directory must be empty
@@ -49,7 +54,7 @@ git clone https://github.com//framework.git PATH_TO_MONOREPO
准备好以上本地环境后,请务必打开 **config.php** 中的 `debug` 调试模式,并在 PHP 配置中将 `display_errors` 设置为 `On`。 这样您就能同时看到 Flarum 和 PHP 的详细报错内容。 调试模式还会在每个请求时强制重新编译Flarum的文件,省去了在每次更改扩展的JavaScript或CSS后调用`php flarum cache:clear`的需要。
-Flarum 的前端代码是用 ES6 编写的,并已编译为 JavaScript。 在开发过程中,你需要使用 [Node.js ](https://nodejs.org/)和 [`yarn`](https://yarnpkg.com/) 重新编译 JavaScript。 **请不要在发送 PR 时提交生成的 `dist `文件**;这会在更改合并到`主分支`时自动处理。
+Flarum 的前端代码是用 ES6 编写的,并已编译为 JavaScript。 在开发过程中,你需要使用 [Node.js ](https://nodejs.org/)和 [`yarn`](https://yarnpkg.com/) 重新编译 JavaScript。 **请不要在发送 PR 时提交生成的 `dist`文件**;这会在更改合并到`主分支`时自动处理。
要为前端做出贡献,你需要先安装 JavaScript 依赖项。 Monorepo 使用[ yarn 工作区](https://classic.yarnpkg.com/lang/en/docs/workspaces/)来轻松地在所有包之间安装 JS 依赖项。
@@ -89,13 +94,13 @@ yarn dev
* 与当前 Flarum 版本完全向后兼容的 *次要* 功能可以提交合并到最新的稳定分支。
1. 🌳 **建立分支**,从合适的分支建立一个新功能分支。
- * 请参见这里的 [编码风格](#编码风格)。
- * *主要* 功能应当始终提交合并到 `master` 分支,该分支包含即将推出的 Flarum 版本。
+ * *Bug 修复* 应当提交合并到最新的稳定分支。
+ * 与当前 Flarum 版本完全向后兼容的 *次要* 功能可以提交合并到最新的稳定分支。
* *重要的*功能应该总是被提交到`主分支`,该分支包含即将发布的 Flarum 版本。
* 在内部,我们使用 `<姓名首字母缩写>/<简短描述>` 的分支命名方案(例如:`tz/refactor-frontend`)。
2. 🔨 **编写代码**,编写一些代码。
- * 修复错误或添加功能时,请根据需要添加单元测试。
+ * 请参见这里的 [编码风格](#编码风格)。
3. 🚦 **测试代码**,测试您的代码。
* 修复错误或添加功能时,请根据需要添加单元测试。
@@ -118,15 +123,15 @@ yarn dev
7. 🕺 **恭喜**,您刚刚向 Flarum 做了贡献。
-## 开发工具
+## 编码风格
-In order to keep the Flarum codebase clean and consistent, we have a number of coding style guidelines that we follow. When in doubt, read the source code.
+In order to keep the Flarum codebase clean and consistent, we have a number of coding style guidelines that we follow. When in doubt, read the source code. When in doubt, read the source code.
-Don't worry if your code styling isn't perfect! StyleCI and Prettier will automatically check formatting for every pull request. This allows us to focus on the content of the contribution, not the code style.
+Don't worry if your code styling isn't perfect! StyleCI and Prettier will automatically check formatting for every pull request. This allows us to focus on the content of the contribution, not the code style. StyleCI and Prettier will automatically check formatting for every pull request. This allows us to focus on the content of the contribution, not the code style.
### PHP
-Flarum follows the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standard and the [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) autoloading standard. On top of this, we conform to a number of [other style rules](https://github.com/flarum/framework/blob/main/.styleci.yml). We use PHP 7 type hinting and return type declarations where possible, and [PHPDoc](https://docs.phpdoc.org/) to provide inline documentation. Try and mimic the style used by the rest of the codebase in your contributions.
+Flarum follows the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standard and the [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) autoloading standard. On top of this, we conform to a number of [other style rules](https://github.com/flarum/framework/blob/main/.styleci.yml). We use PHP 7 type hinting and return type declarations where possible, and [PHPDoc](https://docs.phpdoc.org/) to provide inline documentation. Try and mimic the style used by the rest of the codebase in your contributions. On top of this, we conform to a number of [other style rules](https://github.com/flarum/framework/blob/main/.styleci.yml). We use PHP 7 type hinting and return type declarations where possible, and [PHPDoc](https://docs.phpdoc.org/) to provide inline documentation. Try and mimic the style used by the rest of the codebase in your contributions.
* 命名空间应当是单数(例如:`Flarum\Discussion`,而非 `Flarum\Discussions`)
* 接口命名应当以 `Interface` 结尾(例如:`MailableInterface`)
@@ -135,7 +140,7 @@ Flarum follows the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/
### JavaScript
-Flarum's JavaScript mostly follows the [Airbnb Style Guide](https://github.com/airbnb/javascript). We use [ESDoc](https://esdoc.org/manual/tags.html) to provide inline documentation.
+Flarum's JavaScript mostly follows the [Airbnb Style Guide](https://github.com/airbnb/javascript). We use [ESDoc](https://esdoc.org/manual/tags.html) to provide inline documentation. We use [ESDoc](https://esdoc.org/manual/tags.html) to provide inline documentation.
### 翻译
@@ -161,10 +166,10 @@ We use a [standard key format](/extend/i18n.md#appendix-a-standard-key-format) t
## 贡献者许可协议
-By contributing your code to Flarum you grant the Flarum Foundation (Stichting Flarum) a non-exclusive, irrevocable, worldwide, royalty-free, sublicensable, transferable license under all of Your relevant intellectual property rights (including copyright, patent, and any other rights), to use, copy, prepare derivative works of, distribute and publicly perform and display the Contributions on any licensing terms, including without limitation: (a) open source licenses like the MIT license; and (b) binary, proprietary, or commercial licenses. Except for the licenses granted herein, You reserve all right, title, and interest in and to the Contribution.
+By contributing your code to Flarum you grant the Flarum Foundation (Stichting Flarum) a non-exclusive, irrevocable, worldwide, royalty-free, sublicensable, transferable license under all of Your relevant intellectual property rights (including copyright, patent, and any other rights), to use, copy, prepare derivative works of, distribute and publicly perform and display the Contributions on any licensing terms, including without limitation: (a) open source licenses like the MIT license; and (b) binary, proprietary, or commercial licenses. Except for the licenses granted herein, You reserve all right, title, and interest in and to the Contribution. Except for the licenses granted herein, You reserve all right, title, and interest in and to the Contribution.
-You confirm that you are able to grant us these rights. You represent that You are legally entitled to grant the above license. If Your employer has rights to intellectual property that You create, You represent that You have received permission to make the Contributions on behalf of that employer, or that Your employer has waived such rights for the Contributions.
+You confirm that you are able to grant us these rights. You represent that You are legally entitled to grant the above license. You confirm that you are able to grant us these rights. You represent that You are legally entitled to grant the above license. If Your employer has rights to intellectual property that You create, You represent that You have received permission to make the Contributions on behalf of that employer, or that Your employer has waived such rights for the Contributions.
-You represent that the Contributions are Your original works of authorship, and to Your knowledge, no other person claims, or has the right to claim, any right in any invention or patent related to the Contributions. You also represent that You are not legally obligated, whether by entering into an agreement or otherwise, in any way that conflicts with the terms of this license.
+You represent that the Contributions are Your original works of authorship, and to Your knowledge, no other person claims, or has the right to claim, any right in any invention or patent related to the Contributions. You also represent that You are not legally obligated, whether by entering into an agreement or otherwise, in any way that conflicts with the terms of this license. You also represent that You are not legally obligated, whether by entering into an agreement or otherwise, in any way that conflicts with the terms of this license.
The Flarum Foundation acknowledges that, except as explicitly described in this Agreement, any Contribution which you provide is on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
\ No newline at end of file
From 4f3f9d205b1f9cf01cb3d8c27d2a232b96f29918 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:26 -0500
Subject: [PATCH 021/477] New translations extensions.md (Spanish)
---
.../current/extensions.md | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/extensions.md b/i18n/es/docusaurus-plugin-content-docs/current/extensions.md
index a168cb229..43196413d 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/extensions.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/extensions.md
@@ -22,12 +22,12 @@ The extension manager allows an admin user to install any composer package. Only
:::
-![extension manager admin page](https://github.com/flarum/docs/assets/20267363/d0e1f7a5-e194-4acd-af63-7b8ddd95c26b)
+![extension manager admin page](./assets/extension-manager-page.png)
## Encontrando Extensiones
-Flarum tiene un amplio ecosistema de extensiones, la mayoría de las cuales son de código abierto y gratuitas. Para encontrar nuevas e increíbles extensiones, visita la etiqueta [Extensiones](https://discuss.flarum.org/t/extensions) en los foros de la comunidad de Flarum. La base de datos no oficial [Extiverse extension database](https://extiverse.com/) es también un gran recurso.
+Flarum tiene un amplio ecosistema de extensiones, la mayoría de las cuales son de código abierto y gratuitas. The extension manager provides a discovery feature allowing you to search through the available extensions. The extension manager connects to [flarum.org/extensions](https://flarum.org/extensions). Alternatively, you can visit the [Extensions](https://discuss.flarum.org/t/extensions) tag on Flarum's community forums.
## Instalación de Extensiones
@@ -35,14 +35,14 @@ Flarum tiene un amplio ecosistema de extensiones, la mayoría de las cuales son
Using the extension manager extension, you can install extensions directly from the admin dashboard. Once you have browsed the list of available extensions from the links above, and found one you want to install, you can install it by entering the extension's composer package name into the extension manager's installation input.
-![Installing an extension](/en/img/install-extension.png)
+![Installing an extension](./assets/install-extension.png)
### Through the command line
Al igual que Flarum, las extensiones se instalan a través de [Composer](https://getcomposer.org), usando SSH. Para instalar una extensión típica:
1. `cd` to your Flarum directory. `cd` a la carpeta que contiene el archivo `composer.json`. You can check directory contents via `ls -la`.
-2. Run `composer require COMPOSER_PACKAGE_NAME:*`. Esto debería ser proporcionado por la documentación de la extensión.
+2. Ejecute `composer require COMPOSER_PACKAGE_NAME`. Esto debería ser proporcionado por la documentación de la extensión.
## Gestión de Extensiones
@@ -50,7 +50,7 @@ Al igual que Flarum, las extensiones se instalan a través de [Composer](https:/
Using the extension manager extension, you can update extensions directly from the admin dashboard. You can run a check for updates by clicking the "Check for updates" button in the extension manager. If there are updates available, you can update all extensions by clicking the "Global update" button. Or, you can update individual extensions by clicking the "Update" button next to the extension you want to update.
-![Updating an extension](/en/img/update-extension.png)
+![Updating an extension](./assets/update-extension.png)
### Through the command line
@@ -62,7 +62,7 @@ Follow the instructions provided by extension developers. If you're using `*` as
Using the extension manager extension, you can uninstall extensions directly from the admin dashboard. You can uninstall an extension by clicking the "Uninstall" button next to the extension you want to uninstall inside the extension's page.
-![Uninstalling an extension](/en/img/uninstall-extension.png)
+![Uninstalling an extension](./assets/uninstall-extension.png)
### Through the command line
@@ -70,7 +70,7 @@ Similarly to installation, to remove an extension:
0. If you want to remove all database tables created by the extension, click the "Purge" button in the admin dashboard. See [below](#managing-extensions) for more information.
1. `cd` to your Flarum directory.
-2. Ejecute `composer require COMPOSER_PACKAGE_NAME`. Esto debería ser proporcionado por la documentación de la extensión.
+2. Run `composer require COMPOSER_PACKAGE_NAME:*`. Esto debería ser proporcionado por la documentación de la extensión.
## Managing Extensions
@@ -95,12 +95,12 @@ If you want to add a repository from a VCS (e.g. GitHub, GitLab, BitBucket, etc)
### Adding a composer repository
-Extiverse provides access to premium extensions. It is a good example of a composer repository. You would specify the URL as `https://flarum.org/composer/` and the name as `premium`. You would also need to enter an authentication method through the **New authentication method** button. The token can be generated from your Flarum account's [subscriptions](https://flarum.org/dashboard/subscriptions) page with the Instructions button.
+Extiverse provides access to premium extensions. It is a good example of a composer repository. You would also need to enter an authentication method through the **New authentication method** button. You would specify the URL as `https://flarum.org/composer/` and the name as `premium`. The token can be generated from your Flarum account's [subscriptions](https://flarum.org/dashboard/subscriptions) page with the Instructions button.
* Type: `HTTP Bearer`
* Host: `flarum.org`
-![Configure repositories](/en/img/config-repositories.png)
+![Configure repositories](./assets/config-repositories.png)
:::info
From 68e5b7c75baa3a94440b4d9b238d6b6116720293 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:27 -0500
Subject: [PATCH 022/477] New translations extensions.md (German)
---
.../current/extensions.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/extensions.md b/i18n/de/docusaurus-plugin-content-docs/current/extensions.md
index c99747d2b..b069ac656 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/extensions.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/extensions.md
@@ -22,12 +22,12 @@ The extension manager allows an admin user to install any composer package. Only
:::
-![extension manager admin page](https://github.com/flarum/docs/assets/20267363/d0e1f7a5-e194-4acd-af63-7b8ddd95c26b)
+![extension manager admin page](./assets/extension-manager-page.png)
## Erweiterungen finden
-Flarum verfügt über ein breites Ökosystem von Erweiterungen, von denen die meisten Open Source und kostenlos sind. Um neue und tolle Erweiterungen zu finden, besuche das [Extensions](https://discuss.flarum.org/t/extensions)-Tag in Flarums Community-Foren. Die inoffizielle [Extiverse Erweiterungsdatenbank](https://extiverse.com/) ist ebenfalls eine großartige Ressource.
+Flarum verfügt über ein breites Ökosystem von Erweiterungen, von denen die meisten Open Source und kostenlos sind. The extension manager provides a discovery feature allowing you to search through the available extensions. The extension manager connects to [flarum.org/extensions](https://flarum.org/extensions). Alternatively, you can visit the [Extensions](https://discuss.flarum.org/t/extensions) tag on Flarum's community forums.
## Erweiterungen installieren
@@ -35,7 +35,7 @@ Flarum verfügt über ein breites Ökosystem von Erweiterungen, von denen die me
Using the extension manager extension, you can install extensions directly from the admin dashboard. Once you have browsed the list of available extensions from the links above, and found one you want to install, you can install it by entering the extension's composer package name into the extension manager's installation input.
-![Installing an extension](/en/img/install-extension.png)
+![Installing an extension](./assets/install-extension.png)
### Through the command line
@@ -50,7 +50,7 @@ Genau wie Flarum werden Erweiterungen über [Composer](https://getcomposer.org)
Using the extension manager extension, you can update extensions directly from the admin dashboard. You can run a check for updates by clicking the "Check for updates" button in the extension manager. If there are updates available, you can update all extensions by clicking the "Global update" button. Or, you can update individual extensions by clicking the "Update" button next to the extension you want to update.
-![Updating an extension](/en/img/update-extension.png)
+![Updating an extension](./assets/update-extension.png)
### Through the command line
@@ -62,7 +62,7 @@ Anweisungen der Erweiterungsentwickler befolgen. Wenn Du `*` als Versionszeichen
Using the extension manager extension, you can uninstall extensions directly from the admin dashboard. You can uninstall an extension by clicking the "Uninstall" button next to the extension you want to uninstall inside the extension's page.
-![Uninstalling an extension](/en/img/uninstall-extension.png)
+![Uninstalling an extension](./assets/uninstall-extension.png)
### Through the command line
@@ -95,12 +95,12 @@ If you want to add a repository from a VCS (e.g. GitHub, GitLab, BitBucket, etc)
### Adding a composer repository
-Extiverse provides access to premium extensions. It is a good example of a composer repository. You would specify the URL as `https://flarum.org/composer/` and the name as `premium`. You would also need to enter an authentication method through the **New authentication method** button. The token can be generated from your Flarum account's [subscriptions](https://flarum.org/dashboard/subscriptions) page with the Instructions button.
+Extiverse provides access to premium extensions. It is a good example of a composer repository. You would also need to enter an authentication method through the **New authentication method** button. You would specify the URL as `https://flarum.org/composer/` and the name as `premium`. The token can be generated from your Flarum account's [subscriptions](https://flarum.org/dashboard/subscriptions) page with the Instructions button.
* Type: `HTTP Bearer`
* Host: `flarum.org`
-![Configure repositories](/en/img/config-repositories.png)
+![Configure repositories](./assets/config-repositories.png)
:::info
From bf92f291d288a0d0effc6f98d1e236f2d9bd20c5 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:28 -0500
Subject: [PATCH 023/477] New translations extensions.md (Italian)
---
.../current/extensions.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/extensions.md b/i18n/it/docusaurus-plugin-content-docs/current/extensions.md
index 36868caa1..6bf000a71 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/extensions.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/extensions.md
@@ -22,12 +22,12 @@ The extension manager allows an admin user to install any composer package. Only
:::
-![extension manager admin page](https://github.com/flarum/docs/assets/20267363/d0e1f7a5-e194-4acd-af63-7b8ddd95c26b)
+![extension manager admin page](./assets/extension-manager-page.png)
## Trovare le estensioni
-Flarum ha un vasto ecosistema di estensioni, molte delle quali sono open source è grautie. Per trovare nuove e fantastiche estensioni, visita il tag [Estensioni](https://discuss.flarum.org/t/extensions) sul forum ufficiale di Flarum. Il non ufficiale [Database estensioni Extiverse](https://extiverse.com/) è anch'esso una valida alternativa.
+Flarum ha un vasto ecosistema di estensioni, molte delle quali sono open source è grautie. The extension manager provides a discovery feature allowing you to search through the available extensions. The extension manager connects to [flarum.org/extensions](https://flarum.org/extensions). Alternatively, you can visit the [Extensions](https://discuss.flarum.org/t/extensions) tag on Flarum's community forums.
## Installare le estensioni
@@ -35,7 +35,7 @@ Flarum ha un vasto ecosistema di estensioni, molte delle quali sono open source
Using the extension manager extension, you can install extensions directly from the admin dashboard. Once you have browsed the list of available extensions from the links above, and found one you want to install, you can install it by entering the extension's composer package name into the extension manager's installation input.
-![Installing an extension](/en/img/install-extension.png)
+![Installing an extension](./assets/install-extension.png)
### Through the command line
@@ -50,7 +50,7 @@ Proprio come Flarum, le estensioni vengono installate tramite [Composer](https:/
Using the extension manager extension, you can update extensions directly from the admin dashboard. You can run a check for updates by clicking the "Check for updates" button in the extension manager. If there are updates available, you can update all extensions by clicking the "Global update" button. Or, you can update individual extensions by clicking the "Update" button next to the extension you want to update.
-![Updating an extension](/en/img/update-extension.png)
+![Updating an extension](./assets/update-extension.png)
### Through the command line
@@ -62,7 +62,7 @@ Seguire le istruzioni fornite dagli sviluppatori di estensioni. Se stai usando `
Using the extension manager extension, you can uninstall extensions directly from the admin dashboard. You can uninstall an extension by clicking the "Uninstall" button next to the extension you want to uninstall inside the extension's page.
-![Uninstalling an extension](/en/img/uninstall-extension.png)
+![Uninstalling an extension](./assets/uninstall-extension.png)
### Through the command line
@@ -95,12 +95,12 @@ If you want to add a repository from a VCS (e.g. GitHub, GitLab, BitBucket, etc)
### Adding a composer repository
-Extiverse provides access to premium extensions. It is a good example of a composer repository. You would specify the URL as `https://flarum.org/composer/` and the name as `premium`. You would also need to enter an authentication method through the **New authentication method** button. The token can be generated from your Flarum account's [subscriptions](https://flarum.org/dashboard/subscriptions) page with the Instructions button.
+Extiverse provides access to premium extensions. It is a good example of a composer repository. You would also need to enter an authentication method through the **New authentication method** button. You would specify the URL as `https://flarum.org/composer/` and the name as `premium`. The token can be generated from your Flarum account's [subscriptions](https://flarum.org/dashboard/subscriptions) page with the Instructions button.
* Type: `HTTP Bearer`
* Host: `flarum.org`
-![Configure repositories](/en/img/config-repositories.png)
+![Configure repositories](./assets/config-repositories.png)
:::info
From d6f8091ab228bd6ed733625a5a787b8408576c08 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:30 -0500
Subject: [PATCH 024/477] New translations extensions.md (Turkish)
---
.../current/extensions.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/extensions.md b/i18n/tr/docusaurus-plugin-content-docs/current/extensions.md
index 9e6adb27c..a83ca627b 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/extensions.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/extensions.md
@@ -22,12 +22,12 @@ Uzantı yöneticisi, yönetici kullanıcının herhangi bir besteci paketini yü
:::
-![uzantı yöneticisi yönetici sayfası](https://github.com/flarum/docs/assets/20267363/d0e1f7a5-e194-4acd-af63-7b8ddd95c26b)
+![uzantı yöneticisi yönetici sayfası](./assets/extension-manager-page.png)
## Uzantıları Bulmak
-Flarum, çoğu açık kaynaklı ve ücretsiz olan geniş bir uzantı ekosistemine sahiptir. Yeni ve harika uzantılar bulmak için, Flarum'un topluluk forumundaki [Extensions](https://discuss.flarum.org/t/extensions) etiketini ziyaret edin. Resmi olmayan [Extiverse](https://extiverse.com/) de harika bir kaynaktır.
+Flarum, çoğu açık kaynaklı ve ücretsiz olan geniş bir uzantı ekosistemine sahiptir. The extension manager provides a discovery feature allowing you to search through the available extensions. The extension manager connects to [flarum.org/extensions](https://flarum.org/extensions). Alternatively, you can visit the [Extensions](https://discuss.flarum.org/t/extensions) tag on Flarum's community forums.
## Uzantıları Yükleme
@@ -35,7 +35,7 @@ Flarum, çoğu açık kaynaklı ve ücretsiz olan geniş bir uzantı ekosistemin
Uzantı yöneticisi uzantısını kullanarak uzantıları doğrudan yönetici kontrol panelinden yükleyebilirsiniz. Yukarıdaki bağlantılardan mevcut uzantıların listesine göz attığınızda ve yüklemek istediğiniz uzantıyı bulduğunuzda, uzantı yöneticisinin kurulum girişine uzantının besteci paketi adını girerek yükleyebilirsiniz.
-![Installing an extension](/en/img/install-extension.png)
+![Installing an extension](./assets/install-extension.png)
### Komut satırı aracılığıyla
@@ -50,7 +50,7 @@ Flarum gibi, uzantılar da SSH kullanılarak [Composer](https://getcomposer.org)
Uzantı yöneticisi uzantısını kullanarak uzantıları doğrudan yönetici kontrol panelinden güncelleyebilirsiniz. Uzantı yöneticisindeki "Güncellemeleri kontrol et" düğmesini tıklayarak güncellemeleri kontrol edebilirsiniz. Güncellemeler mevcutsa, "Global güncelleme" butonuna tıklayarak tüm uzantıları güncelleyebilirsiniz. Veya güncellemek istediğiniz uzantının yanındaki "Güncelle" butonuna tıklayarak uzantıları tek tek güncelleyebilirsiniz.
-![Updating an extension](/en/img/update-extension.png)
+![Updating an extension](./assets/update-extension.png)
### Komut satırı aracılığıyla
@@ -62,7 +62,7 @@ Uzantı geliştiricileri tarafından sağlanan talimatları izleyin. Uzantılar
Uzantı yöneticisi uzantısını kullanarak uzantıları doğrudan yönetici kontrol panelinden yükleyebilirsiniz. Uzantının sayfasında, kaldırmak istediğiniz uzantının yanındaki "Kaldır" düğmesini tıklayarak bir uzantıyı kaldırabilirsiniz.
-![Uninstalling an extension](/en/img/uninstall-extension.png)
+![Uninstalling an extension](./assets/uninstall-extension.png)
### Komut satırı aracılığıyla
@@ -95,12 +95,12 @@ If you want to add a repository from a VCS (e.g. GitHub, GitLab, BitBucket, etc)
### Adding a composer repository
-Extiverse provides access to premium extensions. It is a good example of a composer repository. You would specify the URL as `https://flarum.org/composer/` and the name as `premium`. You would also need to enter an authentication method through the **New authentication method** button. The token can be generated from your Flarum account's [subscriptions](https://flarum.org/dashboard/subscriptions) page with the Instructions button.
+Extiverse provides access to premium extensions. It is a good example of a composer repository. You would also need to enter an authentication method through the **New authentication method** button. You would specify the URL as `https://flarum.org/composer/` and the name as `premium`. The token can be generated from your Flarum account's [subscriptions](https://flarum.org/dashboard/subscriptions) page with the Instructions button.
* Type: `HTTP Bearer`
* Host: `flarum.org`
-![Configure repositories](/en/img/config-repositories.png)
+![Configure repositories](./assets/config-repositories.png)
:::bilgi
From df07ca4b68a269e1db8e47540b99a2c0d17598c9 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:31 -0500
Subject: [PATCH 025/477] New translations extensions.md (Chinese Simplified)
---
.../current/extensions.md | 38 +++++++++----------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/extensions.md b/i18n/zh/docusaurus-plugin-content-docs/current/extensions.md
index e313c9549..7630f62a8 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/extensions.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/extensions.md
@@ -8,7 +8,7 @@ Flarum 是简约的,同时也是高度可扩展的。 实际上,Flarum 附
## Extension Manager
-The extension manager is an extension that comes bundled with Flarum when installed via an archive. It provides a graphical interface for installing and updating both extensions and Flarum itself.
+The extension manager is an extension that comes bundled with Flarum when installed via an archive. It provides a graphical interface for installing and updating both extensions and Flarum itself. It provides a graphical interface for installing and updating both extensions and Flarum itself.
If you do not have the extension manager installed and you wish to install it, you can do so by running the following command in your Flarum directory:
@@ -18,39 +18,39 @@ composer require flarum/extension-manager:"*"
:::warning
-The extension manager allows an admin user to install any composer package. Only install the extension manager if you trust all of your forum admins with such permissions.
+The extension manager allows an admin user to install any composer package. Only install the extension manager if you trust all of your forum admins with such permissions. Only install the extension manager if you trust all of your forum admins with such permissions.
:::
-![extension manager admin page](https://github.com/flarum/docs/assets/20267363/d0e1f7a5-e194-4acd-af63-7b8ddd95c26b)
+![extension manager admin page](./assets/extension-manager-page.png)
## 寻找扩展
-Flarum 有一个广泛的扩展生态系统,其中大部分是开源和免费的。 要想找到新的超棒的扩展,请访问 Flarum 社区论坛上的 [扩展](https://discuss.flarum.org/t/extensions) 标签。 非官方的 [Extiverse 扩展数据库](https://extiverse.com/) 也是一个好地方。
+Flarum 有一个广泛的扩展生态系统,其中大部分是开源和免费的。 The extension manager provides a discovery feature allowing you to search through the available extensions. The extension manager connects to [flarum.org/extensions](https://flarum.org/extensions). Alternatively, you can visit the [Extensions](https://discuss.flarum.org/t/extensions) tag on Flarum's community forums.
## 安装扩展
### Through the interface
-Using the extension manager extension, you can install extensions directly from the admin dashboard. Once you have browsed the list of available extensions from the links above, and found one you want to install, you can install it by entering the extension's composer package name into the extension manager's installation input.
+Using the extension manager extension, you can install extensions directly from the admin dashboard. Using the extension manager extension, you can install extensions directly from the admin dashboard. Once you have browsed the list of available extensions from the links above, and found one you want to install, you can install it by entering the extension's composer package name into the extension manager's installation input.
-![Installing an extension](/en/img/install-extension.png)
+![Installing an extension](./assets/install-extension.png)
### Through the command line
与 Flarum 一样,扩展是使用 SSH 通过 [Composer](https://getcomposer.org) 安装的。 要安装一个典型的扩展:
-1. `cd` to your Flarum directory. `cd` 到 `composer.json` 所在文件夹。 您可以通过 `ls -la` 查看目录下的文件。
-2. 运行 `composer require COMPOSER_PACKAGE_NAME:*`. 具体安装命令一般可在扩展的文档中找到。
+1. `cd` to your Flarum directory. `cd` 到 `composer.json` 所在文件夹。 `cd` 到 `composer.json` 所在文件夹。 您可以通过 `ls -la` 查看目录下的文件。
+2. 运行 `composer require COMPOSER_PACKAGE_NAME:*`. 具体安装命令一般可在扩展的文档中找到。 具体安装命令一般可在扩展的文档中找到。
## 管理扩展
### Through the interface
-Using the extension manager extension, you can update extensions directly from the admin dashboard. You can run a check for updates by clicking the "Check for updates" button in the extension manager. If there are updates available, you can update all extensions by clicking the "Global update" button. Or, you can update individual extensions by clicking the "Update" button next to the extension you want to update.
+Using the extension manager extension, you can update extensions directly from the admin dashboard. Using the extension manager extension, you can update extensions directly from the admin dashboard. You can run a check for updates by clicking the "Check for updates" button in the extension manager. If there are updates available, you can update all extensions by clicking the "Global update" button. Or, you can update individual extensions by clicking the "Update" button next to the extension you want to update. If there are updates available, you can update all extensions by clicking the "Global update" button. Or, you can update individual extensions by clicking the "Update" button next to the extension you want to update.
-![Updating an extension](/en/img/update-extension.png)
+![Updating an extension](./assets/update-extension.png)
### Through the command line
@@ -60,21 +60,21 @@ Using the extension manager extension, you can update extensions directly from t
### Through the interface
-Using the extension manager extension, you can uninstall extensions directly from the admin dashboard. You can uninstall an extension by clicking the "Uninstall" button next to the extension you want to uninstall inside the extension's page.
+Using the extension manager extension, you can uninstall extensions directly from the admin dashboard. Using the extension manager extension, you can uninstall extensions directly from the admin dashboard. You can uninstall an extension by clicking the "Uninstall" button next to the extension you want to uninstall inside the extension's page.
-![Uninstalling an extension](/en/img/uninstall-extension.png)
+![Uninstalling an extension](./assets/uninstall-extension.png)
### Through the command line
类似安装的步骤,若要移除扩展:
0. 如果你想移除由扩展创建的所有数据库表,请在管理员仪表板中点击"重置"按钮。 更多信息[见下](#managing-extensions)。
-1. `cd` to your Flarum directory.
+1. `cd` to your Flarum directory. `cd` 到 `composer.json` 所在文件夹。
2. 运行 `composer require COMPOSER_包名`。 具体安装命令一般可在扩展的文档中找到。
## 管理扩展
-Each individual extension page of the admin dashboard provides a convenient way to manage the extension. 您可以:
+Each individual extension page of the admin dashboard provides a convenient way to manage the extension. 您可以: 您可以:
- Enable or disable the extension.
- See the settings provided by the extension, and change them.
@@ -85,13 +85,13 @@ Each individual extension page of the admin dashboard provides a convenient way
## Configuring additional extension repository sources
-The extension manager uses `composer` under the hood, and as such, it looks for extension packages in the same places as `composer`. By default, this is [Packagist](https://packagist.org/). However, you can configure additional sources for the extension manager to look for extensions in. This is useful if you want to install an extension that is not available on Packagist.
+The extension manager uses `composer` under the hood, and as such, it looks for extension packages in the same places as `composer`. By default, this is [Packagist](https://packagist.org/). However, you can configure additional sources for the extension manager to look for extensions in. This is useful if you want to install an extension that is not available on Packagist. By default, this is [Packagist](https://packagist.org/). However, you can configure additional sources for the extension manager to look for extensions in. This is useful if you want to install an extension that is not available on Packagist.
-In the admin page of the extension manager, clicking the **Add Repository** button will open a modal where you can enter the name and URL of the repository you want to add. The name is just a label for the repository, and can be anything you want. The URL should be the URL of the repository which depends on the type of repository you want to add.
+In the admin page of the extension manager, clicking the **Add Repository** button will open a modal where you can enter the name and URL of the repository you want to add. The name is just a label for the repository, and can be anything you want. The URL should be the URL of the repository which depends on the type of repository you want to add. The name is just a label for the repository, and can be anything you want. The URL should be the URL of the repository which depends on the type of repository you want to add.
### Adding a repository from a VCS
-If you want to add a repository from a VCS (e.g. GitHub, GitLab, BitBucket, etc), the URL should be the URL of the repository's VCS. For example, if you had a private GitHub repository at `https://github.com/acme/flarum-extension`, you would enter that URL into the URL field. If it is a private source, you will need to enter an authentication method through the **New authentication method** button. The token can be generated from your VCS provider's website, and the host should be the domain of the VCS provider (e.g. `github.com`).
+If you want to add a repository from a VCS (e.g. GitHub, GitLab, BitBucket, etc), the URL should be the URL of the repository's VCS. For example, if you had a private GitHub repository at `https://github.com/acme/flarum-extension`, you would enter that URL into the URL field. If it is a private source, you will need to enter an authentication method through the **New authentication method** button. The token can be generated from your VCS provider's website, and the host should be the domain of the VCS provider (e.g. `github.com`). For example, if you had a private GitHub repository at `https://github.com/acme/flarum-extension`, you would enter that URL into the URL field. If it is a private source, you will need to enter an authentication method through the **New authentication method** button. The token can be generated from your VCS provider's website, and the host should be the domain of the VCS provider (e.g. `github.com`).
### Adding a composer repository
@@ -100,11 +100,11 @@ Extiverse provides access to premium extensions. It is a good example of a compo
* Type: `HTTP Bearer`
* Host: `flarum.org`
-![Configure repositories](/en/img/config-repositories.png)
+![Configure repositories](./assets/config-repositories.png)
:::info
-The configured repositories and auth methods will be active for both the command line and the admin dashboard. If you configure them from the command line however, you must not include the flag `--global`.
+The configured repositories and auth methods will be active for both the command line and the admin dashboard. If you configure them from the command line however, you must not include the flag `--global`. If you configure them from the command line however, you must not include the flag `--global`.
:::
From 0904657972bf6e4d66e11398242fd8163e7bf3ed Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:32 -0500
Subject: [PATCH 026/477] New translations install.md (Spanish)
---
.../current/install.md | 44 +++++++------------
1 file changed, 16 insertions(+), 28 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/install.md b/i18n/es/docusaurus-plugin-content-docs/current/install.md
index 999fc3478..a6239311f 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/install.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/install.md
@@ -11,42 +11,30 @@ No dude en probar Flarum en uno de nuestros [foros de demostración](https://dis
Antes de instalar Flarum, es importante comprobar que tu servidor cumple los requisitos. Para ejecutar Flarum, necesitarás:
* **Apache** (con mod\_rewrite activado) o **Nginx**.
-* **PHP 7.3+** with the following extensions: curl, dom, fileinfo, gd, json, mbstring, openssl, pdo\_mysql, tokenizer, zip
-* **MySQL 5.6+** o **MariaDB 10.0.5+**
+* **PHP 8.2+** with the following extensions: curl, dom, fileinfo, gd, json, mbstring, openssl, pdo\_mysql, tokenizer, zip
+* **One of the following databases**:
+ * MySQL 5.7+ / 8.0.30+
+ * MariaDB 10.3+
+ * SQLite 3.35.0+
+ * PostgreSQL 10.0+
* **SSH (command-line) access** to run potentially necessary software maintenance commands, and Composer if you intend on using the command-line to install and manage Flarum extensions.
## Instalando
### Installing by unpacking an archive
-If you don't have SSH access to your server or you prefer not to use the command line, you can install Flarum by unpacking an archive. Below is a list of the available archives, make sure you choose the one that matches your PHP version and public path or lack thereof preference.
+If you don't have SSH access to your server, or you prefer not to use the command line, you can install Flarum by unpacking an archive. Below is a list of the available archives, make sure you choose the one that matches your PHP version and public path or lack thereof preference.
| Flarum Version | PHP Version | Public Path | Type | Archive |
| -------------- | ----------------- | ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 1.x | 8.3 (recommended) | No | ZIP | [flarum-v1.x-no-public-dir-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.3.zip) |
-| 1.x | 8.3 (recommended) | Yes | TAR.GZ | [flarum-v1.x-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.3.tar.gz) |
-| 1.x | 8.3 (recommended) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.3.tar.gz) |
-| 1.x | 8.3 (recommended) | Yes | ZIP | [flarum-v1.x-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.3.zip) |
-| 1.x | 8.2 (recommended) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.2.tar.gz) |
-| 1.x | 8.2 (recommended) | Yes | TAR.GZ | [flarum-v1.x-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.2.tar.gz) |
-| 1.x | 8.2 (recommended) | No | ZIP | [flarum-v1.x-no-public-dir-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.2.zip) |
-| 1.x | 8.2 (recommended) | Yes | ZIP | [flarum-v1.x-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.2.zip) |
-| 1.x | 8.1 | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.1.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.1.tar.gz) |
-| 1.x | 8.1 | Yes | TAR.GZ | [flarum-v1.x-php8.1.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.1.tar.gz) |
-| 1.x | 8.1 | No | ZIP | [flarum-v1.x-no-public-dir-php8.1.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.1.zip) |
-| 1.x | 8.1 | Yes | ZIP | [flarum-v1.x-php8.1.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.1.zip) |
-| 1.x | 8.0 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.0.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.0.tar.gz) |
-| 1.x | 8.0 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php8.0.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.0.tar.gz) |
-| 1.x | 8.0 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php8.0.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.0.zip) |
-| 1.x | 8.0 (end of life) | Yes | ZIP | [flarum-v1.x-php8.0.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.0.zip) |
-| 1.x | 7.4 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php7.4.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.4.tar.gz) |
-| 1.x | 7.4 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php7.4.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.4.tar.gz) |
-| 1.x | 7.4 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php7.4.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.4.zip) |
-| 1.x | 7.4 (end of life) | Yes | ZIP | [flarum-v1.x-php7.4.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.4.zip) |
-| 1.x | 7.3 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php7.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.3.tar.gz) |
-| 1.x | 7.3 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php7.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.3.tar.gz) |
-| 1.x | 7.3 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php7.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.3.zip) |
-| 1.x | 7.3 (end of life) | Yes | ZIP | [flarum-v1.x-php7.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.3.zip) |
+| 2.x | 8.3 (recommended) | No | ZIP | [flarum-v2.x-no-public-dir-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.3.zip) |
+| 2.x | 8.3 (recommended) | Yes | TAR.GZ | [flarum-v2.x-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.3.tar.gz) |
+| 2.x | 8.3 (recommended) | No | TAR.GZ | [flarum-v2.x-no-public-dir-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.3.tar.gz) |
+| 2.x | 8.3 (recommended) | Yes | ZIP | [flarum-v2.x-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.3.zip) |
+| 2.x | 8.2 (recommended) | No | TAR.GZ | [flarum-v2.x-no-public-dir-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.2.tar.gz) |
+| 2.x | 8.2 (recommended) | Yes | TAR.GZ | [flarum-v2.x-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.2.tar.gz) |
+| 2.x | 8.2 (recommended) | No | ZIP | [flarum-v2.x-no-public-dir-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.2.zip) |
+| 2.x | 8.2 (recommended) | Yes | ZIP | [flarum-v2.x-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.2.zip) |
### Installing using the Command Line Interface
@@ -114,7 +102,7 @@ www.example.com {
```
## Propiedad de la Carpeta
-Durante la instalación, Flarum puede solicitar que se permita la escritura en ciertos directorios. Modern operating systems are generally multi-user, meaning that the user you log in as is not the same as the user Flarum is running as. The user that Flarum is running as MUST have read + write access to:
+Durante la instalación, Flarum puede solicitar que se permita la escritura en ciertos directorios. The user that Flarum is running as MUST have read + write access to: Modern operating systems are generally multi-user, meaning that the user you log in as is not the same as the user Flarum is running as.
- The root install directory, so Flarum can edit `config.php`.
- The `storage` subdirectory, so Flarum can edit logs and store cached data.
From 28095e4fc74c1a8e1028f85a6354c651ec37f9f3 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:33 -0500
Subject: [PATCH 027/477] New translations install.md (German)
---
.../current/install.md | 44 +++++++------------
1 file changed, 16 insertions(+), 28 deletions(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/install.md b/i18n/de/docusaurus-plugin-content-docs/current/install.md
index 0de5ebd94..e28d7973d 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/install.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/install.md
@@ -11,42 +11,30 @@ Fühle Dich frei, Flarum in einem unserer [Demonstrationsforen](https://discuss.
Before you install Flarum, it's important to check that your server meets the requirements. Um Flarum ausführen zu können, brauchst du:
* **Apache** (with mod\_rewrite enabled) or **Nginx**
-* **PHP 7.3+** with the following extensions: curl, dom, fileinfo, gd, json, mbstring, openssl, pdo\_mysql, tokenizer, zip
-* **MySQL 5.6+/8.0.23+** or **MariaDB 10.0.5+**
+* **PHP 8.2+** with the following extensions: curl, dom, fileinfo, gd, json, mbstring, openssl, pdo\_mysql, tokenizer, zip
+* **One of the following databases**:
+ * MySQL 5.7+ / 8.0.30+
+ * MariaDB 10.3+
+ * SQLite 3.35.0+
+ * PostgreSQL 10.0+
* **SSH (command-line) access** to run potentially necessary software maintenance commands, and Composer if you intend on using the command-line to install and manage Flarum extensions.
## Installieren
### Installing by unpacking an archive
-If you don't have SSH access to your server or you prefer not to use the command line, you can install Flarum by unpacking an archive. Below is a list of the available archives, make sure you choose the one that matches your PHP version and public path or lack thereof preference.
+If you don't have SSH access to your server, or you prefer not to use the command line, you can install Flarum by unpacking an archive. Below is a list of the available archives, make sure you choose the one that matches your PHP version and public path or lack thereof preference.
| Flarum Version | PHP Version | Public Path | Type | Archive |
| -------------- | ----------------- | ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 1.x | 8.3 (recommended) | No | ZIP | [flarum-v1.x-no-public-dir-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.3.zip) |
-| 1.x | 8.3 (recommended) | Yes | TAR.GZ | [flarum-v1.x-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.3.tar.gz) |
-| 1.x | 8.3 (recommended) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.3.tar.gz) |
-| 1.x | 8.3 (recommended) | Yes | ZIP | [flarum-v1.x-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.3.zip) |
-| 1.x | 8.2 (recommended) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.2.tar.gz) |
-| 1.x | 8.2 (recommended) | Yes | TAR.GZ | [flarum-v1.x-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.2.tar.gz) |
-| 1.x | 8.2 (recommended) | No | ZIP | [flarum-v1.x-no-public-dir-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.2.zip) |
-| 1.x | 8.2 (recommended) | Yes | ZIP | [flarum-v1.x-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.2.zip) |
-| 1.x | 8.1 | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.1.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.1.tar.gz) |
-| 1.x | 8.1 | Yes | TAR.GZ | [flarum-v1.x-php8.1.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.1.tar.gz) |
-| 1.x | 8.1 | No | ZIP | [flarum-v1.x-no-public-dir-php8.1.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.1.zip) |
-| 1.x | 8.1 | Yes | ZIP | [flarum-v1.x-php8.1.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.1.zip) |
-| 1.x | 8.0 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.0.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.0.tar.gz) |
-| 1.x | 8.0 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php8.0.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.0.tar.gz) |
-| 1.x | 8.0 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php8.0.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.0.zip) |
-| 1.x | 8.0 (end of life) | Yes | ZIP | [flarum-v1.x-php8.0.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.0.zip) |
-| 1.x | 7.4 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php7.4.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.4.tar.gz) |
-| 1.x | 7.4 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php7.4.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.4.tar.gz) |
-| 1.x | 7.4 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php7.4.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.4.zip) |
-| 1.x | 7.4 (end of life) | Yes | ZIP | [flarum-v1.x-php7.4.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.4.zip) |
-| 1.x | 7.3 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php7.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.3.tar.gz) |
-| 1.x | 7.3 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php7.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.3.tar.gz) |
-| 1.x | 7.3 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php7.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.3.zip) |
-| 1.x | 7.3 (end of life) | Yes | ZIP | [flarum-v1.x-php7.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.3.zip) |
+| 2.x | 8.3 (recommended) | No | ZIP | [flarum-v2.x-no-public-dir-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.3.zip) |
+| 2.x | 8.3 (recommended) | Yes | TAR.GZ | [flarum-v2.x-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.3.tar.gz) |
+| 2.x | 8.3 (recommended) | No | TAR.GZ | [flarum-v2.x-no-public-dir-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.3.tar.gz) |
+| 2.x | 8.3 (recommended) | Yes | ZIP | [flarum-v2.x-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.3.zip) |
+| 2.x | 8.2 (recommended) | No | TAR.GZ | [flarum-v2.x-no-public-dir-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.2.tar.gz) |
+| 2.x | 8.2 (recommended) | Yes | TAR.GZ | [flarum-v2.x-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.2.tar.gz) |
+| 2.x | 8.2 (recommended) | No | ZIP | [flarum-v2.x-no-public-dir-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.2.zip) |
+| 2.x | 8.2 (recommended) | Yes | ZIP | [flarum-v2.x-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.2.zip) |
### Installing using the Command Line Interface
@@ -114,7 +102,7 @@ www.example.com {
```
## Folder Ownership
-During installation, Flarum may request that you make certain directories writable. Modern operating systems are generally multi-user, meaning that the user you log in as is not the same as the user Flarum is running as. The user that Flarum is running as MUST have read + write access to:
+During installation, Flarum may request that you make certain directories writable. The user that Flarum is running as MUST have read + write access to: Modern operating systems are generally multi-user, meaning that the user you log in as is not the same as the user Flarum is running as.
- The root install directory, so Flarum can edit `config.php`.
- The `storage` subdirectory, so Flarum can edit logs and store cached data.
From dd66308cc341c1e98ffbba83444a1f8d8f6d8b5b Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:34 -0500
Subject: [PATCH 028/477] New translations install.md (Italian)
---
.../current/install.md | 44 +++++++------------
1 file changed, 16 insertions(+), 28 deletions(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/install.md b/i18n/it/docusaurus-plugin-content-docs/current/install.md
index 1f727ad95..ce7ee91c1 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/install.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/install.md
@@ -11,42 +11,30 @@ Fatti un giro sul nostro [forum di dimostrazione](https://discuss.flarum.org/d/2
Prima di installare Flarum, è importante verificare che il tuo server soddisfi i requisiti. Per eseguire Flarum, avrai bisogno di:
* **Apache** (con mod\_rewrite abilitato) o **Nginx**
-* **PHP 7.3+** with the following extensions: curl, dom, fileinfo, gd, json, mbstring, openssl, pdo\_mysql, tokenizer, zip
-* **MySQL 5.6+** o **MariaDB 10.0.5+**
+* **PHP 8.2+** with the following extensions: curl, dom, fileinfo, gd, json, mbstring, openssl, pdo\_mysql, tokenizer, zip
+* **One of the following databases**:
+ * MySQL 5.7+ / 8.0.30+
+ * MariaDB 10.3+
+ * SQLite 3.35.0+
+ * PostgreSQL 10.0+
* **SSH (command-line) access** to run potentially necessary software maintenance commands, and Composer if you intend on using the command-line to install and manage Flarum extensions.
## Installare Flarum
### Installing by unpacking an archive
-If you don't have SSH access to your server or you prefer not to use the command line, you can install Flarum by unpacking an archive. Below is a list of the available archives, make sure you choose the one that matches your PHP version and public path or lack thereof preference.
+If you don't have SSH access to your server, or you prefer not to use the command line, you can install Flarum by unpacking an archive. Below is a list of the available archives, make sure you choose the one that matches your PHP version and public path or lack thereof preference.
| Flarum Version | PHP Version | Public Path | Type | Archive |
| -------------- | ----------------- | ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 1.x | 8.3 (recommended) | No | ZIP | [flarum-v1.x-no-public-dir-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.3.zip) |
-| 1.x | 8.3 (recommended) | Yes | TAR.GZ | [flarum-v1.x-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.3.tar.gz) |
-| 1.x | 8.3 (recommended) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.3.tar.gz) |
-| 1.x | 8.3 (recommended) | Yes | ZIP | [flarum-v1.x-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.3.zip) |
-| 1.x | 8.2 (recommended) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.2.tar.gz) |
-| 1.x | 8.2 (recommended) | Yes | TAR.GZ | [flarum-v1.x-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.2.tar.gz) |
-| 1.x | 8.2 (recommended) | No | ZIP | [flarum-v1.x-no-public-dir-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.2.zip) |
-| 1.x | 8.2 (recommended) | Yes | ZIP | [flarum-v1.x-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.2.zip) |
-| 1.x | 8.1 | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.1.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.1.tar.gz) |
-| 1.x | 8.1 | Yes | TAR.GZ | [flarum-v1.x-php8.1.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.1.tar.gz) |
-| 1.x | 8.1 | No | ZIP | [flarum-v1.x-no-public-dir-php8.1.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.1.zip) |
-| 1.x | 8.1 | Yes | ZIP | [flarum-v1.x-php8.1.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.1.zip) |
-| 1.x | 8.0 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.0.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.0.tar.gz) |
-| 1.x | 8.0 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php8.0.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.0.tar.gz) |
-| 1.x | 8.0 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php8.0.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.0.zip) |
-| 1.x | 8.0 (end of life) | Yes | ZIP | [flarum-v1.x-php8.0.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.0.zip) |
-| 1.x | 7.4 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php7.4.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.4.tar.gz) |
-| 1.x | 7.4 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php7.4.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.4.tar.gz) |
-| 1.x | 7.4 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php7.4.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.4.zip) |
-| 1.x | 7.4 (end of life) | Yes | ZIP | [flarum-v1.x-php7.4.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.4.zip) |
-| 1.x | 7.3 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php7.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.3.tar.gz) |
-| 1.x | 7.3 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php7.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.3.tar.gz) |
-| 1.x | 7.3 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php7.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.3.zip) |
-| 1.x | 7.3 (end of life) | Yes | ZIP | [flarum-v1.x-php7.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.3.zip) |
+| 2.x | 8.3 (recommended) | No | ZIP | [flarum-v2.x-no-public-dir-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.3.zip) |
+| 2.x | 8.3 (recommended) | Yes | TAR.GZ | [flarum-v2.x-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.3.tar.gz) |
+| 2.x | 8.3 (recommended) | No | TAR.GZ | [flarum-v2.x-no-public-dir-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.3.tar.gz) |
+| 2.x | 8.3 (recommended) | Yes | ZIP | [flarum-v2.x-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.3.zip) |
+| 2.x | 8.2 (recommended) | No | TAR.GZ | [flarum-v2.x-no-public-dir-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.2.tar.gz) |
+| 2.x | 8.2 (recommended) | Yes | TAR.GZ | [flarum-v2.x-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.2.tar.gz) |
+| 2.x | 8.2 (recommended) | No | ZIP | [flarum-v2.x-no-public-dir-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.2.zip) |
+| 2.x | 8.2 (recommended) | Yes | ZIP | [flarum-v2.x-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.2.zip) |
### Installing using the Command Line Interface
@@ -114,7 +102,7 @@ www.example.com {
```
## Proprietà della cartella
-Durante l'installazione, Flarum potrebbe richiedere di rendere scrivibili alcune directory. Modern operating systems are generally multi-user, meaning that the user you log in as is not the same as the user Flarum is running as. The user that Flarum is running as MUST have read + write access to:
+Durante l'installazione, Flarum potrebbe richiedere di rendere scrivibili alcune directory. The user that Flarum is running as MUST have read + write access to: Modern operating systems are generally multi-user, meaning that the user you log in as is not the same as the user Flarum is running as.
- The root install directory, so Flarum can edit `config.php`.
- The `storage` subdirectory, so Flarum can edit logs and store cached data.
From a79c7d2cecc356f10011b01b1737c8740e19d454 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:35 -0500
Subject: [PATCH 029/477] New translations install.md (Turkish)
---
.../current/install.md | 42 +++++++------------
1 file changed, 15 insertions(+), 27 deletions(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/install.md b/i18n/tr/docusaurus-plugin-content-docs/current/install.md
index ca61cd0c4..f25849d56 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/install.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/install.md
@@ -11,42 +11,30 @@ Flarum'u [gösteri forumlarımızdan](https://discuss.flarum.org/d/21101) birind
Flarum'u kurmadan önce, sunucunuzun gereksinimleri karşılayıp karşılamadığını kontrol etmeniz önemlidir. Flarum'u çalıştırmak için şunlara ihtiyacınız olacak:
* **Apache** (mod_rewrite etkin) veya **Nginx**
-* **PHP 7.3+** şu uzantılara sahip: curl, dom, fileinfo, gd, json, mbstring, openssl, pdo\_mysql, tokenizer, zip
-* **MySQL 5.6+/8.0.23+** veya **MariaDB10.0.5+** Composer'ı çalıştırmak için **SSH (komut satırı) erişimi**
+* **PHP 8.2+** with the following extensions: curl, dom, fileinfo, gd, json, mbstring, openssl, pdo\_mysql, tokenizer, zip
+* **One of the following databases**:
+ * MySQL 5.7+ / 8.0.30+
+ * MariaDB 10.3+
+ * SQLite 3.35.0+
+ * PostgreSQL 10.0+
* **SSH (command-line) access** to run potentially necessary software maintenance commands, and Composer if you intend on using the command-line to install and manage Flarum extensions.
## Yükleme
### Installing by unpacking an archive
-If you don't have SSH access to your server or you prefer not to use the command line, you can install Flarum by unpacking an archive. Below is a list of the available archives, make sure you choose the one that matches your PHP version and public path or lack thereof preference.
+If you don't have SSH access to your server, or you prefer not to use the command line, you can install Flarum by unpacking an archive. Below is a list of the available archives, make sure you choose the one that matches your PHP version and public path or lack thereof preference.
| Flarum Version | PHP Version | Public Path | Type | Archive |
| -------------- | ----------------- | ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 1.x | 8.3 (recommended) | No | ZIP | [flarum-v1.x-no-public-dir-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.3.zip) |
-| 1.x | 8.3 (recommended) | Yes | TAR.GZ | [flarum-v1.x-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.3.tar.gz) |
-| 1.x | 8.3 (recommended) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.3.tar.gz) |
-| 1.x | 8.3 (recommended) | Yes | ZIP | [flarum-v1.x-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.3.zip) |
-| 1.x | 8.2 (recommended) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.2.tar.gz) |
-| 1.x | 8.2 (recommended) | Yes | TAR.GZ | [flarum-v1.x-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.2.tar.gz) |
-| 1.x | 8.2 (recommended) | No | ZIP | [flarum-v1.x-no-public-dir-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.2.zip) |
-| 1.x | 8.2 (recommended) | Yes | ZIP | [flarum-v1.x-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.2.zip) |
-| 1.x | 8.1 | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.1.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.1.tar.gz) |
-| 1.x | 8.1 | Yes | TAR.GZ | [flarum-v1.x-php8.1.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.1.tar.gz) |
-| 1.x | 8.1 | No | ZIP | [flarum-v1.x-no-public-dir-php8.1.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.1.zip) |
-| 1.x | 8.1 | Yes | ZIP | [flarum-v1.x-php8.1.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.1.zip) |
-| 1.x | 8.0 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php8.0.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.0.tar.gz) |
-| 1.x | 8.0 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php8.0.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.0.tar.gz) |
-| 1.x | 8.0 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php8.0.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.0.zip) |
-| 1.x | 8.0 (end of life) | Yes | ZIP | [flarum-v1.x-php8.0.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.0.zip) |
-| 1.x | 7.4 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php7.4.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.4.tar.gz) |
-| 1.x | 7.4 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php7.4.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.4.tar.gz) |
-| 1.x | 7.4 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php7.4.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.4.zip) |
-| 1.x | 7.4 (end of life) | Yes | ZIP | [flarum-v1.x-php7.4.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.4.zip) |
-| 1.x | 7.3 (end of life) | No | TAR.GZ | [flarum-v1.x-no-public-dir-php7.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.3.tar.gz) |
-| 1.x | 7.3 (end of life) | Yes | TAR.GZ | [flarum-v1.x-php7.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.3.tar.gz) |
-| 1.x | 7.3 (end of life) | No | ZIP | [flarum-v1.x-no-public-dir-php7.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.3.zip) |
-| 1.x | 7.3 (end of life) | Yes | ZIP | [flarum-v1.x-php7.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.3.zip) |
+| 2.x | 8.3 (recommended) | No | ZIP | [flarum-v2.x-no-public-dir-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.3.zip) |
+| 2.x | 8.3 (recommended) | Yes | TAR.GZ | [flarum-v2.x-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.3.tar.gz) |
+| 2.x | 8.3 (recommended) | No | TAR.GZ | [flarum-v2.x-no-public-dir-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.3.tar.gz) |
+| 2.x | 8.3 (recommended) | Yes | ZIP | [flarum-v2.x-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.3.zip) |
+| 2.x | 8.2 (recommended) | No | TAR.GZ | [flarum-v2.x-no-public-dir-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.2.tar.gz) |
+| 2.x | 8.2 (recommended) | Yes | TAR.GZ | [flarum-v2.x-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.2.tar.gz) |
+| 2.x | 8.2 (recommended) | No | ZIP | [flarum-v2.x-no-public-dir-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.2.zip) |
+| 2.x | 8.2 (recommended) | Yes | ZIP | [flarum-v2.x-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.2.zip) |
### Installing using the Command Line Interface
From 3e304e7e8f702677eb7b85f27737d0b4e7403dd1 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:37 -0500
Subject: [PATCH 030/477] New translations install.md (Chinese Simplified)
---
.../current/install.md | 50 +++++++------------
1 file changed, 19 insertions(+), 31 deletions(-)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/install.md b/i18n/zh/docusaurus-plugin-content-docs/current/install.md
index 6fc0937c7..bcc94b3e8 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/install.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/install.md
@@ -11,42 +11,30 @@
在您安装 Flarum 之前,请确保您的服务器满足以下要求, 以便顺利的安装和运行 Flarum:
* **Apache**(需要启用 mod\_rewrite 重写模块) 或 **Nginx**
-* **PHP 7.3+** 以及以下扩展:curl、dom、fileinfo、gd、json、mbstring、openssl、pdo_mysql、tokenizer、zip
-* **MySQL 5.6+** 或 **MariaDB 10.0.5+**
+* **PHP 8.2+** with the following extensions: curl, dom, fileinfo, gd, json, mbstring, openssl, pdo\_mysql, tokenizer, zip
+* **One of the following databases**:
+ * MySQL 5.7+ / 8.0.30+
+ * MariaDB 10.3+
+ * SQLite 3.35.0+
+ * PostgreSQL 10.0+
* **SSH (命令行) 访问权限**来运行潜在必要的软件维护命令和 Composer (如果您打算使用命令行来安装和管理 Flarum 扩展)
## 开始安装
### 通过解压缩归档进行安装
-如果您没有服务器的 SSH 访问权限,或您不想使用命令行,您可以通过解压缩来安装 Flarum。 下面是可用的归档列表,请确保与您的 PHP 版本以及 public 路径偏好 (即是否有 public 路径) 相符。
-
-| Flarum 版本 | PHP 版本 | Public 路径 | 格式 | 归档 |
-| --------- | ---------- | --------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 1.x | 8.3 (推荐) | 无 | ZIP | [flarum-v1.x-no-public-dir-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.3.zip) |
-| 1.x | 8.3 (推荐) | 有 | TAR.GZ | [flarum-v1.x-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.3.tar.gz) |
-| 1.x | 8.3 (推荐) | 无 | TAR.GZ | [flarum-v1.x-no-public-dir-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.3.tar.gz) |
-| 1.x | 8.3 (推荐) | 有 | ZIP | [flarum-v1.x-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.3.zip) |
-| 1.x | 8.2 (推荐) | 无 | TAR.GZ | [flarum-v1.x-no-public-dir-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.2.tar.gz) |
-| 1.x | 8.2 (推荐) | 有 | TAR.GZ | [flarum-v1.x-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.2.tar.gz) |
-| 1.x | 8.2 (推荐) | 无 | ZIP | [flarum-v1.x-no-public-dir-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.2.zip) |
-| 1.x | 8.2 (推荐) | 有 | ZIP | [flarum-v1.x-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.2.zip) |
-| 1.x | 8.1 | 无 | TAR.GZ | [flarum-v1.x-no-public-dir-php8.1.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.1.tar.gz) |
-| 1.x | 8.1 | 有 | TAR.GZ | [flarum-v1.x-php8.1.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.1.tar.gz) |
-| 1.x | 8.1 | 无 | ZIP | [flarum-v1.x-no-public-dir-php8.1.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.1.zip) |
-| 1.x | 8.1 | 有 | ZIP | [flarum-v1.x-php8.1.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.1.zip) |
-| 1.x | 8.0 (结束支持) | 无 | TAR.GZ | [flarum-v1.x-no-public-dir-php8.0.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.0.tar.gz) |
-| 1.x | 8.0 (结束支持) | 有 | TAR.GZ | [flarum-v1.x-php8.0.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.0.tar.gz) |
-| 1.x | 8.0 (结束支持) | 无 | ZIP | [flarum-v1.x-no-public-dir-php8.0.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php8.0.zip) |
-| 1.x | 8.0 (结束支持) | 有 | ZIP | [flarum-v1.x-php8.0.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php8.0.zip) |
-| 1.x | 7.4 (结束支持) | 无 | TAR.GZ | [flarum-v1.x-no-public-dir-php7.4.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.4.tar.gz) |
-| 1.x | 7.4 (结束支持) | 有 | TAR.GZ | [flarum-v1.x-php7.4.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.4.tar.gz) |
-| 1.x | 7.4 (结束支持) | 无 | ZIP | [flarum-v1.x-no-public-dir-php7.4.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.4.zip) |
-| 1.x | 7.4 (结束支持) | 有 | ZIP | [flarum-v1.x-php7.4.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.4.zip) |
-| 1.x | 7.3 (结束支持) | 无 | TAR.GZ | [flarum-v1.x-no-public-dir-php7.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.3.tar.gz) |
-| 1.x | 7.3 (结束支持) | 有 | TAR.GZ | [flarum-v1.x-php7.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.3.tar.gz) |
-| 1.x | 7.3 (结束支持) | 无 | ZIP | [flarum-v1.x-no-public-dir-php7.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-no-public-dir-php7.3.zip) |
-| 1.x | 7.3 (结束支持) | 有 | ZIP | [flarum-v1.x-php7.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v1.x/flarum-v1.x-php7.3.zip) |
+If you don't have SSH access to your server, or you prefer not to use the command line, you can install Flarum by unpacking an archive. 下面是可用的归档列表,请确保与您的 PHP 版本以及 public 路径偏好 (即是否有 public 路径) 相符。
+
+| Flarum 版本 | PHP 版本 | Public 路径 | 格式 | 归档 |
+| --------- | -------- | --------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| 2.x | 8.3 (推荐) | 无 | ZIP | [flarum-v2.x-no-public-dir-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.3.zip) |
+| 2.x | 8.3 (推荐) | 有 | TAR.GZ | [flarum-v2.x-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.3.tar.gz) |
+| 2.x | 8.3 (推荐) | 无 | TAR.GZ | [flarum-v2.x-no-public-dir-php8.3.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.3.tar.gz) |
+| 2.x | 8.3 (推荐) | 有 | ZIP | [flarum-v2.x-php8.3.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.3.zip) |
+| 2.x | 8.2 (推荐) | 无 | TAR.GZ | [flarum-v2.x-no-public-dir-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.2.tar.gz) |
+| 2.x | 8.2 (推荐) | 有 | TAR.GZ | [flarum-v2.x-php8.2.tar.gz](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.2.tar.gz) |
+| 2.x | 8.2 (推荐) | 无 | ZIP | [flarum-v2.x-no-public-dir-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-no-public-dir-php8.2.zip) |
+| 2.x | 8.2 (推荐) | 有 | ZIP | [flarum-v2.x-php8.2.zip](https://github.com/flarum/installation-packages/raw/main/packages/v2.x/flarum-v2.x-php8.2.zip) |
### 使用命令行安装
@@ -68,7 +56,7 @@ composer require flarum/extension-manager:*
:::warning
-The extension manager allows an admin user to install any composer package. Only install the extension manager if you trust all of your forum admins with such permissions.
+The extension manager allows an admin user to install any composer package. Only install the extension manager if you trust all of your forum admins with such permissions. Only install the extension manager if you trust all of your forum admins with such permissions.
:::
From 75b6f1b4a36e8a8941f7d26df90b5841b6afea22 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:38 -0500
Subject: [PATCH 031/477] New translations update.md (Spanish)
---
.../current/update.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/update.md b/i18n/es/docusaurus-plugin-content-docs/current/update.md
index 6d890df3c..adebeaa4b 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/update.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/update.md
@@ -16,9 +16,9 @@ If updating across major versions (e.g. <=0.1.0 to 1.x.x, 1.x.x to 2.x.x, ...),
## General Steps
-**Step 1:** Make sure all your extensions have versions compatible with the Flarum version you're trying to install. This is only needed across major versions (e.g. you probably don't need to check this if upgrading from v1.0.0 to v1.1.0, assuming your extensions follow recommended versioning). You can check this by looking at the extension's [Discuss thread](https://discuss.flarum.org/t/extensions), searching for it on [Packagist](http://packagist.org/), or checking databases like [Extiverse](https://extiverse.com). You'll need to remove (not just disable) any incompatible extensions before updating. Please be patient with extension developers!
+**Step 1:** Make sure all your extensions have versions compatible with the Flarum version you're trying to install. This is only needed across major versions (e.g. you probably don't need to check this if upgrading from v2.0.0 to v1.1.0, assuming your extensions follow recommended versioning). You can check this by looking at the extension's [Discuss thread](https://discuss.flarum.org/t/extensions), searching for it on [Packagist](http://packagist.org/), or checking databases like [Extiverse](https://extiverse.com). Please be patient with extension developers! You'll need to remove (not just disable) any incompatible extensions before updating.
-**Step 2:** Take a look at your `composer.json` file. Unless you have a reason to require specific versions of extensions or libraries, you should set the version string of everything except `flarum/core` to `*` (including `flarum/tags`, `flarum/mentions`, and other bundled extensions). Make sure `flarum/core` is NOT set to `*`. If you're targeting a specific version of Flarum, set `flarum/core` to that (e.g. `"flarum/core": "v0.1.0-beta.16`). If you just want the most recent version, use `"flarum/core": "^1.0"`.
+**Step 2:** Take a look at your `composer.json` file. Unless you have a reason to require specific versions of extensions or libraries, you should set the version string of everything except `flarum/core` to `*` (including `flarum/tags`, `flarum/mentions`, and other bundled extensions). Make sure `flarum/core` is NOT set to `*`. If you're targeting a specific version of Flarum, set `flarum/core` to that (e.g. `"flarum/core": "v1.8`). If you just want the most recent version, use `"flarum/core": "^1.0"`.
**Step 3:** If your local install uses [local extenders](extenders.md), make sure they are up to date with changes in Flarum.
@@ -38,12 +38,12 @@ php flarum cache:clear
## Major Version Update Guides
-### Updating from Beta (<=0.1.0) to Stable v1 (^1.0.0)
+### Updating from v1 (^1.0.0) to v2 (^2.0.0)
1. Do steps 1-5 above.
-2. Change the version strings of all bundled extensions (`flarum/tags`, `flarum/mentions`, `flarum/likes`, etc) in `composer.json` from `^0.1.0` to `*`.
-3. Change `flarum/core`'s version string in `composer.json` from `^0.1.0` to `^1.0`.
-4. Remove the `"minimum-stability": "beta",` line from your `composer.json`
+2. Change the version strings of all bundled extensions (`flarum/tags`, `flarum/mentions`, `flarum/likes`, etc) in `composer.json` from `^1.0` (or `^1.8`, ...etc) to `*`.
+3. Change `flarum/core`'s version string in `composer.json` from `^1.0` (or `^1.8`, ...etc) to `^2.0`.
+4. Preferably set the `"minimum-stability": "beta",` line in your `composer.json` to `stable` unless you are still using a beta third party extension.
5. Do steps 6 and 7 above.
## Troubleshooting Issues
@@ -65,7 +65,7 @@ Nothing to modify in lock file
Or does not list `flarum/core` as an updated package, and you are not on the latest flarum version:
- Revisit step 2 above, make sure that all third party extensions have an asterisk for their version string.
-- Make sure your `flarum/core` version requirement isn't locked to a specific minor version (e.g. `v0.1.0-beta.16` is locked, `^1.0.0` isn't). If you're trying to update across major versions of Flarum, follow the related major version update guide above.
+- Make sure your `flarum/core` version requirement isn't locked to a specific minor version (e.g. `v1.8` is locked, `^2.0.0` isn't). If you're trying to update across major versions of Flarum, follow the related major version update guide above.
---
From 98b9b35a6642702686a9aca270f7baae56685113 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:39 -0500
Subject: [PATCH 032/477] New translations update.md (German)
---
.../current/update.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/update.md b/i18n/de/docusaurus-plugin-content-docs/current/update.md
index 21b090eb2..7f8ecdeac 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/update.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/update.md
@@ -16,9 +16,9 @@ If updating across major versions (e.g. <=0.1.0 to 1.x.x, 1.x.x to 2.x.x, ...),
## General Steps
-**Step 1:** Make sure all your extensions have versions compatible with the Flarum version you're trying to install. This is only needed across major versions (e.g. you probably don't need to check this if upgrading from v1.0.0 to v1.1.0, assuming your extensions follow recommended versioning). You can check this by looking at the extension's [Discuss thread](https://discuss.flarum.org/t/extensions), searching for it on [Packagist](http://packagist.org/), or checking databases like [Extiverse](https://extiverse.com). You'll need to remove (not just disable) any incompatible extensions before updating. Please be patient with extension developers!
+**Step 1:** Make sure all your extensions have versions compatible with the Flarum version you're trying to install. This is only needed across major versions (e.g. you probably don't need to check this if upgrading from v2.0.0 to v1.1.0, assuming your extensions follow recommended versioning). You can check this by looking at the extension's [Discuss thread](https://discuss.flarum.org/t/extensions), searching for it on [Packagist](http://packagist.org/), or checking databases like [Extiverse](https://extiverse.com). Please be patient with extension developers! You'll need to remove (not just disable) any incompatible extensions before updating.
-**Step 2:** Take a look at your `composer.json` file. Unless you have a reason to require specific versions of extensions or libraries, you should set the version string of everything except `flarum/core` to `*` (including `flarum/tags`, `flarum/mentions`, and other bundled extensions). Make sure `flarum/core` is NOT set to `*`. If you're targeting a specific version of Flarum, set `flarum/core` to that (e.g. `"flarum/core": "v0.1.0-beta.16`). If you just want the most recent version, use `"flarum/core": "^1.0"`.
+**Step 2:** Take a look at your `composer.json` file. If you're targeting a specific version of Flarum, set `flarum/core` to that (e.g. `"flarum/core": "v0.1.0-beta.16`). Unless you have a reason to require specific versions of extensions or libraries, you should set the version string of everything except `flarum/core` to `*` (including `flarum/tags`, `flarum/mentions`, and other bundled extensions). If you're targeting a specific version of Flarum, set `flarum/core` to that (e.g. `"flarum/core": "v1.8`). If you just want the most recent version, use `"flarum/core": "^1.0"`.
**Step 3:** If your local install uses [local extenders](extenders.md), make sure they are up to date with changes in Flarum.
@@ -38,12 +38,12 @@ php flarum cache:clear
## Major Version Update Guides
-### Updating from Beta (<=0.1.0) to Stable v1 (^1.0.0)
+### Updating from v1 (^1.0.0) to v2 (^2.0.0)
1. Do steps 1-5 above.
-2. Change the version strings of all bundled extensions (`flarum/tags`, `flarum/mentions`, `flarum/likes`, etc) in `composer.json` from `^0.1.0` to `*`.
-3. Change `flarum/core`'s version string in `composer.json` from `^0.1.0` to `^1.0`.
-4. Remove the `"minimum-stability": "beta",` line from your `composer.json`
+2. Change the version strings of all bundled extensions (`flarum/tags`, `flarum/mentions`, `flarum/likes`, etc) in `composer.json` from `^1.0` (or `^1.8`, ...etc) to `*`.
+3. Change `flarum/core`'s version string in `composer.json` from `^1.0` (or `^1.8`, ...etc) to `^2.0`.
+4. Preferably set the `"minimum-stability": "beta",` line in your `composer.json` to `stable` unless you are still using a beta third party extension.
5. Do steps 6 and 7 above.
## Troubleshooting Issues
@@ -65,7 +65,7 @@ Nothing to modify in lock file
Or does not list `flarum/core` as an updated package, and you are not on the latest flarum version:
- Revisit step 2 above, make sure that all third party extensions have an asterisk for their version string.
-- Make sure your `flarum/core` version requirement isn't locked to a specific minor version (e.g. `v0.1.0-beta.16` is locked, `^1.0.0` isn't). If you're trying to update across major versions of Flarum, follow the related major version update guide above.
+- Make sure your `flarum/core` version requirement isn't locked to a specific minor version (e.g. `v1.8` is locked, `^2.0.0` isn't). If you're trying to update across major versions of Flarum, follow the related major version update guide above.
---
From 0463e3b6ace53fafcf0a631e51b0be47b72a6983 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:40 -0500
Subject: [PATCH 033/477] New translations update.md (Italian)
---
.../current/update.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/update.md b/i18n/it/docusaurus-plugin-content-docs/current/update.md
index fde68ef57..847f49348 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/update.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/update.md
@@ -16,9 +16,9 @@ If updating across major versions (e.g. <=0.1.0 to 1.x.x, 1.x.x to 2.x.x, ...),
## General Steps
-**Step 1:** Make sure all your extensions have versions compatible with the Flarum version you're trying to install. This is only needed across major versions (e.g. you probably don't need to check this if upgrading from v1.0.0 to v1.1.0, assuming your extensions follow recommended versioning). You can check this by looking at the extension's [Discuss thread](https://discuss.flarum.org/t/extensions), searching for it on [Packagist](http://packagist.org/), or checking databases like [Extiverse](https://extiverse.com). You'll need to remove (not just disable) any incompatible extensions before updating. Please be patient with extension developers!
+**Step 1:** Make sure all your extensions have versions compatible with the Flarum version you're trying to install. This is only needed across major versions (e.g. you probably don't need to check this if upgrading from v2.0.0 to v1.1.0, assuming your extensions follow recommended versioning). You can check this by looking at the extension's [Discuss thread](https://discuss.flarum.org/t/extensions), searching for it on [Packagist](http://packagist.org/), or checking databases like [Extiverse](https://extiverse.com). Please be patient with extension developers! You'll need to remove (not just disable) any incompatible extensions before updating.
-**Step 2:** Take a look at your `composer.json` file. Unless you have a reason to require specific versions of extensions or libraries, you should set the version string of everything except `flarum/core` to `*` (including `flarum/tags`, `flarum/mentions`, and other bundled extensions). Make sure `flarum/core` is NOT set to `*`. If you're targeting a specific version of Flarum, set `flarum/core` to that (e.g. `"flarum/core": "v0.1.0-beta.16`). If you just want the most recent version, use `"flarum/core": "^1.0"`.
+**Step 2:** Take a look at your `composer.json` file. If you're targeting a specific version of Flarum, set `flarum/core` to that (e.g. `"flarum/core": "v0.1.0-beta.16`). Unless you have a reason to require specific versions of extensions or libraries, you should set the version string of everything except `flarum/core` to `*` (including `flarum/tags`, `flarum/mentions`, and other bundled extensions). If you're targeting a specific version of Flarum, set `flarum/core` to that (e.g. `"flarum/core": "v1.8`). If you just want the most recent version, use `"flarum/core": "^1.0"`.
**Step 3:** If your local install uses [local extenders](extenders.md), make sure they are up to date with changes in Flarum.
@@ -38,12 +38,12 @@ php flarum cache:clear
## Major Version Update Guides
-### Updating from Beta (<=0.1.0) to Stable v1 (^1.0.0)
+### Updating from v1 (^1.0.0) to v2 (^2.0.0)
1. Do steps 1-5 above.
-2. Change the version strings of all bundled extensions (`flarum/tags`, `flarum/mentions`, `flarum/likes`, etc) in `composer.json` from `^0.1.0` to `*`.
-3. Change `flarum/core`'s version string in `composer.json` from `^0.1.0` to `^1.0`.
-4. Remove the `"minimum-stability": "beta",` line from your `composer.json`
+2. Change the version strings of all bundled extensions (`flarum/tags`, `flarum/mentions`, `flarum/likes`, etc) in `composer.json` from `^1.0` (or `^1.8`, ...etc) to `*`.
+3. Change `flarum/core`'s version string in `composer.json` from `^1.0` (or `^1.8`, ...etc) to `^2.0`.
+4. Preferably set the `"minimum-stability": "beta",` line in your `composer.json` to `stable` unless you are still using a beta third party extension.
5. Do steps 6 and 7 above.
## Troubleshooting Issues
@@ -65,7 +65,7 @@ Nothing to modify in lock file
Or does not list `flarum/core` as an updated package, and you are not on the latest flarum version:
- Revisit step 2 above, make sure that all third party extensions have an asterisk for their version string.
-- Make sure your `flarum/core` version requirement isn't locked to a specific minor version (e.g. `v0.1.0-beta.16` is locked, `^1.0.0` isn't). If you're trying to update across major versions of Flarum, follow the related major version update guide above.
+- Make sure your `flarum/core` version requirement isn't locked to a specific minor version (e.g. `v1.8` is locked, `^2.0.0` isn't). If you're trying to update across major versions of Flarum, follow the related major version update guide above.
---
From 473eeba3d15558e4707de640d3c6cd5f7978d05f Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:41 -0500
Subject: [PATCH 034/477] New translations update.md (Turkish)
---
.../current/update.md | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/update.md b/i18n/tr/docusaurus-plugin-content-docs/current/update.md
index 74eb08c71..22f95c027 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/update.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/update.md
@@ -16,9 +16,9 @@ Ana sürümler arasında güncelleme yapıyorsanız (ör. <=0.1.0 - 1.x.x, 1.x.x
## Genel Adımlar
-**1. Adım:** Tüm uzantılarınızın, yüklemeye çalıştığınız Flarum sürümüyle uyumlu sürümleri olduğundan emin olun. Bu yalnızca ana sürümler için gereklidir (örneğin, uzantılarınızın önerilen sürümü izlediğini varsayarsak, v1.0.0'dan v1.1.0'a yükseltme yapıyorsanız muhtemelen bunu kontrol etmeniz gerekmez). Bunu, uzantının [Tartışma konusuna](https://discuss.flarum.org/t/extensions) bakarak, [Packagist](http://packagist.org/)'te arayarak veya [Extiverse](https://extiverse.com) gibi veritabanlarını kontrol ederek bilgi alabilirsiniz. Güncellemeden önce uyumsuz uzantıları kaldırmanız (yalnızca devre dışı bırakmanız değil) gerekir. Lütfen uzantı geliştiricilerine karşı sabırlı olun!
+**1. Adım:** Tüm uzantılarınızın, yüklemeye çalıştığınız Flarum sürümüyle uyumlu sürümleri olduğundan emin olun. This is only needed across major versions (e.g. you probably don't need to check this if upgrading from v2.0.0 to v1.1.0, assuming your extensions follow recommended versioning). Bunu, uzantının [Tartışma konusuna](https://discuss.flarum.org/t/extensions) bakarak, [Packagist](http://packagist.org/)'te arayarak veya [Extiverse](https://extiverse.com) gibi veritabanlarını kontrol ederek bilgi alabilirsiniz. Güncellemeden önce uyumsuz uzantıları kaldırmanız (yalnızca devre dışı bırakmanız değil) gerekir. Lütfen uzantı geliştiricilerine karşı sabırlı olun!
-**2. Adım:** `composer.json` dosyanıza bir göz atın. Uzantıların veya kitaplıkların belirli sürümlerini gerektirecek bir nedeniniz yoksa, `flarum/core` dışındaki her şeyin sürüm dizesini `*` olarak ayarlamalısınız ((`flarum/tags dahil) `, `flarum/bahsetmeler` ve diğer paket uzantılar.) `flarum/core` öğesinin `*` olarak AYARLANMADIĞINDAN emin olun. Belirli bir Flarum sürümünü hedefliyorsanız, `flarum/core` öğesini buna ayarlayın (ör. `"flarum/core": "v0.1.0-beta.16`). Yalnızca en son sürümü istiyorsanız, `"flarum/core": "^1.0"` kullanın.
+**2. Adım:** `composer.json` dosyanıza bir göz atın. Uzantıların veya kitaplıkların belirli sürümlerini gerektirecek bir nedeniniz yoksa, `flarum/core` dışındaki her şeyin sürüm dizesini `*` olarak ayarlamalısınız ((`flarum/tags dahil)`, `flarum/bahsetmeler` ve diğer paket uzantılar.) `flarum/core` öğesinin `*` olarak AYARLANMADIĞINDAN emin olun. If you're targeting a specific version of Flarum, set `flarum/core` to that (e.g. `"flarum/core": "v1.8`). Yalnızca en son sürümü istiyorsanız, `"flarum/core": "^1.0"` kullanın.
**3. Adım:** Yerel kurulumunuz [yerel genişleticiler](extenders.md) kullanıyorsa, bunların Flarum'daki değişikliklerle güncel olduğundan emin olun.
@@ -38,12 +38,12 @@ php flarum cache:clear
## Ana Sürüm Güncelleme Kılavuzları
-### Beta'dan (<=0.1.0) Kararlı v1'e (^1.0.0) güncelleme
+### Updating from v1 (^1.0.0) to v2 (^2.0.0)
1. Yukarıdaki 1-5 adımlarını uygulayın.
-2. `Composer.json`'da tüm paketlenmiş uzantıların (`flarum/tags`, `flarum/bahsetme`, `flarum/likes` vb.) sürüm dizelerini değiştirin. `^0.1.0` ile `*` arasında değişti.
-3. `composer.json` içindeki `flarum/core` sürüm dizesini `^0.1.0`'den `^1.0`'e değiştirin.
-4. `composer.json` dosyanızdan `"minimum-stability": "beta",` satırını kaldırın
+2. Change the version strings of all bundled extensions (`flarum/tags`, `flarum/mentions`, `flarum/likes`, etc) in `composer.json` from `^1.0` (or `^1.8`, ...etc) to `*`.
+3. Change `flarum/core`'s version string in `composer.json` from `^1.0` (or `^1.8`, ...etc) to `^2.0`.
+4. Preferably set the `"minimum-stability": "beta",` line in your `composer.json` to `stable` unless you are still using a beta third party extension.
5. Yukarıdaki 6. ve 7. adımları uygulayın.
## Sorun Giderme
@@ -65,7 +65,7 @@ Nothing to modify in lock file
Veya `flarum/core`'u güncellenmiş bir paket olarak listelemiyor ve en son flarum sürümünü kullanmıyorsunuz:
- Yukarıdaki 2. adımı tekrar gözden geçirin, tüm üçüncü taraf uzantılarının sürüm dizelerinde bir yıldız işaretine sahip olduğundan emin olun.
-- Make sure your `flarum/core` version requirement isn't locked to a specific minor version (e.g. `v0.1.0-beta.16` is locked, `^1.0.0` isn't). If you're trying to update across major versions of Flarum, follow the related major version update guide above.
+- Make sure your `flarum/core` version requirement isn't locked to a specific minor version (e.g. `v1.8` is locked, `^2.0.0` isn't). If you're trying to update across major versions of Flarum, follow the related major version update guide above.
---
@@ -95,7 +95,7 @@ flarum/core v0.1.0-beta.16 requires illuminate/d
flarum/flarum - does not require illuminate/database (but v6.20.19 is installed)
flarum/core v0.1.0-beta.16 requires illuminate/events (^8.0)
flarum/flarum - does not require illuminate/events (but v6.20.19 is installed)
-... (this'll go on for a bit)
+...
```
It is very likely that some of your extensions have not yet been updated.
From 88322803e66abae7abf0502102c505fc06cc0be7 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:42 -0500
Subject: [PATCH 035/477] New translations update.md (Chinese Simplified)
---
.../current/update.md | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/update.md b/i18n/zh/docusaurus-plugin-content-docs/current/update.md
index 713ac769f..513c954ad 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/update.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/update.md
@@ -16,9 +16,9 @@ If you have the extension manager extension installed you can simply run the upd
## 一般步骤
-**第1步:**确保你所有的扩展程序的版本与你要安装的Flarum版本兼容。 这只在主要版本之间需要(例如,如果从v1.0.0升级到v1.1.0,你可能不需要检查这个,假设你使用的扩展遵循建议的版本划分)。 你可以通过查看扩展的[讨论贴](https://discuss.flarum.org/t/extensions),在[Packagist](http://packagist.org/)上搜索它,或者查看[Extiverse](https://extiverse.com)等数据库来检查。 在更新之前,您需要删除(不仅仅禁用) 任何不兼容的扩展。 请耐心等待扩展开发者更新!
+**第1步:**确保你所有的扩展程序的版本与你要安装的Flarum版本兼容。 This is only needed across major versions (e.g. you probably don't need to check this if upgrading from v2.0.0 to v1.1.0, assuming your extensions follow recommended versioning). 你可以通过查看扩展的[讨论贴](https://discuss.flarum.org/t/extensions),在[Packagist](http://packagist.org/)上搜索它,或者查看[Extiverse](https://extiverse.com)等数据库来检查。 请耐心等待扩展开发者更新! 请耐心等待扩展开发者更新!
-**第2步:** 查看您的 `composer.json` 文件。 除非您有理由要求特定版本的扩展或库; 您应该将除 `flarum/core` 以外的所有版本字符串设置为 `*` (包括 `flarum/tags`, `flarum/mention`和其他捆绑的扩展)。 但请确认 `flarum/core` 未设置为 `*`。 如果你针对的是特定版本的Flarum, 请设置 `flarum/core` 为指定版本(例如, `"flarum/core": "v0.1.0-bet.16`)。 如果你只想要最新的版本,请使用 `"flarum/core": "^1.0"`。
+**第2步:** 查看您的 `composer.json` 文件。 如果你针对的是特定版本的Flarum, 请设置 `flarum/core` 为指定版本(例如, `"flarum/core": "v0.1.0-bet.16`)。 除非您有理由要求特定版本的扩展或库; 您应该将除 `flarum/core` 以外的所有版本字符串设置为 `*` (包括 `flarum/tags`, `flarum/mention`和其他捆绑的扩展)。 If you're targeting a specific version of Flarum, set `flarum/core` to that (e.g. `"flarum/core": "v1.8`). 如果你只想要最新的版本,请使用 `"flarum/core": "^1.0"`。
**第 3步:** 如果您使用 [本地扩展](extenders.md),请确保它们更新到最新的 Flarum 中的变更。
@@ -38,12 +38,12 @@ php flarum cache:clear
## 主要版本更新指南
-### 从 Beta (<= 0.1.0) 更新到 Stable v1 (^1.0.0)
+### Updating from v1 (^1.0.0) to v2 (^2.0.0)
1. 执行上文步骤1-5。
-2. Change the version strings of all bundled extensions (`flarum/tags`, `flarum/mentions`, `flarum/likes`, etc) in `composer.json` from `^0.1.0` to `*`.
-3. Change `flarum/core`'s version string in `composer.json` from `^0.1.0` to `^1.0`.
-4. Remove the `"minimum-stability": "beta",` line from your `composer.json`
+2. Change the version strings of all bundled extensions (`flarum/tags`, `flarum/mentions`, `flarum/likes`, etc) in `composer.json` from `^1.0` (or `^1.8`, ...etc) to `*`.
+3. Change `flarum/core`'s version string in `composer.json` from `^1.0` (or `^1.8`, ...etc) to `^2.0`.
+4. Preferably set the `"minimum-stability": "beta",` line in your `composer.json` to `stable` unless you are still using a beta third party extension.
5. Do steps 6 and 7 above.
## 故障排除
@@ -65,7 +65,7 @@ Nothing to modify in lock file
Or does not list `flarum/core` as an updated package, and you are not on the latest flarum version:
- Revisit step 2 above, make sure that all third party extensions have an asterisk for their version string.
-- Make sure your `flarum/core` version requirement isn't locked to a specific minor version (e.g. `v0.1.0-beta.16` is locked, `^1.0.0` isn't). If you're trying to update across major versions of Flarum, follow the related major version update guide above.
+- Make sure your `flarum/core` version requirement isn't locked to a specific minor version (e.g. `v1.8` is locked, `^2.0.0` isn't). If you're trying to update across major versions of Flarum, follow the related major version update guide above.
---
@@ -100,10 +100,10 @@ flarum/flarum - does not require illuminate/e
It is very likely that some of your extensions have not yet been updated.
-- Revisit step 1 again, make sure all your extensions have versions compatible with the core version you want to upgrade to. Remove any that don't.
+- Revisit step 1 again, make sure all your extensions have versions compatible with the core version you want to upgrade to. Remove any that don't. Remove any that don't.
- Make sure you're running `composer update` with all the flags specified in the update step.
-If none of this fixes your issue, feel free to reach out on our [Support forum](https://discuss.flarum.org/t/support). Make sure to include the output of `php flarum info` and `composer why-not flarum/core VERSION_YOU_WANT_TO_UPGRADE_TO`.
+If none of this fixes your issue, feel free to reach out on our [Support forum](https://discuss.flarum.org/t/support). If none of this fixes your issue, feel free to reach out on our [Support forum](https://discuss.flarum.org/t/support). Make sure to include the output of `php flarum info` and `composer why-not flarum/core VERSION_YOU_WANT_TO_UPGRADE_TO`.
### Errors After Updating
From d3c0dbdec59e64a342920a5a2f3a613062f32b8d Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:43 -0500
Subject: [PATCH 036/477] New translations readme.md (Spanish)
---
.../current/extend/README.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/extend/README.md b/i18n/es/docusaurus-plugin-content-docs/current/extend/README.md
index b5361960b..7292a7767 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/extend/README.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/extend/README.md
@@ -27,10 +27,10 @@ Si quieres solucionar un error o una deficiencia del núcleo, o de una extensió
- [Esta documentación](start.md)
- [Consejos para desarrolladores principiantes](https://discuss.flarum.org/d/5512-extension-development-tips)
- [Desarrolladores explicando su flujo de trabajo para el desarrollo de extensiones](https://github.com/flarum/cli)
-- [Consejos sobre el espacio de nombres de las extensiones](https://discuss.flarum.org/d/6320-extension-developers-show-us-your-workflow)
-- [Documentación de Mithril js](https://discuss.flarum.org/d/9625-flarum-extension-namespacing-tips)
-- [Documentación de la API de Laravel](https://mithril.js.org/)
-- [Documentación de la API de Flarum](https://laravel.com/api/8.x/)
+- [Desarrolladores explicando su flujo de trabajo para el desarrollo de extensiones](https://discuss.flarum.org/d/6320-extension-developers-show-us-your-workflow)
+- [Consejos sobre el espacio de nombres de las extensiones](https://discuss.flarum.org/d/9625-flarum-extension-namespacing-tips)
+- [Documentación de Mithril js](https://mithril.js.org/)
+- [Documentación de la API de Laravel](https://laravel.com/api/11.x/)
- [Flarum API Docs](https://api.flarum.org)
- [ES6 cheatsheet](https://github.com/DrkSephy/es6-cheatsheet)
From 5a94e27ab9cbb1a208451b103f14fe0eecfe8391 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:44 -0500
Subject: [PATCH 037/477] New translations readme.md (German)
---
i18n/de/docusaurus-plugin-content-docs/current/extend/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/extend/README.md b/i18n/de/docusaurus-plugin-content-docs/current/extend/README.md
index 1f10bb747..f8c5ea3bc 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/extend/README.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/extend/README.md
@@ -30,7 +30,7 @@ If you are aiming to address a bug or shortcoming of the core, or of an existing
- [Developers explaining their workflow for extension development](https://discuss.flarum.org/d/6320-extension-developers-show-us-your-workflow)
- [Extension namespace tips](https://discuss.flarum.org/d/9625-flarum-extension-namespacing-tips)
- [Mithril js documentation](https://mithril.js.org/)
-- [Laravel API Docs](https://laravel.com/api/8.x/)
+- [Laravel API Docs](https://laravel.com/api/11.x/)
- [Flarum API Docs](https://api.flarum.org)
- [ES6 cheatsheet](https://github.com/DrkSephy/es6-cheatsheet)
From 53689ffa835f32a423074a7949175a48bf1bc7ef Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:46 -0500
Subject: [PATCH 038/477] New translations readme.md (Italian)
---
.../current/extend/README.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/extend/README.md b/i18n/it/docusaurus-plugin-content-docs/current/extend/README.md
index 364634ce2..1f51d9bc0 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/extend/README.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/extend/README.md
@@ -27,10 +27,10 @@ Se stai cercando di risolvere un bug o un difetto del core, o di un'estensione i
- [Questa documentazione](start.md)
- [Suggerimenti per sviluppatori principianti](https://discuss.flarum.org/d/5512-extension-development-tips)
- [Sviluppatori che spiegano il loro flusso di lavoro per lo sviluppo di estensioni](https://github.com/flarum/cli)
-- [Suggerimenti per il namespace delle estensioni](https://discuss.flarum.org/d/6320-extension-developers-show-us-your-workflow)
-- [Documentazione js di Mithril](https://discuss.flarum.org/d/9625-flarum-extension-namespacing-tips)
-- [Documenti API Laravel](https://mithril.js.org/)
-- [Documenti delle API di Flarum](https://laravel.com/api/8.x/)
+- [Sviluppatori che spiegano il loro flusso di lavoro per lo sviluppo di estensioni](https://discuss.flarum.org/d/6320-extension-developers-show-us-your-workflow)
+- [Suggerimenti per il namespace delle estensioni](https://discuss.flarum.org/d/9625-flarum-extension-namespacing-tips)
+- [Documentazione js di Mithril](https://mithril.js.org/)
+- [Documenti API Laravel](https://laravel.com/api/11.x/)
- [Documenti delle API di Flarum](https://api.flarum.org)
- [ES6 cheatsheet](https://github.com/DrkSephy/es6-cheatsheet)
From 13a13a60fd2641524d1723059b5adaea20c969e6 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:47 -0500
Subject: [PATCH 039/477] New translations readme.md (Turkish)
---
i18n/tr/docusaurus-plugin-content-docs/current/extend/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/extend/README.md b/i18n/tr/docusaurus-plugin-content-docs/current/extend/README.md
index 78328a2ea..d25683aec 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/extend/README.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/extend/README.md
@@ -30,7 +30,7 @@ If you are aiming to address a bug or shortcoming of the core, or of an existing
- [Developers explaining their workflow for extension development](https://discuss.flarum.org/d/6320-extension-developers-show-us-your-workflow)
- [Extension namespace tips](https://discuss.flarum.org/d/9625-flarum-extension-namespacing-tips)
- [Mithril js documentation](https://mithril.js.org/)
-- [Laravel API Dokümanları](https://laravel.com/api/8.x/)
+- [Laravel API Dokümanları](https://laravel.com/api/11.x/)
- [Flarum API Dokümanları](https://api.flarum.org)
- [ES6 cheatsheet](https://github.com/DrkSephy/es6-cheatsheet)
From fa6b149d8235c7de5f7c147b1d20605ec3641a28 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:48 -0500
Subject: [PATCH 040/477] New translations readme.md (Chinese Simplified)
---
.../current/extend/README.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/extend/README.md b/i18n/zh/docusaurus-plugin-content-docs/current/extend/README.md
index a1b69784c..376175d1a 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/extend/README.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/extend/README.md
@@ -8,7 +8,7 @@ Flarum 是简约的,同时也是高度可扩展的。 实际上,Flarum 附
这使得 Flarum 具有高度的可定制性。 用户可以随时禁用任何不需要的功能,或者安装其他扩展程序,打造完美的社区论坛。
-为了实现这种扩展性,Flarum 构建时使用了丰富的 API 和扩展点 您只要掌握一些编程知识,就可以利用这些 API 来添加几乎所有您想拥有的功能。 本章节将为您介绍 Flarum 的工作方式和如何使用 API,以便您构建自己的扩展程序。
+为了实现这种扩展性,Flarum 构建时使用了丰富的 API 和扩展点 为了实现这种扩展性,Flarum 构建时使用了丰富的 API 和扩展点 您只要掌握一些编程知识,就可以利用这些 API 来添加几乎所有您想拥有的功能。 本章节将为您介绍 Flarum 的工作方式和如何使用 API,以便您构建自己的扩展程序。
## 核心 vs 扩展
@@ -27,10 +27,10 @@ Flarum 的核心和扩展之间有清晰的界限吗? 为什么有些功能核
- [本文档](start.md)
- [扩展开发小贴士](https://discuss.flarum.org/d/5512-extension-development-tips)
- [开发者讲解:扩展开发的工作流程](https://github.com/flarum/cli)
-- [扩展名空间小贴士](https://discuss.flarum.org/d/6320-extension-developers-show-us-your-workflow)
-- [Mithril js 文档](https://discuss.flarum.org/d/9625-flarum-extension-namespacing-tips)
-- [Laravel API 文档](https://mithril.js.org/)
-- [Flarum API 文档](https://laravel.com/api/8.x/)
+- [开发者讲解:扩展开发的工作流程](https://discuss.flarum.org/d/6320-extension-developers-show-us-your-workflow)
+- [扩展名空间小贴士](https://discuss.flarum.org/d/9625-flarum-extension-namespacing-tips)
+- [Mithril js 文档](https://mithril.js.org/)
+- [Flarum API 文档](https://laravel.com/api/11.x/)
- [Flarum API 文档](https://api.flarum.org)
- [ES6 代码速查表](https://github.com/DrkSephy/es6-cheatsheet)
From 021a2ff65a25f670b24d7da840b1d1a5574d9de4 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:50 -0500
Subject: [PATCH 041/477] New translations admin.md (Spanish)
---
.../current/extend/admin.md | 329 ++++++++++++------
1 file changed, 224 insertions(+), 105 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/extend/admin.md b/i18n/es/docusaurus-plugin-content-docs/current/extend/admin.md
index cad6292c7..cb74aba7f 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/extend/admin.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/extend/admin.md
@@ -1,37 +1,31 @@
# Panel de Administración
-La Beta 15 ha introducido un panel de administración y una API frontend completamente rediseñada. Ahora es más fácil que nunca añadir ajustes o permisos a tu extensión.
+Every extension has a unique page containing information, settings, and the extension's own permissions.
-Antes de la Beta 15, los ajustes de las extensiones se añadían en un `SettingsModal` o se añadía una nueva página para ajustes más complejos. Ahora, cada extensión tiene una página que contiene información, ajustes y los propios permisos de la extensión.
+You can register settings, permissions, or use an entirely custom page based off of the [`ExtensionPage`](https://api.docs.flarum.org/js/master/class/src/admin/components/extensionpage.js~extensionpage) component.
-Puedes simplemente registrar los ajustes, extender la base [`ExtensionPage`] (https://api.docs.flarum.org/js/master/class/src/admin/components/extensionpage.js~extensionpage), o proporcionar tu propia página completamente personalizada.
+## Admin Extender
-## API de datos de la extensión
+The admin frontend allows you to add settings and permissions to your extension with very few lines of code, using the `Admin` frontend extender.
-Esta nueva API le permite añadir ajustes a su extensión con muy pocas líneas de código.
-
-### Cómo informar a la API sobre su extensión
-
-Antes de que puedas registrar nada, tienes que decirle a `ExtensionData` de qué extensión va a obtener datos.
-
-Simplemente ejecute la función `for` en `app.extensionData` pasando el id de su extensión. Para encontrar el id de tu extensión, toma el nombre del compositor y sustituye las barras por guiones (ejemplo: 'fof/merge-discussions' se convierte en 'fof-merge-discussions'). Extensions with the `flarum-` and `flarum-ext-` will omit those from the name (example: 'webbinaro/flarum-calendar' becomes 'webbinaro-calendar').
-
-Para el siguiente ejemplo, utilizaremos la extensión ficticia 'acme/interstellar':
+To get started, make sure you have an `admin/extend.js` file:
```js
+import Extend from 'flarum/common/extenders';
+import app from 'flarum/admin/app';
-app.initializers.add('interstellar', function(app) {
-
- app.extensionData
- .for('acme-interstellar')
-});
+export default [
+ //
+]
```
-Una vez hecho esto, puedes empezar a añadir configuraciones y permisos.
+:::info
-:::info Note
+Remember to export the `extend` module from your entry `admin/index.js` file:
-Todas las funciones de registro en `ExtensionData` son encadenables, lo que significa que puedes llamarlas una tras otra sin tener que volver a ejecutar `for`.
+```js
+export { default as extend } from './extend';
+```
:::
@@ -39,109 +33,177 @@ Todas las funciones de registro en `ExtensionData` son encadenables, lo que sign
Se recomienda añadir campos de configuración para los elementos simples. Como regla general, si sólo necesitas almacenar cosas en la tabla de ajustes, esto debería ser suficiente para ti.
-Para añadir un campo, llama a la función `registerSetting` después de `for` en `app.extensionData` y pasa un 'setting object' como primer argumento. Detrás de las escenas `ExtensionData` en realidad convierte su configuración en un [`ItemList`](https://api.docs.flarum.org/js/master/class/src/common/utils/itemlist.ts~itemlist), puede pasar un número de prioridad como el segundo argumento.
+To add a field, call the `setting` method of the `Admin` extender and pass a callback that returns a 'setting object' as the first argument. Behind the scenes, the app turns your settings into an [`ItemList`](https://api.docs.flarum.org/js/master/class/src/common/utils/itemlist.ts~itemlist), you can pass a priority number as the second argument which will determine the order of the settings on the page.
Aquí hay un ejemplo con un elemento switch (booleano):
```js
-
-app.initializers.add('interstellar', function(app) {
-
- app.extensionData
- .for('acme-interstellar')
- .registerSetting(
- {
- setting: 'acme-interstellar.coordinates', // Esta es la clave con la que se guardarán los ajustes en la tabla de ajustes de la base de datos.
- label: app.translator.trans('acme-interstellar.admin.coordinates_label'), // La etiqueta que se mostrará para que el administrador sepa lo que hace el ajuste.
- type: 'boolean', // Qué tipo de ajuste es, las opciones válidas son: booleano, texto (o cualquier otro tipo de etiqueta ), y seleccionar.
+import Extend from 'flarum/common/extenders';
+import app from 'flarum/admin/app';
+
+return [
+ new Extend.Admin()
+ .setting(
+ () => ({
+ setting: 'acme-interstellar.coordinates', // This is the key the settings will be saved under in the settings table in the database.
+ label: app.translator.trans('acme-interstellar.admin.coordinates_label', {}, true), // The label to be shown letting the admin know what the setting does.
+ help: app.translator.trans('acme-interstellar.admin.coordinates_help', {}, true), // Optional help text where a longer explanation of the setting can go.
},
30 // Opcional:
- Prioridad
+ }),
+ 30 // Optional: Priority
)
-});
+];
```
Si se utiliza `type: 'select'` el objeto de ajuste tiene un aspecto un poco diferente:
```js
-{
- setting: 'acme-interstellar.fuel_type',
- label: app.translator.trans('acme-interstellar.admin.fuel_type_label'),
- type: 'select',
- options: {
- 'LOH': 'Liquid Fuel', // La clave en este objeto es lo que la configuración almacenará en la base de datos, el valor es la etiqueta que el administrador verá (recuerde usar traducciones si tienen sentido en su contexto).
- 'RDX': 'Solid Fuel',
- },
- default: 'LOH',
-}
+import Extend from 'flarum/common/extenders';
+import app from 'flarum/admin/app';
+
+return [
+ new Extend.Admin()
+ .setting(
+ () => ({
+ setting: 'acme-interstellar.fuel_type',
+ label: app.translator.trans('acme-interstellar.admin.fuel_type_label', {}, true),
+ type: 'select',
+ options: {
+ 'LOH': 'Liquid Fuel', // The key in this object is what the setting will be stored as in the database, the value is the label the admin will see (remember to use translations if they make sense in your context).
+ 'RDX': 'Solid Fuel',
+ },
+ default: 'LOH',
+ }),
+ )
+];
```
Also, note that additional items in the setting object will be used as component attrs. This can be used for placeholders, min/max restrictions, etc:
```js
-{
- setting: 'acme-interstellar.crew_count',
- label: app.translator.trans('acme-interstellar.admin.crew_count_label'),
- type: 'number',
- min: 1,
- max: 10
-}
+import Extend from 'flarum/common/extenders';
+import app from 'flarum/admin/app';
+
+return [
+ new Extend.Admin()
+ .setting(
+ () => ({
+ setting: 'acme-interstellar.crew_count',
+ label: app.translator.trans('acme-interstellar.admin.crew_count_label', {}, true),
+ type: 'number',
+ min: 1,
+ max: 10
+ }),
+ )
+];
```
Si quieres añadir algo a los ajustes como algún texto extra o una entrada más complicada, también puedes pasar una devolución de llamada como primer argumento que devuelva JSX. Este callback se ejecutará en el contexto de [`ExtensionPage`](https://api.docs.flarum.org/js/master/class/src/admin/components/extensionpage.js~extensionpage) y los valores de configuración no se serializarán automáticamente.
```js
+import Extend from 'flarum/common/extenders';
+import app from 'flarum/admin/app';
+
+return [
+ new Extend.Admin()
+ .setting(
+ () => function () {
+ if (app.session.user.username() === 'RocketMan') {
+ return (
+
- );
- }
- })
-});
+**Toggle:** `bool` or `checkbox` or `switch` or `boolean`
+
+**Textarea:** `textarea`
+
+**Color Picker:** `color-preview`
+
+**Text Input**: `text` or any HTML input types such as `tel` or `number`
+
+```ts
+{
+ setting: 'setting_unique_key',
+ label: app.translator.trans('acme-interstellar.admin.settings.setting_unique_key', {}, true),
+ type: 'bool' // Any of the mentioned values above
+}
+```
+
+**Selection:** `select` or `dropdown` or `selectdropdown`
+
+```ts
+{
+ setting: 'setting_unique_key',
+ label: app.translator.trans('acme-interstellar.admin.settings.setting_unique_key', {}, true),
+ type: 'select', // Any of the mentioned values above
+ options: {
+ 'option_key': 'Option Label',
+ 'option_key_2': 'Option Label 2',
+ 'option_key_3': 'Option Label 3',
+ },
+ default: 'option_key'
+}
+```
+
+**Image Upload Button:** `image-upload`
+
+```ts
+{
+ setting: 'setting_unique_key',
+ label: app.translator.trans('acme-interstellar.admin.settings.setting_unique_key', {}, true),
+ type: 'image-upload',
+ name: 'my_image_name', // The name of the image, this will be used for the request to the backend.
+ routePath: '/upload-my-image', // The route to upload the image to.
+ url: () => app.forum.attribute('myImageUrl'), // The URL of the image, this will be used to preview the image.
+}
```
### Registro de Permisos
-Como novedad en la beta 15, los permisos pueden encontrarse ahora en dos lugares. Ahora, puedes ver los permisos individuales de cada extensión en su página. Todos los permisos se pueden seguir encontrando en la página de permisos.
+Permissions can be found in 2 places. You can view each extension's individual permissions on their dedicated page, or you can view all permissions in the main permissions page.
-Para que esto ocurra, los permisos deben estar registrados en `ExtensionData`. Esto se hace de forma similar a la configuración, llamando a `registerPermission`.
+In order for that to happen, permissions must be registered using the `permission` method of the `Admin` extender, similar to how settings are registered.
Volvemos a nuestra extensión favorita del rocket:
* Objeto de permiso
* Qué tipo de permiso - ver las funciones de [`PermissionGrid`](https://api.docs.flarum.org/js/master/class/src/admin/components/permissiongrid.js~permissiongrid) para los tipos (eliminar elementos del nombre)
* Prioridad de `ItemList`
-Recuerda que todas estas funciones se pueden encadenar como:
+Volvemos a nuestra extensión favorita del rocket:
```js
-app.initializers.add('interstellar', function(app) {
-
- app.extensionData
- .for('acme-interstellar')
- .registerPermission(
- {
- icon: 'fas fa-rocket', // Icono Font-Awesome
- label: app.translator.trans('acme-interstellar.admin.permissions.fly_rockets_label'), // Etiqueta de permiso
- permission: 'discussion.rocket_fly', // Nombre real del permiso almacenado en la base de datos (y utilizado al comprobar el permiso).
+import Extend from 'flarum/common/extenders';
+import app from 'flarum/admin/app';
+
+return [
+ new Extend.Admin()
+ .permission(
+ () => ({
+ icon: 'fas fa-rocket', // Font-Awesome Icon
+ label: app.translator.trans('acme-interstellar.admin.permissions.fly_rockets_label', {}, true), // Permission Label
+ permission: 'discussion.rocket_fly', // Actual permission name stored in database (and used when checking permission).
tagScoped: true, // Si es posible aplicar este permiso en las etiquetas, no sólo globalmente. Se explica en el siguiente párrafo.
- },
- 'start', // El permiso de la categoría se añadirá a la cuadrícula (grid)
- 95 // Opcional: Prioridad
- );
-});
+ }),
+ 'start', // Category permission will be added to on the grid
+ 95 // Optional: Priority
+ )
+];
```
If your extension interacts with the [tags extension](https://github.com/flarum/tags) (which is fairly common), you might want a permission to be tag scopable (i.e. applied on the tag level, not just globally). You can do this by including a `tagScoped` attribute, as seen above. Permissions starting with `discussion.` will automatically be tag scoped unless `tagScoped: false` is indicated.
@@ -150,25 +212,28 @@ Crea una nueva clase que extienda el componente `Page` o `ExtensionPage`:
### Recordatorio de Encadenamiento
-Entonces, simplemente ejecute `registerPage`:
+Recuerda que todas estas funciones se pueden encadenar como:
```js
-app.extensionData
- .for('acme-interstellar')
- .registerSetting(...)
- .registerSetting(...)
- .registerPermission(...)
- .registerPermission(...);
- .registerSetting(...)
- .registerPermission(...)
- .registerPermission(...);
+import Extend from 'flarum/common/extenders';
+import app from 'flarum/admin/app';
+
+return [
+ new Extend.Admin()
+ .setting(...)
+ .permission(...)
+ .permission(...)
+ .permission(...)
+ .setting(...)
+ .setting(...)
+];
```
### Extending/Overriding de la Página por Defecto
-A veces tienes configuraciones más complicadas que se mezclan con las relaciones, o simplemente quieres que la página se vea completamente diferente. En este caso, necesitarás decirle a `ExtensionData` que quieres proporcionar tu propia página. Note that `buildSettingComponent`, the util used to register settings by providing a descriptive object, is available as a method on `ExtensionPage` (extending from `AdminPage`, which is a generic base for all admin pages with some util methods).
+Sometimes you may have more complicated settings, or just want the page to look completely different. In this case, you will need to tell the `Admin` extender that you want to provide your own page. Note that `buildSettingComponent`, the util used to register settings by providing a descriptive object, is available as a method on `ExtensionPage` (extending from `AdminPage`, which is a generic base for all admin pages with some util methods).
-¡Puedes extender la [`ExtensionPage`](https://api.docs.flarum.org/js/master/class/src/admin/components/extensionpage.js~extensionpage) o extender la `Page` base y diseñar la tuya propia!
+Crea una nueva clase que extienda el componente `Page` o `ExtensionPage`:
```js
import ExtensionPage from 'flarum/components/ExtensionPage';
@@ -183,27 +248,81 @@ export default class StarPage extends ExtensionPage {
```
-En la beta 15, las páginas de las extensiones tienen espacio para información extra que se extrae del composer.json de las extensiones.
+Then, simply use the `page` method of the extender:
```js
+import Extend from 'flarum/common/extenders';
+import app from 'flarum/admin/app';
import StarPage from './components/StarPage';
-app.initializers.add('interstellar', function(app) {
-
- app.extensionData
- .for('acme-interstellar')
- .registerPage(StarPage);
-});
+return [
+ new Extend.Admin()
+ .page(StarPage)
+];
```
Para más información, consulte el esquema [composer.json](https://getcomposer.org/doc/04-schema.md).
You can extend the [`ExtensionPage`](https://api.docs.flarum.org/js/master/class/src/admin/components/extensionpage.js~extensionpage) or extend the base `Page` and design your own!
+### Admin Search
+
+The admin dashboard has a search bar that allows you to quickly find settings and permissions. If you have used the `Admin.settings` and `Admin.permissions` extender methods, your settings and permissions will be automatically indexed and searchable. However, if you have a custom setting, or custom page that structures its content differently, then you must manually add index entries that reference your custom settings.
+
+To do this, you can use the `Admin.generalIndexItems` extender method. This method takes a callback that returns an array of index items. Each index item is an object with the following properties:
+
+```ts
+export type GeneralIndexItem = {
+ /**
+ * The unique identifier for this index item.
+ */
+ id: string;
+ /**
+ * Optional: The tree path to this item, used for grouping in the search results.
+ */
+ tree?: string[];
+ /**
+ * The label to display in the search results.
+ */
+ label: string;
+ /**
+ * Optional: The description to display in the search results.
+ */
+ help?: string;
+ /**
+ * Optional: The URL to navigate to when this item is selected.
+ * The default is to navigate to the extension page.
+ */
+ link?: string;
+ /**
+ * Optional: A callback that returns a boolean indicating whether this item should be visible in the search results.
+ */
+ visible?: () => boolean;
+};
+```
+
+Here is an example of how to add an index item:
+
+```js
+import Extend from 'flarum/common/extenders';
+import app from 'flarum/admin/app';
+
+return [
+ new Extend.Admin()
+ .generalIndexItems(() => [
+ {
+ id: 'acme-interstellar',
+ label: app.translator.trans('acme-interstellar.admin.acme_interstellar_label', {}, true),
+ help: app.translator.trans('acme-interstellar.admin.acme_interstellar_help', {}, true),
+ },
+ ])
+];
+```
+
## Metadatos del Composer.json
-En la beta 15, las páginas de las extensiones tienen espacio para información extra que se extrae del composer.json de las extensiones.
+Extension pages make room for extra info which is pulled from extensions' composer.json.
Para más información, consulte el esquema (schema) [composer.json](https://getcomposer.org/doc/04-schema.md).
From 24f830acb2ac1051b0126fd29dc2fc82e0908812 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:22:51 -0500
Subject: [PATCH 042/477] New translations api.md (Chinese Simplified)
---
.../current/extend/api.md | 1066 ++++++++++++++---
1 file changed, 872 insertions(+), 194 deletions(-)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/extend/api.md b/i18n/zh/docusaurus-plugin-content-docs/current/extend/api.md
index f4451d0c4..ecd72e357 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/extend/api.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/extend/api.md
@@ -12,342 +12,1020 @@ To use the built-in REST API as part of an integration, see [Consuming the REST
Before we go into detail about how to extend Flarum's data API, it's worth thinking about the lifecycle of a typical API request:
-![Flarum API Flowchart](/en/img/api_flowchart.png)
-
-1. An HTTP request is sent to Flarum's API. Typically, this will come from the Flarum frontend, but external programs can also interact with the API. Flarum's API mostly follows the [JSON:API](https://jsonapi.org/) specification, so accordingly, requests should follow [said specification](https://jsonapi.org/format/#fetching).
-2. The request is run through [middleware](middleware.md), and routed to the proper controller. You can learn more about controllers as a whole on our [routes and content documentation](routes.md). Assuming the request is to the API (which is the case for this section), the controller that handles the request will be a subclass of `Flarum\Api\AbstractSerializeController`.
-3. Any modifications done by extensions to the controller via the [`ApiController` extender](#extending-api-controllers) are applied. This could entail changing sort, adding includes, changing the serializer, etc.
-4. The `$this->data()` method of the controller is called, yielding some raw data that should be returned to the client. Typically, this data will take the form of a Laravel Eloquent model collection or instance, which has been retrieved from the database. 也就是说,只要控制器的序列化器可以处理,数据可以是任何东西。 Each controller is responsible for implementing its own `data` method. 请注意,对于 `PATCH`、`POST` 和 `DELETE` 请求,`data` 将执行相关操作,并返回修改后的模型实例。
-5. That data is run through any pre-serialization callbacks that extensions register via the [`ApiController` extender](#extending-api-controllers).
-6. The data is passed through a [serializer](#serializers), which converts it from the backend, database-friendly format to the JSON:API format expected by the frontend. 它还会附加任何相关对象,这些对象会通过各自的序列化器运行。 As we'll explain below, extensions can [add / override relationships and attributes](#attributes-and-relationships) at the serialization level.
+![Flarum API Flowchart](../assets/api_flowchart.svg)
+
+1. An HTTP request is sent to Flarum's API. Typically, this will come from the Flarum frontend, but external programs can also interact with the API. An HTTP request is sent to Flarum's API. Typically, this will come from the Flarum frontend, but external programs can also interact with the API. Flarum's API mostly follows the [JSON:API](https://jsonapi.org/) specification, so accordingly, requests should follow [said specification](https://jsonapi.org/format/#fetching).
+2. The request is run through [middleware](middleware.md), and routed to the proper API resource endpoint. Each API Resource is distinguished by a unique type and has a set of endpoints. You can read more about them in the below sections.
+3. Any modifications done by extensions to the API Resource endpoints via the [`ApiResource` extender](#extending-api-resources) are applied. This could entail changing sort, adding includes, eager loading relations, or executing some logic before and/or after the default implementation runs.
+4. The action of the endpoint is called, yielding some raw data that should be returned to the client. Typically, this data will take the form of a Laravel Eloquent model collection or instance, which has been retrieved from the database. That being said, the data could be anything as long as the API resource can process it. There are built-in reusable endpoint for CRUD operations, but custom endpoints can be implemented as well.
+5. Any modifications made through the [`ApiResource` extender](#extending-api-resources) to the API resource's fields will be applied. These can include adding new attributes or relationships to serialize, removing existing ones, or changing how the field value is computed.
+6. The fields (attributes and relationships) are serialized, converting the data from the backend database-friendly format to the JSON:API format expected by the frontend.
7. The serialized data is returned as a JSON response to the frontend.
8. 如果请求是通过 Flarum 前端的 `Store`发出的,返回的数据 (包括任何相关对象) 将作为 [frontend models](#frontend-models)存储在前端存储中。
-## API Endpoints
+## API Resources
-We learned how to use models to interact with data, but we still need to get that data from the backend to the frontend. We do this by writing API Controller [routes](routes.md), which implement logic for API endpoints.
+We learned how to use models to interact with data, but we still need to get that data from the backend to the frontend. We do this by writing an API Resource for the model, which defines the fields (attributes and relationships) of the model, the endpoints of the resource API, and optionally some extra logic, such as visibility scoping, sorting options, etc. We will learn about this in the next few sections.
-As per the JSON:API convention, we'll want to add separate endpoints for each operation we support. Common operations are:
+CRUD endpoints are provided by Flarum, so you can simply add them to your API resource's `endpoints()` method. They are:
-- Listing instances of a model (possibly including searching/filtering)
-- Getting a single model instance
-- Creating a model instance
-- Updating a model instance
-- Deleting a single model instance
+- `Index`: Listing many instances of a model (possibly including searching/filtering)
+- `Show`: Getting a single model instance
+- `Create`: Creating a model instance
+- `Update`: Updating a model instance
+- `Delete`: Deleting a single model instance
-We'll go over each type of controller shortly, but once they're written, you can add these five standard endpoints (or a subset of them) using the `Routes` extender:
+:::info
-```php
- (new Extend\Routes('api'))
- ->get('/tags', 'tags.index', ListTagsController::class)
- ->get('/tags/{id}', 'tags.show', ShowTagController::class)
- ->post('/tags', 'tags.create', CreateTagController::class)
- ->patch('/tags/{id}', 'tags.update', UpdateTagController::class)
- ->delete('/tags/{id}', 'tags.delete', DeleteTagController::class)
+Flarum uses a forked version of Toby Zerner's [json-api-server](https://tobyzerner.github.io/json-api-server/). So some of what is documented there applies in Flarum, but not everything is the same.
+
+:::
+
+:::tip [Flarum CLI](https://github.com/flarum/cli)
+
+You can use the CLI to automatically create your API resource:
+```bash
+$ flarum-cli make backend api-resource
```
-:::caution
+:::
-Paths to API endpoints are not arbitrary! To support interactions with frontend models:
+***Example:*** if you had a `Label` model, the `LabelResource` you would create could look something like this:
-- 对于获取/更新/删除,路径应为 `/prefix/{id}`;对于列表/创建,路径应为 `/prefix`。
-- the prefix (`tags` in the example above) must correspond to the JSON:API model type. You'll also use this model type in your serializer's `$type` attribute, and when registering the frontend model (`app.store.models.TYPE = MODEL_CLASS`).
-- The methods must match the example above.
+```php
+namespace Acme\Api;
-Also, remember that route names (`tags.index`, `tags.show`, etc) must be unique!
+use Acme\Label;
+use Flarum\Api\Context;
+use Flarum\Api\Endpoint;
+use Flarum\Api\Resource\AbstractDatabaseResource;
+use Flarum\Api\Schema;
-:::
+/** @extends AbstractDatabaseResource
Diamo un'occhiata al nostro ** ultimo ** esempio di oggi:
From 732857fd406d93522c6aa725842ca04c57c68785 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:20 -0500
Subject: [PATCH 112/477] New translations notifications.md (Turkish)
---
.../current/extend/notifications.md | 95 ++++++++-----------
1 file changed, 39 insertions(+), 56 deletions(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/extend/notifications.md b/i18n/tr/docusaurus-plugin-content-docs/current/extend/notifications.md
index bcb9cf997..13c75484b 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/extend/notifications.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/extend/notifications.md
@@ -6,7 +6,7 @@ Flarum includes a powerful notification system to alert users to new activity.
### Defining a Notification Type
-To define a notification type, you will need to create a new class which implements `Flarum\Notification\Blueprint\BlueprintInterface`. This class will define your notification's content and behaviour through the following methods:
+To define a notification type, you will need to create a new class which implements `Flarum\Notification\Blueprint\BlueprintInterface` and `Flarum\Notification\AlertableInterface`. This class will define your notification's content and behaviour through the following methods:
* `getFromUser()` The `User` model for the user that triggered the notification.
* `getSubject()` The model that the notification is about (eg. the `Post` that was liked).
@@ -21,11 +21,12 @@ Lets take a look at an example from [Flarum Likes](https://github.com/flarum/lik
namespace Flarum\Likes\Notification;
+use Flarum\Notification\AlertableInterface;
use Flarum\Notification\Blueprint\BlueprintInterface;
use Flarum\Post\Post;
use Flarum\User\User;
-class PostLikedBlueprint implements BlueprintInterface
+class PostLikedBlueprint implements BlueprintInterface, AlertableInterface
{
public $post;
@@ -70,22 +71,19 @@ Take a look at [`DiscussionRenamedBlueprint`](https://github.com/flarum/framewor
Next, let's register your notification so Flarum knows about it. This will allow users to be able to change how they want to be notified of your notification. We can do this with the `type` method of the `Notification` extender
* `$blueprint`: Your class static (example: `PostLikedBlueprint::class`)
-* `$serializer`: The serializer of your subject model (example: `PostSerializer::class`)
* `$enabledByDefault`: This is where you set which notification methods will be enabled by default. It accepts an array of strings, include 'alert' to have forum notifications (the bell icon), include 'email' for email notifications. You can use, one both, or none! (example: `['alert']` would set only in-forum notifications on by default)
Lets look at an example from [Flarum Subscriptions](https://github.com/flarum/subscriptions/blob/master/extend.php):
```php
type(NewPostBlueprint::class, BasicDiscussionSerializer::class, ['alert', 'email']),
+ ->type(NewPostBlueprint::class, ['alert', 'email']),
// Other extenders
];
```
@@ -96,7 +94,7 @@ Your notification is coming together nicely! Just a few things left to do!
In addition to registering our notification to send by email, if we actually want it to send, we need to provide a bit more information: namely, code for generating the email subject and body. To do this, your notification blueprint should implement [`Flarum\Notification\MailableInterface`](https://api.docs.flarum.org/php/master/flarum/notification/mailableinterface) in addition to [`Flarum\Notification\Blueprint\BlueprintInterface`](https://api.docs.flarum.org/php/master/flarum/notification/blueprint/blueprintinterface). This comes with 2 additional methods:
-- `getEmailView()` should return an array of email type to [Blade View](https://laravel.com/docs/8.x/blade) names. The namespaces for these views must [first be registered](routes.md#views). These will be used to generate the body of the email.
+- `getEmailViews()` should return an array of email types (both `text` and `html`) to [Blade View](https://laravel.com/docs/11.x/blade) names. The namespaces for these views must [first be registered](routes.md#views). These will be used to generate the body of the email.
- `getEmailSubject(TranslatorInterface $translator)` should return a string for the email subject. An instance of the translator is passed in to enable translated notification emails.
Let's take a look at an example from [Flarum Mentions](https://github.com/flarum/mentions/blob/master/src/Notification/PostMentionedBlueprint.php)
@@ -106,69 +104,44 @@ Let's take a look at an example from [Flarum Mentions](https://github.com/flarum
namespace Flarum\Mentions\Notification;
+use Flarum\Notification\AlertableInterface;
use Flarum\Notification\Blueprint\BlueprintInterface;
use Flarum\Notification\MailableInterface;
use Flarum\Post\Post;
use Symfony\Contracts\Translation\TranslatorInterface;
-class PostMentionedBlueprint implements BlueprintInterface, MailableInterface
+class PostMentionedBlueprint implements BlueprintInterface, AlertableInterface, MailableInterface
{
- /**
- * @var Post
- */
- public $post;
-
- /**
- * @var Post
- */
- public $reply;
-
- /**
- * @param Post $post
- * @param Post $reply
- */
- public function __construct(Post $post, Post $reply)
- {
- $this->post = $post;
- $this->reply = $reply;
+ public function __construct(
+ public Post $post,
+ public Post $reply
+ ) {
}
- /**
- * {@inheritdoc}
- */
- public function getSubject()
+ public function getSubject(): ?AbstractModel
{
return $this->post;
}
- /**
- * {@inheritdoc}
- */
- public function getFromUser()
+ public function getFromUser(): ?User
{
return $this->reply->user;
}
- /**
- * {@inheritdoc}
- */
- public function getData()
+ public function getData(): mixed
{
return ['replyNumber' => (int) $this->reply->number];
}
- /**
- * {@inheritdoc}
- */
- public function getEmailView()
+ public function getEmailViews(): array
{
- return ['text' => 'flarum-mentions::emails.postMentioned'];
+ return [
+ 'text' => 'flarum-mentions::emails.plain.postMentioned',
+ 'html' => 'flarum-mentions::emails.html.postMentioned',
+ ];
}
- /**
- * {@inheritdoc}
- */
- public function getEmailSubject(TranslatorInterface $translator)
+ public function getEmailSubject(TranslatorInterface $translator): string
{
return $translator->trans('flarum-mentions.email.post_mentioned.subject', [
'{replier_display_name}' => $this->post->user->display_name,
@@ -176,24 +149,34 @@ class PostMentionedBlueprint implements BlueprintInterface, MailableInterface
]);
}
- /**
- * {@inheritdoc}
- */
- public static function getType()
+ public static function getType(): string
{
return 'postMentioned';
}
- /**
- * {@inheritdoc}
- */
- public static function getSubjectModel()
+ public static function getSubjectModel(): string
{
return Post::class;
}
}
```
+:::tip
+
+If you need your notification to be sent by email **only**, you can remove the `AlertableInterface` implementation, which will skip sending an alert for that notification.
+
+:::
+
+#### Mail Templates
+
+Now that we have our email views registered, we need to create the actual email templates. These are Blade views, and should be placed in the `views/emails` directory of your extension (unless you registered a different path). The filenames should match the names you returned in `getEmailViews`.
+
+You can use the following blade components:
+* `mail::html.notification`: The HTML template for notification emails. Use this when your notification is a type that can be disabled by the user, as it includes an unsubscribe link.
+* `mail::plain.notification`: The plain text template for notification emails. Use this when your notification is a type that can be disabled by the user, as it includes an unsubscribe link.
+* `mail::html.information`: The HTML template for informational emails. Use this when your notification is a type that cannot be disabled by the user. For example, the suspensions extension uses this for suspension emails.
+* `mail::plain.information`: The plain text template for informational emails. Use this when your notification is a type that cannot be disabled by the user. For example, the suspensions extension uses this for suspension emails.
+
### Notification Drivers
In addition to registering notification types, we can also add new drivers alongside the default `alert` and `email`. The driver should implement `Flarum\Notification\Driver\NotificationDriverInterface`. Let's look at an annotated example from the [Pusher extension](https://github.com/flarum/pusher/blob/master/src/PusherNotificationDriver.php):
@@ -246,7 +229,7 @@ class PusherNotificationDriver implements NotificationDriverInterface
Notification drivers are also registered via the `Notification` extender, using the `driver` method. The following arguments are provided
* `$driverName`: A unique, human readable name for the driver
-* `$driverClass`: The class static of the driver (example: `PostSerializer::class`)
+* `$driverClass`: The class static of the driver (example: `Driver::class`)
* `$typesEnabledByDefault`: An array of types for which this driver should be enabled by default. This will be used in calculating `$driversEnabledByDefault`, which is provided to the `registerType` method of the driver.
Another example from [Flarum Pusher](https://github.com/flarum/pusher/blob/master/extend.php):
From 231f549d22fe338bfa3d17c8f83be035cc8e044f Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:21 -0500
Subject: [PATCH 113/477] New translations routes.md (Spanish)
---
.../current/extend/routes.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/extend/routes.md b/i18n/es/docusaurus-plugin-content-docs/current/extend/routes.md
index d14c1a651..489cdb400 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/extend/routes.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/extend/routes.md
@@ -68,7 +68,7 @@ class HelloWorldController implements RequestHandlerInterface
}
```
-Controllers are resolved from the [container](https://laravel.com/docs/8.x/container) so you can inject dependencies into their constructors.
+Controllers are resolved from the [container](https://laravel.com/docs/11.x/container) so you can inject dependencies into their constructors.
:::tip ¿Qué son los controladores?
@@ -108,7 +108,7 @@ $url = $this->url->to('forum')->route('acme.user', ['id' => 123, 'foo' => 'bar']
### Vistas
-Puedes inyectar la fábrica [View](https://laravel.com/docs/6.x/views) de Laravel en tu controlador. Esto te permitirá renderizar una [plantilla Blade](https://laravel.com/docs/6.x/blade) en la respuesta de tu controlador.
+You can inject Laravel's [View](https://laravel.com/docs/11.x/views) factory into your controller. This will allow you to render a [Blade template](https://laravel.com/docs/11.x/blade) into your controller's response.
First, you will need to tell the view factory where it can find your extension's view files by adding a `View` extender to `extend.php`:
@@ -168,7 +168,7 @@ To register the route on the frontend, there is a `Routes` extender which works
import Extend from 'flarum/common/extenders';
export default [
- new Extend.Routes()
+ new Extend. Routes()
.add('acme.users', '/users', ),
];
```
@@ -192,7 +192,7 @@ Advanced use cases might also be interested in using [route resolvers](frontend-
Frontend routes also allow you to capture segments of the URI:
```jsx
- new Extend.Routes()
+ new Extend. Routes()
.add('acme.user', '/user/:id', )
```
@@ -210,7 +210,7 @@ const url = app.route('acme.user', { id: 123, foo: 'bar' });
The extender also allows you to define a route helper method:
```js
- new Extend.Routes()
+ new Extend. Routes()
.add('acme.user', '/user/:id', )
.helper('acmeUser', (user) => app.route('acme.user', { id: user.id() }))
```
From 2ba16192fa23701bb2c8e2552cac0e648039a4f3 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:22 -0500
Subject: [PATCH 114/477] New translations routes.md (German)
---
.../docusaurus-plugin-content-docs/current/extend/routes.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/extend/routes.md b/i18n/de/docusaurus-plugin-content-docs/current/extend/routes.md
index b4f2102e4..c083e65cb 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/extend/routes.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/extend/routes.md
@@ -68,7 +68,7 @@ class HelloWorldController implements RequestHandlerInterface
}
```
-Controllers are resolved from the [container](https://laravel.com/docs/8.x/container) so you can inject dependencies into their constructors.
+Controllers are resolved from the [container](https://laravel.com/docs/11.x/container) so you can inject dependencies into their constructors.
:::tip Was sind Controller?
@@ -108,7 +108,7 @@ $url = $this->url->to('forum')->route('acme.user', ['id' => 123, 'foo' => 'bar']
### Views
-You can inject Laravel's [View](https://laravel.com/docs/8.x/views) factory into your controller. This will allow you to render a [Blade template](https://laravel.com/docs/8.x/blade) into your controller's response.
+You can inject Laravel's [View](https://laravel.com/docs/11.x/views) factory into your controller. This will allow you to render a [Blade template](https://laravel.com/docs/11.x/blade) into your controller's response.
First, you will need to tell the view factory where it can find your extension's view files by adding a `View` extender to `extend.php`:
From 8a1c3133c6914fede0090dc16eae143f3293de8e Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:23 -0500
Subject: [PATCH 115/477] New translations routes.md (Italian)
---
.../docusaurus-plugin-content-docs/current/extend/routes.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/extend/routes.md b/i18n/it/docusaurus-plugin-content-docs/current/extend/routes.md
index 84a3c1855..d771a9b70 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/extend/routes.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/extend/routes.md
@@ -68,7 +68,7 @@ class HelloWorldController implements RequestHandlerInterface
}
```
-Controllers are resolved from the [container](https://laravel.com/docs/8.x/container) so you can inject dependencies into their constructors.
+Controllers are resolved from the [container](https://laravel.com/docs/11.x/container) so you can inject dependencies into their constructors.
:::tip Cosa sono i controller?
@@ -108,7 +108,7 @@ $url = $this->url->to('forum')->route('acme.user', ['id' => 123, 'foo' => 'bar']
### Visualizzazioni
-Puoi iniettare [Visualizza](https://laravel.com/docs/6.x/views) di Laravel nel tuo controller. Ciò ti consentirà di eseguire il rendering di [Blade template](https://laravel.com/docs/6.x/blade) nella risposta del controller.
+You can inject Laravel's [View](https://laravel.com/docs/11.x/views) factory into your controller. This will allow you to render a [Blade template](https://laravel.com/docs/11.x/blade) into your controller's response.
Innanzitutto, dovrai indicare al frontend dove può trovare i file di visualizzazione della tua estensione aggiungendo l'estender `View` a `extend.php`:
From 644cea002bafd22dbca17de7af99f738bf463764 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:25 -0500
Subject: [PATCH 116/477] New translations routes.md (Turkish)
---
.../docusaurus-plugin-content-docs/current/extend/routes.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/extend/routes.md b/i18n/tr/docusaurus-plugin-content-docs/current/extend/routes.md
index 91172ebd1..143e49011 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/extend/routes.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/extend/routes.md
@@ -68,7 +68,7 @@ class HelloWorldController implements RequestHandlerInterface
}
```
-Controllers are resolved from the [container](https://laravel.com/docs/8.x/container) so you can inject dependencies into their constructors.
+Controllers are resolved from the [container](https://laravel.com/docs/11.x/container) so you can inject dependencies into their constructors.
:::tip What are Controllers?
@@ -108,7 +108,7 @@ $url = $this->url->to('forum')->route('acme.user', ['id' => 123, 'foo' => 'bar']
### Views
-You can inject Laravel's [View](https://laravel.com/docs/8.x/views) factory into your controller. This will allow you to render a [Blade template](https://laravel.com/docs/8.x/blade) into your controller's response.
+You can inject Laravel's [View](https://laravel.com/docs/11.x/views) factory into your controller. This will allow you to render a [Blade template](https://laravel.com/docs/11.x/blade) into your controller's response.
First, you will need to tell the view factory where it can find your extension's view files by adding a `View` extender to `extend.php`:
From 86f6b1cd45a514c9e0ae28b827aa21796934b3e9 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:26 -0500
Subject: [PATCH 117/477] New translations search.md (Spanish)
---
.../current/extend/search.md | 446 +++++++++++++-----
1 file changed, 341 insertions(+), 105 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/extend/search.md b/i18n/es/docusaurus-plugin-content-docs/current/extend/search.md
index 42328c55a..f80f183f0 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/extend/search.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/extend/search.md
@@ -1,54 +1,43 @@
# Search
-Flarum treats searching and filtering as parallel but distinct processes. Which process is used to handle a request to a [`List` API endpoint](/extend/api.md#api-endpoints) depends on the query parameters:
+Flarum comes with a default simple search driver that uses MySQL's fulltext search capabilities. However, Flarum's search system is designed to be extensible, and you can easily add support for more advanced search drivers, such as ElasticSearch.
-- Filtering is applied when the `filter[q]` query param is omitted. Filters represent **structured** queries: for instance, you might want to only retrieve discussions in a certain category, or users who registered before a certain date. Filtering computes results based entirely on `filter[KEY] = VALUE` query parameters.
-- Searching is applied when the `filter[q]` query param is included. Searches represent **unstructured** queries: the user submits an arbitrary string, and data records that "match" it are returned. For instance, you might want to search discussions based on the content of their posts, or users based on their username. Searching computes results based solely on parsing the `filter[q]` query param: all other `filter[KEY] = VALUE` params are ignored when searching. It's important to note that searches aren't entirely unstructured: the dataset being searched can be constrained by gambits (which are very similar to filters, and will be explained later).
+Flarum treats searching and filtering as the same process, but makes a distinction between them depending on the existence of a search query. Flarum will always use the default database search driver when only filters are provided, and will use the model's configured search driver when a search query is provided.
-This distinction is important because searches and filters have very different use cases: filters represent *browsing*: that is, the user is passively looking through some category of content. In contrast, searches represent, well, *searching*: the user is actively looking for content based on some criteria.
+- Filters represent **structured** queries: for instance, you might want to only retrieve discussions in a certain category, or users who registered before a certain date.
+- Searching is applied when the `filter[q]` query param is included. Searches represent **unstructured** queries: the user submits an arbitrary string, and data records that *match* it are returned. For instance, you might want to search discussions based on the content of their posts, or users based on their username. Searching computes results based primarily on the `filter[q]` query param. Searches aren't however entirely unstructured: the dataset being searched can still be constrained by filters.
-Flarum implements searching and filtering via per-model `Searcher` and `Filterer` classes (discussed in more detail below). Both classes accept a [`Flarum\Query\QueryCriteria`](https://api.docs.flarum.org/php/master/flarum/query/querycriteria) instance (a wrapper around the user and query params), and return a [`Flarum\Query\QueryResults`](https://api.docs.flarum.org/php/master/flarum/query/queryresults) instance (a wrapper around an Eloquent model collection). This common interface means that adding search/filter support to models is quite easy.
+This distinction is important because searches and filters have very different use cases: filters represent *browsing*: that is, the user is passively looking through some category of content. In contrast, searches represent, well, *searching*: the user is actively looking for content based on relevance to a query.
-One key advantage of this split is that it allows searching to be implemented via an external service, such as ElasticSearch. For larger communities, this can be significantly more performant and accurate. There isn't a dedicated extender for this yet, so for now, replacing the default Flarum search driver requires overriding the container bindings of `Searcher` classes. This is a highly advanced use case; if you're interested in doing this, please reach out on our [community forums](https://discuss.flarum.org/).
+From this point forward we will refer to both as just searching as the system is one and the same.
-Remember that the [JSON:API schema](https://jsonapi.org/format) is used for all API requests.
+## Searching Process
-:::tip Reuse Code
+This section explains the internal process Flarum goes through when searching. You can skip this section if you're just looking to add searching to a new model, add a filter/mutator, or create a new search driver.
-Often, you might want to use the same class as both a `Filter` and a `Gambit` (both explained below). Your classes can implement both interface; see Flarum core's [`UnreadFilterGambit`](https://github.com/flarum/framework/blob/main/framework/core/src/Discussion/Query/UnreadFilterGambit.php) for an example.
+1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `Searcher` class's `getQuery()` method.
+2. The query is constrained based on:
+ 1. A `Fulltext` filter, which is a special filter that is always applied when a search query is provided. This filter is responsible for the actual searching logic.
+ 2. `Filters` which constrain the results further. These are classes that implement `Flarum\Search\Filter\FilterInterface` and run depending on the request `filter` parameter.
+ * We loop through all `filter[KEY]=VALUE` query params. For each of these, any `Filter`s registered to the model whose `getFilterKey()` method matches the query param `KEY` is applied. `Filter`s can be negated by providing the query param as `filter[-KEY] = VALUE`. Whether a `Filter` is negated is passed to it as an argument: implementing negation is up to the `Filter`s.
+3. [Sorting](https://jsonapi.org/format/#fetching-sorting) and [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
+4. Any *search mutators* are applied. These are callbacks that receive the search state *(a wrapper around the query builder and current user)* and search criteria, and perform some arbitrary changes. All mutators run on any request.
+5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Search\SearchResults` object.
-:::
-
-:::tip Query Builder vs Eloquent Builder
-
-`Filter`s, `Gambit`s, filter mutators, and gambit mutators (all explained below) receive a "state" parameter, which wraps
-
-:::
-
-## Filtering
-
-Filtering constrains queries based on `Filters` (highlighted in code to avoid confusion with the process of filtering), which are classes that implement `Flarum\Filter\FilterInterface` and run depending on query parameters. After filtering is complete, a set of callbacks called "filter mutators" run for every filter request.
-
-When the `filter` method on a `Filterer` class is called, the following process takes place ([relevant code](https://github.com/flarum/framework/blob/main/framework/core/src/Filter/AbstractFilterer.php#L50-L93)):
-
-1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `{MODEL_NAME}Filterer` class's `getQuery()` method.
-2. We loop through all `filter[KEY] = VALUE` query params. For each of these, any `Filter`s registered to the model whose `getFilterKey()` method matches the query param `KEY` is applied. `Filter`s can be negated by providing the query param as `filter[-KEY] = VALUE`. Whether or not a `Filter` is negated is passed to it as an argument: implementing negation is up to the `Filter`s.
-3. [Sorting](https://jsonapi.org/format/#fetching-sorting), [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
-4. Any "filter mutators" are applied. These are callbacks that receive the filter state (a wrapper around the query builder and current user) and filter criteria, and perform some arbitrary changes. All "filter mutators" run on any request.
-5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Query\QueryResults` object.
+## Adding a filter & mutator for a searchable model
-### Modify Filtering for an Existing Model
-
-Let's say you've added a `country` column to the User model, and would like to filter users by country. We'll need to define a custom `Filter`:
+Let's say you've added a `country` column to the User model, and would like to filter users by country. We'll need to define a custom `Filter`. Assuming you want to add this filter to the default database search driver:
```php
-
+ */
class CountryFilter implements FilterInterface
{
public function getFilterKey(): string
@@ -56,147 +45,394 @@ class CountryFilter implements FilterInterface
return 'country';
}
- public function filter(FilterState $filterState, string $filterValue, bool $negate)
+ public function filter(SearchState $state, string $filterValue, bool $negate)
{
$country = trim($filterValue, '"');
- $filterState->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
+ $state->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
}
}
```
-Note that `FilterState` is a wrapper around the Eloquent builder's underlying Query builder and the current user.
+Note that `SearchState` is a wrapper around the Eloquent builder's underlying Query builder and the current user.
-Also, let's pretend that for some reason, we want to omit any users that have a different country from the current user on ANY filter. We can use a "filter mutator" for this:
+Also, let's pretend that for some reason, we want to omit any users that have a different country from the current user on ANY filter. We can use a *search mutator* for this:
```php
-getQuery()->where('users.country', $filterState->getActor()->country);
+ $state->getQuery()->where('users.country', $state->getActor()->country);
}
}
```
-Now, all we need to do is register these via the Filter extender:
+Now, all we need to do is register these via the search driver extender:
```php
- // Other extenders
- (new Extend\Filter(UserFilterer::class))
- ->addFilter(CountryFilter::class)
- ->addFilterMutator(OnlySameCountryFilterMutator::class),
- // Other extenders
-```
+use Flarum\Extend;
+use Flarum\Search\Database\DatabaseSearchDriver;
+use Flarum\User\Search\UserSearcher;
-### Add Filtering to a New Model
+return [
+ // Other extenders..
-To filter a model that doesn't support filtering, you'll need to create a subclass of `Flarum/Filter/AbstractFilterer` for that model. For an example, see core's [UserFilterer](https://github.com/flarum/framework/blob/main/framework/core/src/User/Filter/UserFilterer.php).
+ (new Extend\SearchDriver(DatabaseSearchDriver::class))
+ ->addFilter(UserSearcher::class, CountryFilter::class)
+ ->addMutator(UserSearcher::class, OnlySameCountryFilterMutator::class),
-Then, you'll need to use that filterer in your model's `List` controller. For an example, see core's [ListUsersController](https://github.com/flarum/framework/blob/main/framework/core/src/Api/Controller/ListUsersController.php#L93-L98).
+ // Other extenders..
+];
+```
-## Searching
+## Making a new model searchable
-Searching constrains queries by applying `Gambit`s, which are classes that implement `Flarum\Search\GambitInterface`, based on the `filter[q]` query param. After searching is complete, a set of callbacks called "search mutators" run for every search request.
+If you want to make a non-searchable model searchable *(for instance, your extension adds a new model)*, you'll need to create a searcher class for the model, by implementing the `Flarum\Search\SearcherInterface` interface. Assuming this is meant for the default database search driver, you can instead extend `Flarum\Search\Database\AbstractSearcher`:
-When the `search` method on a `Searcher` class is called, the following process takes place ([relevant code](https://github.com/flarum/framework/blob/main/framework/core/src/Search/AbstractSearcher.php#L55-L79)):
+```php
+namespace YourPackage\Search;
-1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `{MODEL_NAME}Searcher` class's `getQuery()` method.
-2. The `filter[q]` param is split by spaces into "tokens". Each token is matched against the model's registered `Gambit`s (each gambit has a `match` method). For any tokens that match a gambit, that gambit is applied, and the token is removed from the query string. Once all regular `Gambit`s have ran, all remaining unmatched tokens are passed to the model's `FullTextGambit`, which implements the actual searching logic. For example if searching discussions, in the `filter[q]` string `'author:1 hello is:hidden' world`, `author:1` and `is:hidden` would get matched by core's Author and Hidden gambits, and `'hello world'` (the remaining tokens) would be passed to the `DiscussionFulltextGambit`.
-3. [Sorting](https://jsonapi.org/format/#fetching-sorting), [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
-4. Any "search mutators" are applied. These are callbacks that receive the search state (a wrapper around the query builder and current user) and criteria, and perform some arbitrary changes. All "search mutators" run on any request.
-5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Query\QueryResults` object.
+use Flarum\Search\Database\AbstractSearcher;
+use YourPackage\Model\Acme;
-### Modify Searching for an Existing Model
+class AcmeSearcher extends AbstractSearcher
+{
+ public function getQuery(User $actor): Builder
+ {
+ return Acme::query()->select('acmes.*'); // The selection is recommended to avoid conflicts with other extensions.
+ }
+}
+```
-Let's reuse the "country" examples we used above, and see how we'd implement the same things for searching:
+You can optionally create a fulltext filter implementation for actual searching. This is a special filter that is always applied when a search query is provided. For instance, if you want to search Acme models by their `name` column:
```php
-
+ */
+class AcmeFulltextFilter extends AbstractFulltextFilter
{
- public function getGambitPattern(): string
+ public function search(SearchState $state, string $value): void
{
- return 'country:(.+)';
+ $state->getQuery()
+ ->where('acmes.name', 'like', "%$value%");
}
+}
+```
- public function conditions(SearchState $search, array $matches, bool $negate)
- {
- $country = trim($matches[1], '"');
+Then, you'll need to register this searcher via the search driver extender:
+
+```php
+use Flarum\Extend;
+use Flarum\Search\Database\DatabaseSearchDriver;
+
+return [
+ // Other extenders..
+
+ (new Extend\SearchDriver(DatabaseSearchDriver::class))
+ ->addSearcher(Acme::class, AcmeSearcher::class)
+ ->setFullText(AcmeSearcher::class, AcmeFulltextFilter::class),
+
+ // Other extenders..
+];
+```
+
+## Creating a new search driver
- $search->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
+If you want to create a new search driver, you'll need to:
+
+1. First create a driver class that extends `Flarum\Search\AbstractDriver`.
+2. Then for each model that your driver implements searching for, you'll need to create a model searcher class that implements `Flarum\Search\SearcherInterface`.
+3. (*Optionally*) you can create a custom search state class that extends `Flarum\Search\SearchState` to store any additional state you need for your driver.
+4. Refer to the section above for registering a filter and/or a fulltext filter for your model searcher.
+5. Finally, you'll need to register your driver via the `SearchDriver` extender.
+
+```php
+namespace YourPackage\Search;
+
+use Flarum\Search\AbstractDriver;
+
+class AcmeSearchDriver extends AbstractDriver
+{
+ public static function name(): string
+ {
+ return 'your-package-driver-name';
}
}
```
-:::warning No Spaces in Gambit Patterns!
+```php
+use Flarum\Extend;
-Flarum splits the `filter[q]` string into tokens by splitting it at spaces. This means that your custom gambits can NOT use spaces as part of their pattern.
+return [
-:::
+ // Other extenders..
+
+ (new Extend\SearchDriver(AcmeSearchDriver::class))
+ ->addSearcher(Acme::class, AcmeSearcher::class)
+ // Optionally, you can set a fulltext filter for your searcher, a filter and/or a mutator.
+ ->setFullText(AcmeSearcher::class, AcmeFulltextFilter::class)
+ ->addFilter(AcmeSearcher::class, AcmeFilter::class)
+ ->addMutator(AcmeSearcher::class, AcmeMutator::class),
+
+ // Other extenders..
+
+];
+```
+
+Your model searcher and fulltext filter implementations is where the specific logic for your search driver goes. You will want to create an abstract searcher class to reuse the logic for all your model searchers.
+
+```php
+namespace YourPackage\Search;
+
+use Flarum\Search\SearcherInterface;
+use Illuminate\Database\Eloquent\Builder;
-:::tip AbstractRegexGambit
+abstract class AbstractAcmeSearcher implements SearcherInterface
+{
+ public function __construct(
+ protected FilterManager $filters,
+ /** @var array */
+ protected array $mutators
+ ) {
+ }
-All a gambit needs to do is implement `Flarum\Search\GambitInterface`, which receives the search state and a token. It should return if this gambit applies for the given token, and if so, make whatever mutations are necessary to the query builder accessible as `$searchState->getQuery()`.
+ abstract public function getQuery(User $actor): Builder;
-However, for most gambits, the `AbstractRegexGambit` abstract class (used above) should be used as a base class. This makes it a lot simpler to match and apply gambits.
+ public function search(SearchCriteria $criteria): SearchResults
+ {
+ // Your searching logic here.
+ }
+}
+```
+
+:::info
+
+You can check the [default database search driver implementation](https://github.com/flarum/framework/blob/2.x/framework/core/src/Search/Database) for an example of how to implement the searcher.
:::
-Similarly, the search mutator we need is almost identical to the filter mutator from before:
+## Indexing
-```php
-getQuery()->where('users.country', $filterState->getActor()->country);
+ // Delete the models from the index.
+ }
+
+ public function build(): void
+ {
+ // Build the index.
+ }
+
+ public function flush(): void
+ {
+ // Flush the index.
}
}
```
-We can register these via the `SimpleFlarumSearch` extender (in the future, the `Search` extender will be used for registering custom search drivers):
-
```php
- // Other extenders
- (new Extend\SimpleFlarumSearch(UserSearcher::class))
- ->addGambit(CountryGambit::class)
- ->addSearchMutator(OnlySameCountrySearchMutator::class),
- // Other extenders
+use Flarum\Extend;
+
+return [
+
+ // Other extenders..
+
+ (new Extend\SearchIndex())
+ ->indexer(Acme::class, AcmeIndexer::class),
+
+ // Other extenders..
+
+];
+```
+
+:::info
+
+Checkout this [proof of concept elastic search driver](https://github.com/SychO9/flarum-ext-search) for more examples.
+
+:::
+
+## Configuring the driver for a model
+
+You can select which driver a search model can use from the advanced admin page. This page needs to be toggled from the button on the dashboard page tools dropdown:
+
+![Toggle advanced page](https://user-images.githubusercontent.com/20267363/277113270-f2e9c91d-2a29-436b-827f-5c4d20e2ed54.png)
+
+![Advanced page](https://user-images.githubusercontent.com/20267363/277113315-9d75b9a3-f225-4a2b-9f42-8e5b9d13d5e8.png)
+
+
+## Gambits
+
+Gambits are a way of adding filters through the search input of the frontend. The concept of gambits is only relevant to the frontend as they are used to translate string queries into filters and filters back into their string format. For example, the `is:unread` gambit translates to a `filter[unread]` filter, and vice versa.
+
+Gambits are applied any time you call `app.store.find()` and provide a `q` filter. Por ejemplo:
+
+```ts
+app.store.find('discussions', { q: 'is:unread' });
+```
+
+Gambits are automatically shown in the autocomplete options of the global search:
+
+![Global search modal](../assets/global_search_modal.png)
+
+### Basic gambits
+
+To create a new gambit, determine if it is a `key:value` type of gambit, or a boolean `is:` type of gambit. If it is the former, you may create a class that extends `KeyValueGambit`. For example, the `country` column example we used earlier is a `key:value` gambit:
+
+```ts
+import app from 'flarum/common/app';
+import { KeyValueGambit } from 'flarum/common/query/IGambit';
+
+export default class CountryGambit extends KeyValueGambit {
+ key(): string {
+ return app.translator.trans('acme.lib.gambits.users.country.key', {}, true);
+ }
+
+ hint(): string {
+ return app.translator.trans('acme.lib.gambits.users.country.hint', {}, true);
+ }
+
+ filterKey(): string {
+ return 'country';
+ }
+}
+```
+
+The `key` is the localized gambit key, `country` would be the english word used, and other languages can appropriately translate. The key must have no spaces. The `hint` is used for the autocomplete in the global search modal. The implementation will produce a `filter[country]=value` filter. The filter key must not be localized.
+
+If the gambit you are creating is a boolean `is:` type of gambit, you can extend the `BooleanGambit` class. Here is an example from a built-in gambit (The filter key must not be localized.):
+
+```ts
+import app from 'flarum/common/app';
+import { BooleanGambit } from 'flarum/common/query/IGambit';
+
+export default class UnreadGambit extends BooleanGambit {
+ key(): string {
+ return app.translator.trans('core.lib.gambits.discussions.unread.key', {}, true);
+ }
+
+ filterKey(): string {
+ return 'unread';
+ }
+}
+```
+
+:::info No Spaces in Gambit Patterns!
+
+Flarum splits the `filter[q]` string into tokens by splitting it at spaces. This means that your custom gambits can NOT use spaces as part of their pattern.
+
+:::
+
+:::info Use the common frontend
+
+Gambits may be used from both the forum and admin frontends. So you want to make sure your gambit is added within the common frontend.
+
+:::
+
+### Advanced gambits
+
+If neither of the above gambit classes are suitable for your needs, you may directly implement the `IGambit` interface. Your class must implement the following:
+
+###### `type`
+The type of gambit. It can be `key:value` or `grouped`. The `key:value` gambit is a single key with a single value. The `grouped` gambit is a key with multiple values. For example, boolean gambits are grouped, because they are all prefixed with `is:`.
+###### `pattern`
+The regular expression pattern that will be used to match the gambit. The pattern language can be localized. For example, the pattern for the author gambit is `author:(.+)` in English, but `auteur:(.+)` in French.
+###### `toFilter`
+The method to transform a gambit into a filter format. The returned POJO will be combined into the filter POJO. For example, the author gambit will return `{ author: 'username' }`.
+###### `filterKey`
+The server standardised filter key for this gambit. The filter key must not be localized.
+###### `fromFilter`
+The method to transform a filter into a gambit format. The gambit format can be localized.
+###### `suggestion`
+Returns information about how the gambit is structured for the UI. Use localized values. For example, the author gambit will return `{ key: 'author', hint: 'the username of the author' }`.
+###### `predicates`
+Whether this gambit can use logical operators. For example, the tag gambit can be used as such: `tag:foo,bar tag:baz` which translates to `(foo OR bar) AND baz`. The info allows generation of the correct filtering format, which would be:
+```json
+{
+ "tag": [
+ "foo,bar", // OR because of the comma.
+ "baz" // AND because it's a separate item.
+ ]
+}
+```
+The backend filter must be able to handle this format. Checkout the `TagGambit` and `TagFilter` classes for an example.
+###### `enabled`
+Whether this gambit can be used by the actor. Some filters are protected and can only be used by certain actors. For example, the `is:suspended` gambit can only be used by actors with permission to suspend users.
+
+```ts
+enabled(): bool {
+ return !!app.session.user && app.forum.attribute('canSuspendUsers');
+}
```
-### Add Searching to a New Model
+### Registering gambits
-To support searching for a model, you'll need to create a subclass of `Flarum/Search/AbstractSearcher` for that model. For an example, see core's [UserSearcher](https://github.com/flarum/framework/blob/main/framework/core/src/User/Search/UserSearcher.php).
+Once you have created your gambit, you will need to register it. You can do so using the `Search` frontend extender:
-Then, you'll need to use that searcher in your model's `List` controller. For an example, see core's [ListUsersController](https://github.com/flarum/framework/blob/main/framework/core/src/Api/Controller/ListUsersController.php#L93-L98).
+```ts
+import Extend from 'flarum/common/extenders';
+import CountryGambit from './query/users/CountryGambit';
-Every searcher **must** have a fulltext gambit (the logic that actually does the searching). Otherwise, it won't be booted by Flarum, and you'll get an error. See core's [FulltextGambit for users](https://github.com/flarum/framework/blob/main/framework/core/src/User/Search/Gambit/FulltextGambit.php) for an example. You can set (or override) the full text gambit for a searcher via the `SimpleFlarumSearch` extender's `setFullTextGambit()` method.
+// prettier-ignore
+export default [
+ new Extend.Search()
+ .gambit('users', CountryGambit),
+];
+```
+
+### Autocomplete for custom inputs
-### Search Drivers
+If you have a custom input for which you want to provide gambit autocompletion, you may use the `GambitAutocompleteDropdown` wrapper component. The built-in user list admin page uses this component. Here is an example:
-Coming soon!
+```tsx
+import GambitsAutocompleteDropdown from 'flarum/common/components/GambitsAutocompleteDropdown';
+import Input from 'flarum/common/components/Input';
+
+
+
+
+```
-## Frontend Tools
+This will automatically produce an autocomplete dropdown with the appropriate gambits for the `users` resource. The `query` prop is the current search query, and the `onchange` prop is a callback that will be called when the query changes.
-Coming soon!
+![Gambit autocomplete dropdown component](../assets/gambit_autocomplete_dropdown.png)
From eceeaea0525c1c201783f74c2105eadd50cc84ad Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:28 -0500
Subject: [PATCH 118/477] New translations search.md (German)
---
.../current/extend/search.md | 446 +++++++++++++-----
1 file changed, 341 insertions(+), 105 deletions(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/extend/search.md b/i18n/de/docusaurus-plugin-content-docs/current/extend/search.md
index 167372780..855ba6bfa 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/extend/search.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/extend/search.md
@@ -1,54 +1,43 @@
# Searching and Filtering
-Flarum treats searching and filtering as parallel but distinct processes. Which process is used to handle a request to a [`List` API endpoint](/extend/api.md#api-endpoints) depends on the query parameters:
+Flarum comes with a default simple search driver that uses MySQL's fulltext search capabilities. However, Flarum's search system is designed to be extensible, and you can easily add support for more advanced search drivers, such as ElasticSearch.
-- Filtering is applied when the `filter[q]` query param is omitted. Filters represent **structured** queries: for instance, you might want to only retrieve discussions in a certain category, or users who registered before a certain date. Filtering computes results based entirely on `filter[KEY] = VALUE` query parameters.
-- Searching is applied when the `filter[q]` query param is included. Searches represent **unstructured** queries: the user submits an arbitrary string, and data records that "match" it are returned. For instance, you might want to search discussions based on the content of their posts, or users based on their username. Searching computes results based solely on parsing the `filter[q]` query param: all other `filter[KEY] = VALUE` params are ignored when searching. It's important to note that searches aren't entirely unstructured: the dataset being searched can be constrained by gambits (which are very similar to filters, and will be explained later).
+Flarum treats searching and filtering as the same process, but makes a distinction between them depending on the existence of a search query. Flarum will always use the default database search driver when only filters are provided, and will use the model's configured search driver when a search query is provided.
-This distinction is important because searches and filters have very different use cases: filters represent *browsing*: that is, the user is passively looking through some category of content. In contrast, searches represent, well, *searching*: the user is actively looking for content based on some criteria.
+- Filters represent **structured** queries: for instance, you might want to only retrieve discussions in a certain category, or users who registered before a certain date.
+- Searching is applied when the `filter[q]` query param is included. Searches represent **unstructured** queries: the user submits an arbitrary string, and data records that *match* it are returned. For instance, you might want to search discussions based on the content of their posts, or users based on their username. Searching computes results based primarily on the `filter[q]` query param. Searches aren't however entirely unstructured: the dataset being searched can still be constrained by filters.
-Flarum implements searching and filtering via per-model `Searcher` and `Filterer` classes (discussed in more detail below). Both classes accept a [`Flarum\Query\QueryCriteria`](https://api.docs.flarum.org/php/master/flarum/query/querycriteria) instance (a wrapper around the user and query params), and return a [`Flarum\Query\QueryResults`](https://api.docs.flarum.org/php/master/flarum/query/queryresults) instance (a wrapper around an Eloquent model collection). This common interface means that adding search/filter support to models is quite easy.
+This distinction is important because searches and filters have very different use cases: filters represent *browsing*: that is, the user is passively looking through some category of content. In contrast, searches represent, well, *searching*: the user is actively looking for content based on relevance to a query.
-One key advantage of this split is that it allows searching to be implemented via an external service, such as ElasticSearch. For larger communities, this can be significantly more performant and accurate. There isn't a dedicated extender for this yet, so for now, replacing the default Flarum search driver requires overriding the container bindings of `Searcher` classes. This is a highly advanced use case; if you're interested in doing this, please reach out on our [community forums](https://discuss.flarum.org/).
+From this point forward we will refer to both as just searching as the system is one and the same.
-Remember that the [JSON:API schema](https://jsonapi.org/format) is used for all API requests.
+## Searching Process
-:::tip Code wiederverwenden
+This section explains the internal process Flarum goes through when searching. You can skip this section if you're just looking to add searching to a new model, add a filter/mutator, or create a new search driver.
-Often, you might want to use the same class as both a `Filter` and a `Gambit` (both explained below). Your classes can implement both interface; see Flarum core's [`UnreadFilterGambit`](https://github.com/flarum/framework/blob/main/framework/core/src/Discussion/Query/UnreadFilterGambit.php) for an example.
+1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `Searcher` class's `getQuery()` method.
+2. The query is constrained based on:
+ 1. A `Fulltext` filter, which is a special filter that is always applied when a search query is provided. This filter is responsible for the actual searching logic.
+ 2. `Filters` which constrain the results further. These are classes that implement `Flarum\Search\Filter\FilterInterface` and run depending on the request `filter` parameter.
+ * We loop through all `filter[KEY]=VALUE` query params. For each of these, any `Filter`s registered to the model whose `getFilterKey()` method matches the query param `KEY` is applied. `Filter`s can be negated by providing the query param as `filter[-KEY] = VALUE`. Whether a `Filter` is negated is passed to it as an argument: implementing negation is up to the `Filter`s.
+3. [Sorting](https://jsonapi.org/format/#fetching-sorting) and [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
+4. Any *search mutators* are applied. These are callbacks that receive the search state *(a wrapper around the query builder and current user)* and search criteria, and perform some arbitrary changes. All mutators run on any request.
+5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Search\SearchResults` object.
-:::
-
-:::tip Query Builder vs. Eloquent Builder
-
-`Filter`s, `Gambit`s, filter mutators, and gambit mutators (all explained below) receive a "state" parameter, which wraps
-
-:::
-
-## Filtering
-
-Filtering constrains queries based on `Filters` (highlighted in code to avoid confusion with the process of filtering), which are classes that implement `Flarum\Filter\FilterInterface` and run depending on query parameters. After filtering is complete, a set of callbacks called "filter mutators" run for every filter request.
-
-When the `filter` method on a `Filterer` class is called, the following process takes place ([relevant code](https://github.com/flarum/framework/blob/main/framework/core/src/Filter/AbstractFilterer.php#L50-L93)):
-
-1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `{MODEL_NAME}Filterer` class's `getQuery()` method.
-2. We loop through all `filter[KEY] = VALUE` query params. For each of these, any `Filter`s registered to the model whose `getFilterKey()` method matches the query param `KEY` is applied. `Filter`s can be negated by providing the query param as `filter[-KEY] = VALUE`. Whether or not a `Filter` is negated is passed to it as an argument: implementing negation is up to the `Filter`s.
-3. [Sorting](https://jsonapi.org/format/#fetching-sorting), [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
-4. Any "filter mutators" are applied. These are callbacks that receive the filter state (a wrapper around the query builder and current user) and filter criteria, and perform some arbitrary changes. All "filter mutators" run on any request.
-5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Query\QueryResults` object.
+## Adding a filter & mutator for a searchable model
-### Modify Filtering for an Existing Model
-
-Let's say you've added a `country` column to the User model, and would like to filter users by country. We'll need to define a custom `Filter`:
+Let's say you've added a `country` column to the User model, and would like to filter users by country. We'll need to define a custom `Filter`. Assuming you want to add this filter to the default database search driver:
```php
-
+ */
class CountryFilter implements FilterInterface
{
public function getFilterKey(): string
@@ -56,147 +45,394 @@ class CountryFilter implements FilterInterface
return 'country';
}
- public function filter(FilterState $filterState, string $filterValue, bool $negate)
+ public function filter(SearchState $state, string $filterValue, bool $negate)
{
$country = trim($filterValue, '"');
- $filterState->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
+ $state->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
}
}
```
-Note that `FilterState` is a wrapper around the Eloquent builder's underlying Query builder and the current user.
+Note that `SearchState` is a wrapper around the Eloquent builder's underlying Query builder and the current user.
-Also, let's pretend that for some reason, we want to omit any users that have a different country from the current user on ANY filter. We can use a "filter mutator" for this:
+Also, let's pretend that for some reason, we want to omit any users that have a different country from the current user on ANY filter. We can use a *search mutator* for this:
```php
-getQuery()->where('users.country', $filterState->getActor()->country);
+ $state->getQuery()->where('users.country', $state->getActor()->country);
}
}
```
-Now, all we need to do is register these via the Filter extender:
+Now, all we need to do is register these via the search driver extender:
```php
- // Other extenders
- (new Extend\Filter(UserFilterer::class))
- ->addFilter(CountryFilter::class)
- ->addFilterMutator(OnlySameCountryFilterMutator::class),
- // Other extenders
-```
+use Flarum\Extend;
+use Flarum\Search\Database\DatabaseSearchDriver;
+use Flarum\User\Search\UserSearcher;
-### Add Filtering to a New Model
+return [
+ // Other extenders..
-To filter a model that doesn't support filtering, you'll need to create a subclass of `Flarum/Filter/AbstractFilterer` for that model. For an example, see core's [UserFilterer](https://github.com/flarum/framework/blob/main/framework/core/src/User/Filter/UserFilterer.php).
+ (new Extend\SearchDriver(DatabaseSearchDriver::class))
+ ->addFilter(UserSearcher::class, CountryFilter::class)
+ ->addMutator(UserSearcher::class, OnlySameCountryFilterMutator::class),
-Then, you'll need to use that filterer in your model's `List` controller. For an example, see core's [ListUsersController](https://github.com/flarum/framework/blob/main/framework/core/src/Api/Controller/ListUsersController.php#L93-L98).
+ // Other extenders..
+];
+```
-## Searching
+## Making a new model searchable
-Searching constrains queries by applying `Gambit`s, which are classes that implement `Flarum\Search\GambitInterface`, based on the `filter[q]` query param. After searching is complete, a set of callbacks called "search mutators" run for every search request.
+If you want to make a non-searchable model searchable *(for instance, your extension adds a new model)*, you'll need to create a searcher class for the model, by implementing the `Flarum\Search\SearcherInterface` interface. Assuming this is meant for the default database search driver, you can instead extend `Flarum\Search\Database\AbstractSearcher`:
-When the `search` method on a `Searcher` class is called, the following process takes place ([relevant code](https://github.com/flarum/framework/blob/main/framework/core/src/Search/AbstractSearcher.php#L55-L79)):
+```php
+namespace YourPackage\Search;
-1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `{MODEL_NAME}Searcher` class's `getQuery()` method.
-2. The `filter[q]` param is split by spaces into "tokens". Each token is matched against the model's registered `Gambit`s (each gambit has a `match` method). For any tokens that match a gambit, that gambit is applied, and the token is removed from the query string. Once all regular `Gambit`s have ran, all remaining unmatched tokens are passed to the model's `FullTextGambit`, which implements the actual searching logic. For example if searching discussions, in the `filter[q]` string `'author:1 hello is:hidden' world`, `author:1` and `is:hidden` would get matched by core's Author and Hidden gambits, and `'hello world'` (the remaining tokens) would be passed to the `DiscussionFulltextGambit`.
-3. [Sorting](https://jsonapi.org/format/#fetching-sorting), [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
-4. Any "search mutators" are applied. These are callbacks that receive the search state (a wrapper around the query builder and current user) and criteria, and perform some arbitrary changes. All "search mutators" run on any request.
-5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Query\QueryResults` object.
+use Flarum\Search\Database\AbstractSearcher;
+use YourPackage\Model\Acme;
-### Modify Searching for an Existing Model
+class AcmeSearcher extends AbstractSearcher
+{
+ public function getQuery(User $actor): Builder
+ {
+ return Acme::query()->select('acmes.*'); // The selection is recommended to avoid conflicts with other extensions.
+ }
+}
+```
-Let's reuse the "country" examples we used above, and see how we'd implement the same things for searching:
+You can optionally create a fulltext filter implementation for actual searching. This is a special filter that is always applied when a search query is provided. For instance, if you want to search Acme models by their `name` column:
```php
-
+ */
+class AcmeFulltextFilter extends AbstractFulltextFilter
{
- public function getGambitPattern(): string
+ public function search(SearchState $state, string $value): void
{
- return 'country:(.+)';
+ $state->getQuery()
+ ->where('acmes.name', 'like', "%$value%");
}
+}
+```
- public function conditions(SearchState $search, array $matches, bool $negate)
- {
- $country = trim($matches[1], '"');
+Then, you'll need to register this searcher via the search driver extender:
+
+```php
+use Flarum\Extend;
+use Flarum\Search\Database\DatabaseSearchDriver;
+
+return [
+ // Other extenders..
+
+ (new Extend\SearchDriver(DatabaseSearchDriver::class))
+ ->addSearcher(Acme::class, AcmeSearcher::class)
+ ->setFullText(AcmeSearcher::class, AcmeFulltextFilter::class),
+
+ // Other extenders..
+];
+```
+
+## Creating a new search driver
- $search->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
+If you want to create a new search driver, you'll need to:
+
+1. First create a driver class that extends `Flarum\Search\AbstractDriver`.
+2. Then for each model that your driver implements searching for, you'll need to create a model searcher class that implements `Flarum\Search\SearcherInterface`.
+3. (*Optionally*) you can create a custom search state class that extends `Flarum\Search\SearchState` to store any additional state you need for your driver.
+4. Refer to the section above for registering a filter and/or a fulltext filter for your model searcher.
+5. Finally, you'll need to register your driver via the `SearchDriver` extender.
+
+```php
+namespace YourPackage\Search;
+
+use Flarum\Search\AbstractDriver;
+
+class AcmeSearchDriver extends AbstractDriver
+{
+ public static function name(): string
+ {
+ return 'your-package-driver-name';
}
}
```
-:::warning Keine Leerzeichen in Gambit-Mustern!
+```php
+use Flarum\Extend;
-Flarum splits the `filter[q]` string into tokens by splitting it at spaces. This means that your custom gambits can NOT use spaces as part of their pattern.
+return [
-:::
+ // Other extenders..
+
+ (new Extend\SearchDriver(AcmeSearchDriver::class))
+ ->addSearcher(Acme::class, AcmeSearcher::class)
+ // Optionally, you can set a fulltext filter for your searcher, a filter and/or a mutator.
+ ->setFullText(AcmeSearcher::class, AcmeFulltextFilter::class)
+ ->addFilter(AcmeSearcher::class, AcmeFilter::class)
+ ->addMutator(AcmeSearcher::class, AcmeMutator::class),
+
+ // Other extenders..
+
+];
+```
+
+Your model searcher and fulltext filter implementations is where the specific logic for your search driver goes. You will want to create an abstract searcher class to reuse the logic for all your model searchers.
+
+```php
+namespace YourPackage\Search;
+
+use Flarum\Search\SearcherInterface;
+use Illuminate\Database\Eloquent\Builder;
-:::tip AbstractRegexGambit
+abstract class AbstractAcmeSearcher implements SearcherInterface
+{
+ public function __construct(
+ protected FilterManager $filters,
+ /** @var array */
+ protected array $mutators
+ ) {
+ }
-All a gambit needs to do is implement `Flarum\Search\GambitInterface`, which receives the search state and a token. It should return if this gambit applies for the given token, and if so, make whatever mutations are necessary to the query builder accessible as `$searchState->getQuery()`.
+ abstract public function getQuery(User $actor): Builder;
-However, for most gambits, the `AbstractRegexGambit` abstract class (used above) should be used as a base class. This makes it a lot simpler to match and apply gambits.
+ public function search(SearchCriteria $criteria): SearchResults
+ {
+ // Your searching logic here.
+ }
+}
+```
+
+:::info
+
+You can check the [default database search driver implementation](https://github.com/flarum/framework/blob/2.x/framework/core/src/Search/Database) for an example of how to implement the searcher.
:::
-Similarly, the search mutator we need is almost identical to the filter mutator from before:
+## Indexing
-```php
-getQuery()->where('users.country', $filterState->getActor()->country);
+ // Delete the models from the index.
+ }
+
+ public function build(): void
+ {
+ // Build the index.
+ }
+
+ public function flush(): void
+ {
+ // Flush the index.
}
}
```
-We can register these via the `SimpleFlarumSearch` extender (in the future, the `Search` extender will be used for registering custom search drivers):
-
```php
- // Other extenders
- (new Extend\SimpleFlarumSearch(UserSearcher::class))
- ->addGambit(CountryGambit::class)
- ->addSearchMutator(OnlySameCountrySearchMutator::class),
- // Other extenders
+use Flarum\Extend;
+
+return [
+
+ // Other extenders..
+
+ (new Extend\SearchIndex())
+ ->indexer(Acme::class, AcmeIndexer::class),
+
+ // Other extenders..
+
+];
+```
+
+:::info
+
+Checkout this [proof of concept elastic search driver](https://github.com/SychO9/flarum-ext-search) for more examples.
+
+:::
+
+## Configuring the driver for a model
+
+You can select which driver a search model can use from the advanced admin page. This page needs to be toggled from the button on the dashboard page tools dropdown:
+
+![Toggle advanced page](https://user-images.githubusercontent.com/20267363/277113270-f2e9c91d-2a29-436b-827f-5c4d20e2ed54.png)
+
+![Advanced page](https://user-images.githubusercontent.com/20267363/277113315-9d75b9a3-f225-4a2b-9f42-8e5b9d13d5e8.png)
+
+
+## Gambits
+
+Gambits are a way of adding filters through the search input of the frontend. The concept of gambits is only relevant to the frontend as they are used to translate string queries into filters and filters back into their string format. For example, the `is:unread` gambit translates to a `filter[unread]` filter, and vice versa.
+
+Gambits are applied any time you call `app.store.find()` and provide a `q` filter. For example:
+
+```ts
+app.store.find('discussions', { q: 'is:unread' });
+```
+
+Gambits are automatically shown in the autocomplete options of the global search:
+
+![Global search modal](../assets/global_search_modal.png)
+
+### Basic gambits
+
+To create a new gambit, determine if it is a `key:value` type of gambit, or a boolean `is:` type of gambit. If it is the former, you may create a class that extends `KeyValueGambit`. For example, the `country` column example we used earlier is a `key:value` gambit:
+
+```ts
+import app from 'flarum/common/app';
+import { KeyValueGambit } from 'flarum/common/query/IGambit';
+
+export default class CountryGambit extends KeyValueGambit {
+ key(): string {
+ return app.translator.trans('acme.lib.gambits.users.country.key', {}, true);
+ }
+
+ hint(): string {
+ return app.translator.trans('acme.lib.gambits.users.country.hint', {}, true);
+ }
+
+ filterKey(): string {
+ return 'country';
+ }
+}
+```
+
+The `key` is the localized gambit key, `country` would be the english word used, and other languages can appropriately translate. The key must have no spaces. The `hint` is used for the autocomplete in the global search modal. The implementation will produce a `filter[country]=value` filter. The filter key must not be localized.
+
+If the gambit you are creating is a boolean `is:` type of gambit, you can extend the `BooleanGambit` class. Here is an example from a built-in gambit (The filter key must not be localized.):
+
+```ts
+import app from 'flarum/common/app';
+import { BooleanGambit } from 'flarum/common/query/IGambit';
+
+export default class UnreadGambit extends BooleanGambit {
+ key(): string {
+ return app.translator.trans('core.lib.gambits.discussions.unread.key', {}, true);
+ }
+
+ filterKey(): string {
+ return 'unread';
+ }
+}
+```
+
+:::info No Spaces in Gambit Patterns!
+
+Flarum splits the `filter[q]` string into tokens by splitting it at spaces. This means that your custom gambits can NOT use spaces as part of their pattern.
+
+:::
+
+:::info Use the common frontend
+
+Gambits may be used from both the forum and admin frontends. So you want to make sure your gambit is added within the common frontend.
+
+:::
+
+### Advanced gambits
+
+If neither of the above gambit classes are suitable for your needs, you may directly implement the `IGambit` interface. Your class must implement the following:
+
+###### `type`
+The type of gambit. It can be `key:value` or `grouped`. The `key:value` gambit is a single key with a single value. The `grouped` gambit is a key with multiple values. For example, boolean gambits are grouped, because they are all prefixed with `is:`.
+###### `pattern`
+The regular expression pattern that will be used to match the gambit. The pattern language can be localized. For example, the pattern for the author gambit is `author:(.+)` in English, but `auteur:(.+)` in French.
+###### `toFilter`
+The method to transform a gambit into a filter format. The returned POJO will be combined into the filter POJO. For example, the author gambit will return `{ author: 'username' }`.
+###### `filterKey`
+The server standardised filter key for this gambit. The filter key must not be localized.
+###### `fromFilter`
+The method to transform a filter into a gambit format. The gambit format can be localized.
+###### `suggestion`
+Returns information about how the gambit is structured for the UI. Use localized values. For example, the author gambit will return `{ key: 'author', hint: 'the username of the author' }`.
+###### `predicates`
+Whether this gambit can use logical operators. For example, the tag gambit can be used as such: `tag:foo,bar tag:baz` which translates to `(foo OR bar) AND baz`. The info allows generation of the correct filtering format, which would be:
+```json
+{
+ "tag": [
+ "foo,bar", // OR because of the comma.
+ "baz" // AND because it's a separate item.
+ ]
+}
+```
+The backend filter must be able to handle this format. Checkout the `TagGambit` and `TagFilter` classes for an example.
+###### `enabled`
+Whether this gambit can be used by the actor. Some filters are protected and can only be used by certain actors. For example, the `is:suspended` gambit can only be used by actors with permission to suspend users.
+
+```ts
+enabled(): bool {
+ return !!app.session.user && app.forum.attribute('canSuspendUsers');
+}
```
-### Add Searching to a New Model
+### Registering gambits
-To support searching for a model, you'll need to create a subclass of `Flarum/Search/AbstractSearcher` for that model. For an example, see core's [UserSearcher](https://github.com/flarum/framework/blob/main/framework/core/src/User/Search/UserSearcher.php).
+Once you have created your gambit, you will need to register it. You can do so using the `Search` frontend extender:
-Then, you'll need to use that searcher in your model's `List` controller. For an example, see core's [ListUsersController](https://github.com/flarum/framework/blob/main/framework/core/src/Api/Controller/ListUsersController.php#L93-L98).
+```ts
+import Extend from 'flarum/common/extenders';
+import CountryGambit from './query/users/CountryGambit';
-Every searcher **must** have a fulltext gambit (the logic that actually does the searching). Otherwise, it won't be booted by Flarum, and you'll get an error. See core's [FulltextGambit for users](https://github.com/flarum/framework/blob/main/framework/core/src/User/Search/Gambit/FulltextGambit.php) for an example. You can set (or override) the full text gambit for a searcher via the `SimpleFlarumSearch` extender's `setFullTextGambit()` method.
+// prettier-ignore
+export default [
+ new Extend.Search()
+ .gambit('users', CountryGambit),
+];
+```
+
+### Autocomplete for custom inputs
-### Search Drivers
+If you have a custom input for which you want to provide gambit autocompletion, you may use the `GambitAutocompleteDropdown` wrapper component. The built-in user list admin page uses this component. Here is an example:
-Coming soon!
+```tsx
+import GambitsAutocompleteDropdown from 'flarum/common/components/GambitsAutocompleteDropdown';
+import Input from 'flarum/common/components/Input';
+
+
+
+
+```
-## Frontend Tools
+This will automatically produce an autocomplete dropdown with the appropriate gambits for the `users` resource. The `query` prop is the current search query, and the `onchange` prop is a callback that will be called when the query changes.
-Coming soon!
+![Gambit autocomplete dropdown component](../assets/gambit_autocomplete_dropdown.png)
From 4179bd901576ac3cd64460f896775b0c7acf2976 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:29 -0500
Subject: [PATCH 119/477] New translations search.md (Italian)
---
.../current/extend/search.md | 446 +++++++++++++-----
1 file changed, 341 insertions(+), 105 deletions(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/extend/search.md b/i18n/it/docusaurus-plugin-content-docs/current/extend/search.md
index 3872f2975..45a5fada5 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/extend/search.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/extend/search.md
@@ -1,54 +1,43 @@
# Cerca
-Flarum tratta la ricerca e il filtraggio come processi paralleli ma distinti. Quale processo viene utilizzato per gestire una richiesta a [`List` API endpoint](/extend/api.md#api-endpoints) dipende dai parametri della query:
+Flarum comes with a default simple search driver that uses MySQL's fulltext search capabilities. However, Flarum's search system is designed to be extensible, and you can easily add support for more advanced search drivers, such as ElasticSearch.
-- Il filtro viene applicato quando il parametro della query `filter[q]` viene omesso. I filtri rappresentano **query strutturate**: per esempio, potresti voler recuperare solo le discussioni in una determinata categoria, o gli utenti che si sono registrati prima di una certa data. Filtrando i risultati dei calcoli basati interamente sui parametri `filter[KEY] = VALORE` query.
-- La ricerca viene applicata quando il `filter[q]` query param è incluso. Le ricerche rappresentano **query non strutturate** : l'utente invia una stringa arbitraria e i record di dati che "corrispondono" sono restituiti. For instance, you might want to search discussions based on the content of their posts, or users based on their username. Ricerca dei risultati dei calcoli basata esclusivamente sull'analisi del parametro `filter[q]`: tutti gli altri `filter[KEY] = VALUE` vengono ignorati durante la ricerca. È importante notare che le ricerche non sono completamente strutturate: il set di dati ricercato può essere vincolato dai gambits (che sono molto simili ai filtri, e li vedremo più avanti).
+Flarum treats searching and filtering as the same process, but makes a distinction between them depending on the existence of a search query. Flarum will always use the default database search driver when only filters are provided, and will use the model's configured search driver when a search query is provided.
-This distinction is important because searches and filters have very different use cases: filters represent *browsing*: that is, the user is passively looking through some category of content. In contrast, searches represent, well, *searching*: the user is actively looking for content based on some criteria.
+- I filtri rappresentano **query strutturate**: per esempio, potresti voler recuperare solo le discussioni in una determinata categoria, o gli utenti che si sono registrati prima di una certa data.
+- La ricerca viene applicata quando il `filter[q]` query param è incluso. Searches represent **unstructured** queries: the user submits an arbitrary string, and data records that *match* it are returned. For instance, you might want to search discussions based on the content of their posts, or users based on their username. Searching computes results based primarily on the `filter[q]` query param. Searches aren't however entirely unstructured: the dataset being searched can still be constrained by filters.
-Flarum implements searching and filtering via per-model `Searcher` and `Filterer` classes (discussed in more detail below). Both classes accept a [`Flarum\Query\QueryCriteria`](https://api.docs.flarum.org/php/master/flarum/query/querycriteria) instance (a wrapper around the user and query params), and return a [`Flarum\Query\QueryResults`](https://api.docs.flarum.org/php/master/flarum/query/queryresults) instance (a wrapper around an Eloquent model collection). This common interface means that adding search/filter support to models is quite easy.
+This distinction is important because searches and filters have very different use cases: filters represent *browsing*: that is, the user is passively looking through some category of content. In contrast, searches represent, well, *searching*: the user is actively looking for content based on relevance to a query.
-One key advantage of this split is that it allows searching to be implemented via an external service, such as ElasticSearch. For larger communities, this can be significantly more performant and accurate. There isn't a dedicated extender for this yet, so for now, replacing the default Flarum search driver requires overriding the container bindings of `Searcher` classes. This is a highly advanced use case; if you're interested in doing this, please reach out on our [community forums](https://discuss.flarum.org/).
+From this point forward we will refer to both as just searching as the system is one and the same.
-Remember that the [JSON:API schema](https://jsonapi.org/format) is used for all API requests.
+## Searching Process
-:::tip Reuse Code
+This section explains the internal process Flarum goes through when searching. You can skip this section if you're just looking to add searching to a new model, add a filter/mutator, or create a new search driver.
-Often, you might want to use the same class as both a `Filter` and a `Gambit` (both explained below). Your classes can implement both interface; see Flarum core's [`UnreadFilterGambit`](https://github.com/flarum/framework/blob/main/framework/core/src/Discussion/Query/UnreadFilterGambit.php) for an example.
+1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `Searcher` class's `getQuery()` method.
+2. The query is constrained based on:
+ 1. A `Fulltext` filter, which is a special filter that is always applied when a search query is provided. This filter is responsible for the actual searching logic.
+ 2. `Filters` which constrain the results further. These are classes that implement `Flarum\Search\Filter\FilterInterface` and run depending on the request `filter` parameter.
+ * We loop through all `filter[KEY]=VALUE` query params. For each of these, any `Filter`s registered to the model whose `getFilterKey()` method matches the query param `KEY` is applied. `Filter`s can be negated by providing the query param as `filter[-KEY] = VALUE`. Whether a `Filter` is negated is passed to it as an argument: implementing negation is up to the `Filter`s.
+3. [Sorting](https://jsonapi.org/format/#fetching-sorting) and [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
+4. Any *search mutators* are applied. These are callbacks that receive the search state *(a wrapper around the query builder and current user)* and search criteria, and perform some arbitrary changes. All mutators run on any request.
+5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Search\SearchResults` object.
-:::
-
-:::tip Query Builder vs Eloquent Builder
-
-`Filter`s, `Gambit`s, filter mutators, and gambit mutators (all explained below) receive a "state" parameter, which wraps
-
-:::
-
-## Filtering
-
-Filtering constrains queries based on `Filters` (highlighted in code to avoid confusion with the process of filtering), which are classes that implement `Flarum\Filter\FilterInterface` and run depending on query parameters. After filtering is complete, a set of callbacks called "filter mutators" run for every filter request.
-
-When the `filter` method on a `Filterer` class is called, the following process takes place ([relevant code](https://github.com/flarum/framework/blob/main/framework/core/src/Filter/AbstractFilterer.php#L50-L93)):
-
-1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `{MODEL_NAME}Filterer` class's `getQuery()` method.
-2. We loop through all `filter[KEY] = VALUE` query params. For each of these, any `Filter`s registered to the model whose `getFilterKey()` method matches the query param `KEY` is applied. `Filter`s can be negated by providing the query param as `filter[-KEY] = VALUE`. Whether or not a `Filter` is negated is passed to it as an argument: implementing negation is up to the `Filter`s.
-3. [Sorting](https://jsonapi.org/format/#fetching-sorting), [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
-4. Any "filter mutators" are applied. These are callbacks that receive the filter state (a wrapper around the query builder and current user) and filter criteria, and perform some arbitrary changes. All "filter mutators" run on any request.
-5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Query\QueryResults` object.
+## Adding a filter & mutator for a searchable model
-### Modify Filtering for an Existing Model
-
-Let's say you've added a `country` column to the User model, and would like to filter users by country. We'll need to define a custom `Filter`:
+Let's say you've added a `country` column to the User model, and would like to filter users by country. We'll need to define a custom `Filter`. Assuming you want to add this filter to the default database search driver:
```php
-
+ */
class CountryFilter implements FilterInterface
{
public function getFilterKey(): string
@@ -56,147 +45,394 @@ class CountryFilter implements FilterInterface
return 'country';
}
- public function filter(FilterState $filterState, string $filterValue, bool $negate)
+ public function filter(SearchState $state, string $filterValue, bool $negate)
{
$country = trim($filterValue, '"');
- $filterState->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
+ $state->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
}
}
```
-Note that `FilterState` is a wrapper around the Eloquent builder's underlying Query builder and the current user.
+Note that `SearchState` is a wrapper around the Eloquent builder's underlying Query builder and the current user.
-Also, let's pretend that for some reason, we want to omit any users that have a different country from the current user on ANY filter. We can use a "filter mutator" for this:
+Also, let's pretend that for some reason, we want to omit any users that have a different country from the current user on ANY filter. We can use a *search mutator* for this:
```php
-getQuery()->where('users.country', $filterState->getActor()->country);
+ $state->getQuery()->where('users.country', $state->getActor()->country);
}
}
```
-Now, all we need to do is register these via the Filter extender:
+Now, all we need to do is register these via the search driver extender:
```php
- // Other extenders
- (new Extend\Filter(UserFilterer::class))
- ->addFilter(CountryFilter::class)
- ->addFilterMutator(OnlySameCountryFilterMutator::class),
- // Other extenders
-```
+use Flarum\Extend;
+use Flarum\Search\Database\DatabaseSearchDriver;
+use Flarum\User\Search\UserSearcher;
-### Add Filtering to a New Model
+return [
+ // Other extenders..
-To filter a model that doesn't support filtering, you'll need to create a subclass of `Flarum/Filter/AbstractFilterer` for that model. For an example, see core's [UserFilterer](https://github.com/flarum/framework/blob/main/framework/core/src/User/Filter/UserFilterer.php).
+ (new Extend\SearchDriver(DatabaseSearchDriver::class))
+ ->addFilter(UserSearcher::class, CountryFilter::class)
+ ->addMutator(UserSearcher::class, OnlySameCountryFilterMutator::class),
-Then, you'll need to use that filterer in your model's `List` controller. For an example, see core's [ListUsersController](https://github.com/flarum/framework/blob/main/framework/core/src/Api/Controller/ListUsersController.php#L93-L98).
+ // Other extenders..
+];
+```
-## Searching
+## Making a new model searchable
-Searching constrains queries by applying `Gambit`s, which are classes that implement `Flarum\Search\GambitInterface`, based on the `filter[q]` query param. After searching is complete, a set of callbacks called "search mutators" run for every search request.
+If you want to make a non-searchable model searchable *(for instance, your extension adds a new model)*, you'll need to create a searcher class for the model, by implementing the `Flarum\Search\SearcherInterface` interface. Assuming this is meant for the default database search driver, you can instead extend `Flarum\Search\Database\AbstractSearcher`:
-When the `search` method on a `Searcher` class is called, the following process takes place ([relevant code](https://github.com/flarum/framework/blob/main/framework/core/src/Search/AbstractSearcher.php#L55-L79)):
+```php
+namespace YourPackage\Search;
-1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `{MODEL_NAME}Searcher` class's `getQuery()` method.
-2. The `filter[q]` param is split by spaces into "tokens". Each token is matched against the model's registered `Gambit`s (each gambit has a `match` method). For any tokens that match a gambit, that gambit is applied, and the token is removed from the query string. Once all regular `Gambit`s have ran, all remaining unmatched tokens are passed to the model's `FullTextGambit`, which implements the actual searching logic. For example if searching discussions, in the `filter[q]` string `'author:1 hello is:hidden' world`, `author:1` and `is:hidden` would get matched by core's Author and Hidden gambits, and `'hello world'` (the remaining tokens) would be passed to the `DiscussionFulltextGambit`.
-3. [Sorting](https://jsonapi.org/format/#fetching-sorting), [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
-4. Any "search mutators" are applied. These are callbacks that receive the search state (a wrapper around the query builder and current user) and criteria, and perform some arbitrary changes. All "search mutators" run on any request.
-5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Query\QueryResults` object.
+use Flarum\Search\Database\AbstractSearcher;
+use YourPackage\Model\Acme;
-### Modify Searching for an Existing Model
+class AcmeSearcher extends AbstractSearcher
+{
+ public function getQuery(User $actor): Builder
+ {
+ return Acme::query()->select('acmes.*'); // The selection is recommended to avoid conflicts with other extensions.
+ }
+}
+```
-Let's reuse the "country" examples we used above, and see how we'd implement the same things for searching:
+You can optionally create a fulltext filter implementation for actual searching. This is a special filter that is always applied when a search query is provided. For instance, if you want to search Acme models by their `name` column:
```php
-
+ */
+class AcmeFulltextFilter extends AbstractFulltextFilter
{
- public function getGambitPattern(): string
+ public function search(SearchState $state, string $value): void
{
- return 'country:(.+)';
+ $state->getQuery()
+ ->where('acmes.name', 'like', "%$value%");
}
+}
+```
- public function conditions(SearchState $search, array $matches, bool $negate)
- {
- $country = trim($matches[1], '"');
+Then, you'll need to register this searcher via the search driver extender:
+
+```php
+use Flarum\Extend;
+use Flarum\Search\Database\DatabaseSearchDriver;
+
+return [
+ // Other extenders..
+
+ (new Extend\SearchDriver(DatabaseSearchDriver::class))
+ ->addSearcher(Acme::class, AcmeSearcher::class)
+ ->setFullText(AcmeSearcher::class, AcmeFulltextFilter::class),
+
+ // Other extenders..
+];
+```
+
+## Creating a new search driver
- $search->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
+If you want to create a new search driver, you'll need to:
+
+1. First create a driver class that extends `Flarum\Search\AbstractDriver`.
+2. Then for each model that your driver implements searching for, you'll need to create a model searcher class that implements `Flarum\Search\SearcherInterface`.
+3. (*Optionally*) you can create a custom search state class that extends `Flarum\Search\SearchState` to store any additional state you need for your driver.
+4. Refer to the section above for registering a filter and/or a fulltext filter for your model searcher.
+5. Finally, you'll need to register your driver via the `SearchDriver` extender.
+
+```php
+namespace YourPackage\Search;
+
+use Flarum\Search\AbstractDriver;
+
+class AcmeSearchDriver extends AbstractDriver
+{
+ public static function name(): string
+ {
+ return 'your-package-driver-name';
}
}
```
-:::warning No Spaces in Gambit Patterns!
+```php
+use Flarum\Extend;
-Flarum splits the `filter[q]` string into tokens by splitting it at spaces. This means that your custom gambits can NOT use spaces as part of their pattern.
+return [
-:::
+ // Other extenders..
+
+ (new Extend\SearchDriver(AcmeSearchDriver::class))
+ ->addSearcher(Acme::class, AcmeSearcher::class)
+ // Optionally, you can set a fulltext filter for your searcher, a filter and/or a mutator.
+ ->setFullText(AcmeSearcher::class, AcmeFulltextFilter::class)
+ ->addFilter(AcmeSearcher::class, AcmeFilter::class)
+ ->addMutator(AcmeSearcher::class, AcmeMutator::class),
+
+ // Other extenders..
+
+];
+```
+
+Your model searcher and fulltext filter implementations is where the specific logic for your search driver goes. You will want to create an abstract searcher class to reuse the logic for all your model searchers.
+
+```php
+namespace YourPackage\Search;
+
+use Flarum\Search\SearcherInterface;
+use Illuminate\Database\Eloquent\Builder;
-:::tip AbstractRegexGambit
+abstract class AbstractAcmeSearcher implements SearcherInterface
+{
+ public function __construct(
+ protected FilterManager $filters,
+ /** @var array */
+ protected array $mutators
+ ) {
+ }
-All a gambit needs to do is implement `Flarum\Search\GambitInterface`, which receives the search state and a token. It should return if this gambit applies for the given token, and if so, make whatever mutations are necessary to the query builder accessible as `$searchState->getQuery()`.
+ abstract public function getQuery(User $actor): Builder;
-However, for most gambits, the `AbstractRegexGambit` abstract class (used above) should be used as a base class. This makes it a lot simpler to match and apply gambits.
+ public function search(SearchCriteria $criteria): SearchResults
+ {
+ // Your searching logic here.
+ }
+}
+```
+
+:::info
+
+You can check the [default database search driver implementation](https://github.com/flarum/framework/blob/2.x/framework/core/src/Search/Database) for an example of how to implement the searcher.
:::
-Similarly, the search mutator we need is almost identical to the filter mutator from before:
+## Indexing
-```php
-getQuery()->where('users.country', $filterState->getActor()->country);
+ // Delete the models from the index.
+ }
+
+ public function build(): void
+ {
+ // Build the index.
+ }
+
+ public function flush(): void
+ {
+ // Flush the index.
}
}
```
-We can register these via the `SimpleFlarumSearch` extender (in the future, the `Search` extender will be used for registering custom search drivers):
-
```php
- // Other extenders
- (new Extend\SimpleFlarumSearch(UserSearcher::class))
- ->addGambit(CountryGambit::class)
- ->addSearchMutator(OnlySameCountrySearchMutator::class),
- // Other extenders
+use Flarum\Extend;
+
+return [
+
+ // Other extenders..
+
+ (new Extend\SearchIndex())
+ ->indexer(Acme::class, AcmeIndexer::class),
+
+ // Other extenders..
+
+];
+```
+
+:::info
+
+Checkout this [proof of concept elastic search driver](https://github.com/SychO9/flarum-ext-search) for more examples.
+
+:::
+
+## Configuring the driver for a model
+
+You can select which driver a search model can use from the advanced admin page. This page needs to be toggled from the button on the dashboard page tools dropdown:
+
+![Toggle advanced page](https://user-images.githubusercontent.com/20267363/277113270-f2e9c91d-2a29-436b-827f-5c4d20e2ed54.png)
+
+![Advanced page](https://user-images.githubusercontent.com/20267363/277113315-9d75b9a3-f225-4a2b-9f42-8e5b9d13d5e8.png)
+
+
+## Gambits
+
+Gambits are a way of adding filters through the search input of the frontend. The concept of gambits is only relevant to the frontend as they are used to translate string queries into filters and filters back into their string format. For example, the `is:unread` gambit translates to a `filter[unread]` filter, and vice versa.
+
+Gambits are applied any time you call `app.store.find()` and provide a `q` filter. Per esempio:
+
+```ts
+app.store.find('discussions', { q: 'is:unread' });
+```
+
+Gambits are automatically shown in the autocomplete options of the global search:
+
+![Global search modal](../assets/global_search_modal.png)
+
+### Basic gambits
+
+To create a new gambit, determine if it is a `key:value` type of gambit, or a boolean `is:` type of gambit. If it is the former, you may create a class that extends `KeyValueGambit`. For example, the `country` column example we used earlier is a `key:value` gambit:
+
+```ts
+import app from 'flarum/common/app';
+import { KeyValueGambit } from 'flarum/common/query/IGambit';
+
+export default class CountryGambit extends KeyValueGambit {
+ key(): string {
+ return app.translator.trans('acme.lib.gambits.users.country.key', {}, true);
+ }
+
+ hint(): string {
+ return app.translator.trans('acme.lib.gambits.users.country.hint', {}, true);
+ }
+
+ filterKey(): string {
+ return 'country';
+ }
+}
+```
+
+The `key` is the localized gambit key, `country` would be the english word used, and other languages can appropriately translate. The key must have no spaces. The `hint` is used for the autocomplete in the global search modal. The implementation will produce a `filter[country]=value` filter. The filter key must not be localized.
+
+If the gambit you are creating is a boolean `is:` type of gambit, you can extend the `BooleanGambit` class. Here is an example from a built-in gambit (The filter key must not be localized.):
+
+```ts
+import app from 'flarum/common/app';
+import { BooleanGambit } from 'flarum/common/query/IGambit';
+
+export default class UnreadGambit extends BooleanGambit {
+ key(): string {
+ return app.translator.trans('core.lib.gambits.discussions.unread.key', {}, true);
+ }
+
+ filterKey(): string {
+ return 'unread';
+ }
+}
+```
+
+:::info No Spaces in Gambit Patterns!
+
+Flarum splits the `filter[q]` string into tokens by splitting it at spaces. This means that your custom gambits can NOT use spaces as part of their pattern.
+
+:::
+
+:::info Use the common frontend
+
+Gambits may be used from both the forum and admin frontends. So you want to make sure your gambit is added within the common frontend.
+
+:::
+
+### Advanced gambits
+
+If neither of the above gambit classes are suitable for your needs, you may directly implement the `IGambit` interface. Your class must implement the following:
+
+###### `type`
+The type of gambit. It can be `key:value` or `grouped`. The `key:value` gambit is a single key with a single value. The `grouped` gambit is a key with multiple values. For example, boolean gambits are grouped, because they are all prefixed with `is:`.
+###### `pattern`
+The regular expression pattern that will be used to match the gambit. The pattern language can be localized. For example, the pattern for the author gambit is `author:(.+)` in English, but `auteur:(.+)` in French.
+###### `toFilter`
+The method to transform a gambit into a filter format. The returned POJO will be combined into the filter POJO. For example, the author gambit will return `{ author: 'username' }`.
+###### `filterKey`
+The server standardised filter key for this gambit. The filter key must not be localized.
+###### `fromFilter`
+The method to transform a filter into a gambit format. The gambit format can be localized.
+###### `suggestion`
+Returns information about how the gambit is structured for the UI. Use localized values. For example, the author gambit will return `{ key: 'author', hint: 'the username of the author' }`.
+###### `predicates`
+Whether this gambit can use logical operators. For example, the tag gambit can be used as such: `tag:foo,bar tag:baz` which translates to `(foo OR bar) AND baz`. The info allows generation of the correct filtering format, which would be:
+```json
+{
+ "tag": [
+ "foo,bar", // OR because of the comma.
+ "baz" // AND because it's a separate item.
+ ]
+}
+```
+The backend filter must be able to handle this format. Checkout the `TagGambit` and `TagFilter` classes for an example.
+###### `enabled`
+Whether this gambit can be used by the actor. Some filters are protected and can only be used by certain actors. For example, the `is:suspended` gambit can only be used by actors with permission to suspend users.
+
+```ts
+enabled(): bool {
+ return !!app.session.user && app.forum.attribute('canSuspendUsers');
+}
```
-### Add Searching to a New Model
+### Registering gambits
-To support searching for a model, you'll need to create a subclass of `Flarum/Search/AbstractSearcher` for that model. For an example, see core's [UserSearcher](https://github.com/flarum/framework/blob/main/framework/core/src/User/Search/UserSearcher.php).
+Once you have created your gambit, you will need to register it. You can do so using the `Search` frontend extender:
-Then, you'll need to use that searcher in your model's `List` controller. For an example, see core's [ListUsersController](https://github.com/flarum/framework/blob/main/framework/core/src/Api/Controller/ListUsersController.php#L93-L98).
+```ts
+import Extend from 'flarum/common/extenders';
+import CountryGambit from './query/users/CountryGambit';
-Every searcher **must** have a fulltext gambit (the logic that actually does the searching). Otherwise, it won't be booted by Flarum, and you'll get an error. See core's [FulltextGambit for users](https://github.com/flarum/framework/blob/main/framework/core/src/User/Search/Gambit/FulltextGambit.php) for an example. You can set (or override) the full text gambit for a searcher via the `SimpleFlarumSearch` extender's `setFullTextGambit()` method.
+// prettier-ignore
+export default [
+ new Extend.Search()
+ .gambit('users', CountryGambit),
+];
+```
+
+### Autocomplete for custom inputs
-### Search Drivers
+If you have a custom input for which you want to provide gambit autocompletion, you may use the `GambitAutocompleteDropdown` wrapper component. The built-in user list admin page uses this component. Here is an example:
-Coming soon!
+```tsx
+import GambitsAutocompleteDropdown from 'flarum/common/components/GambitsAutocompleteDropdown';
+import Input from 'flarum/common/components/Input';
+
+
+
+
+```
-## Frontend Tools
+This will automatically produce an autocomplete dropdown with the appropriate gambits for the `users` resource. The `query` prop is the current search query, and the `onchange` prop is a callback that will be called when the query changes.
-Coming soon!
+![Gambit autocomplete dropdown component](../assets/gambit_autocomplete_dropdown.png)
From 928d6cf6f20ccde4c7b88b8625684ae9e8982217 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:30 -0500
Subject: [PATCH 120/477] New translations search.md (Turkish)
---
.../current/extend/search.md | 446 +++++++++++++-----
1 file changed, 341 insertions(+), 105 deletions(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/extend/search.md b/i18n/tr/docusaurus-plugin-content-docs/current/extend/search.md
index 19486a0fd..a5e953e48 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/extend/search.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/extend/search.md
@@ -1,54 +1,43 @@
# Arama
-Flarum treats searching and filtering as parallel but distinct processes. Which process is used to handle a request to a [`List` API endpoint](/extend/api.md#api-endpoints) depends on the query parameters:
+Flarum comes with a default simple search driver that uses MySQL's fulltext search capabilities. However, Flarum's search system is designed to be extensible, and you can easily add support for more advanced search drivers, such as ElasticSearch.
-- Filtering is applied when the `filter[q]` query param is omitted. Filters represent **structured** queries: for instance, you might want to only retrieve discussions in a certain category, or users who registered before a certain date. Filtering computes results based entirely on `filter[KEY] = VALUE` query parameters.
-- Searching is applied when the `filter[q]` query param is included. Searches represent **unstructured** queries: the user submits an arbitrary string, and data records that "match" it are returned. For instance, you might want to search discussions based on the content of their posts, or users based on their username. Searching computes results based solely on parsing the `filter[q]` query param: all other `filter[KEY] = VALUE` params are ignored when searching. It's important to note that searches aren't entirely unstructured: the dataset being searched can be constrained by gambits (which are very similar to filters, and will be explained later).
+Flarum treats searching and filtering as the same process, but makes a distinction between them depending on the existence of a search query. Flarum will always use the default database search driver when only filters are provided, and will use the model's configured search driver when a search query is provided.
-This distinction is important because searches and filters have very different use cases: filters represent *browsing*: that is, the user is passively looking through some category of content. In contrast, searches represent, well, *searching*: the user is actively looking for content based on some criteria.
+- Filters represent **structured** queries: for instance, you might want to only retrieve discussions in a certain category, or users who registered before a certain date.
+- Searching is applied when the `filter[q]` query param is included. Searches represent **unstructured** queries: the user submits an arbitrary string, and data records that *match* it are returned. For instance, you might want to search discussions based on the content of their posts, or users based on their username. Searching computes results based primarily on the `filter[q]` query param. Searches aren't however entirely unstructured: the dataset being searched can still be constrained by filters.
-Flarum implements searching and filtering via per-model `Searcher` and `Filterer` classes (discussed in more detail below). Both classes accept a [`Flarum\Query\QueryCriteria`](https://api.docs.flarum.org/php/master/flarum/query/querycriteria) instance (a wrapper around the user and query params), and return a [`Flarum\Query\QueryResults`](https://api.docs.flarum.org/php/master/flarum/query/queryresults) instance (a wrapper around an Eloquent model collection). This common interface means that adding search/filter support to models is quite easy.
+This distinction is important because searches and filters have very different use cases: filters represent *browsing*: that is, the user is passively looking through some category of content. In contrast, searches represent, well, *searching*: the user is actively looking for content based on relevance to a query.
-One key advantage of this split is that it allows searching to be implemented via an external service, such as ElasticSearch. For larger communities, this can be significantly more performant and accurate. There isn't a dedicated extender for this yet, so for now, replacing the default Flarum search driver requires overriding the container bindings of `Searcher` classes. This is a highly advanced use case; if you're interested in doing this, please reach out on our [community forums](https://discuss.flarum.org/).
+From this point forward we will refer to both as just searching as the system is one and the same.
-Remember that the [JSON:API schema](https://jsonapi.org/format) is used for all API requests.
+## Searching Process
-:::tip Reuse Code
+This section explains the internal process Flarum goes through when searching. You can skip this section if you're just looking to add searching to a new model, add a filter/mutator, or create a new search driver.
-Often, you might want to use the same class as both a `Filter` and a `Gambit` (both explained below). Your classes can implement both interface; see Flarum core's [`UnreadFilterGambit`](https://github.com/flarum/framework/blob/main/framework/core/src/Discussion/Query/UnreadFilterGambit.php) for an example.
+1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `Searcher` class's `getQuery()` method.
+2. The query is constrained based on:
+ 1. A `Fulltext` filter, which is a special filter that is always applied when a search query is provided. This filter is responsible for the actual searching logic.
+ 2. `Filters` which constrain the results further. These are classes that implement `Flarum\Search\Filter\FilterInterface` and run depending on the request `filter` parameter.
+ * We loop through all `filter[KEY]=VALUE` query params. For each of these, any `Filter`s registered to the model whose `getFilterKey()` method matches the query param `KEY` is applied. `Filter`s can be negated by providing the query param as `filter[-KEY] = VALUE`. Whether a `Filter` is negated is passed to it as an argument: implementing negation is up to the `Filter`s.
+3. [Sorting](https://jsonapi.org/format/#fetching-sorting) and [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
+4. Any *search mutators* are applied. These are callbacks that receive the search state *(a wrapper around the query builder and current user)* and search criteria, and perform some arbitrary changes. All mutators run on any request.
+5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Search\SearchResults` object.
-:::
-
-:::tip Query Builder vs Eloquent Builder
-
-`Filter`s, `Gambit`s, filter mutators, and gambit mutators (all explained below) receive a "state" parameter, which wraps
-
-:::
-
-## Filtering
-
-Filtering constrains queries based on `Filters` (highlighted in code to avoid confusion with the process of filtering), which are classes that implement `Flarum\Filter\FilterInterface` and run depending on query parameters. After filtering is complete, a set of callbacks called "filter mutators" run for every filter request.
-
-When the `filter` method on a `Filterer` class is called, the following process takes place ([relevant code](https://github.com/flarum/framework/blob/main/framework/core/src/Filter/AbstractFilterer.php#L50-L93)):
-
-1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `{MODEL_NAME}Filterer` class's `getQuery()` method.
-2. We loop through all `filter[KEY] = VALUE` query params. For each of these, any `Filter`s registered to the model whose `getFilterKey()` method matches the query param `KEY` is applied. `Filter`s can be negated by providing the query param as `filter[-KEY] = VALUE`. Whether or not a `Filter` is negated is passed to it as an argument: implementing negation is up to the `Filter`s.
-3. [Sorting](https://jsonapi.org/format/#fetching-sorting), [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
-4. Any "filter mutators" are applied. These are callbacks that receive the filter state (a wrapper around the query builder and current user) and filter criteria, and perform some arbitrary changes. All "filter mutators" run on any request.
-5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Query\QueryResults` object.
+## Adding a filter & mutator for a searchable model
-### Modify Filtering for an Existing Model
-
-Let's say you've added a `country` column to the User model, and would like to filter users by country. We'll need to define a custom `Filter`:
+Let's say you've added a `country` column to the User model, and would like to filter users by country. We'll need to define a custom `Filter`. Assuming you want to add this filter to the default database search driver:
```php
-
+ */
class CountryFilter implements FilterInterface
{
public function getFilterKey(): string
@@ -56,147 +45,394 @@ class CountryFilter implements FilterInterface
return 'country';
}
- public function filter(FilterState $filterState, string $filterValue, bool $negate)
+ public function filter(SearchState $state, string $filterValue, bool $negate)
{
$country = trim($filterValue, '"');
- $filterState->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
+ $state->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
}
}
```
-Note that `FilterState` is a wrapper around the Eloquent builder's underlying Query builder and the current user.
+Note that `SearchState` is a wrapper around the Eloquent builder's underlying Query builder and the current user.
-Also, let's pretend that for some reason, we want to omit any users that have a different country from the current user on ANY filter. We can use a "filter mutator" for this:
+Also, let's pretend that for some reason, we want to omit any users that have a different country from the current user on ANY filter. We can use a *search mutator* for this:
```php
-getQuery()->where('users.country', $filterState->getActor()->country);
+ $state->getQuery()->where('users.country', $state->getActor()->country);
}
}
```
-Now, all we need to do is register these via the Filter extender:
+Now, all we need to do is register these via the search driver extender:
```php
- // Other extenders
- (new Extend\Filter(UserFilterer::class))
- ->addFilter(CountryFilter::class)
- ->addFilterMutator(OnlySameCountryFilterMutator::class),
- // Other extenders
-```
+use Flarum\Extend;
+use Flarum\Search\Database\DatabaseSearchDriver;
+use Flarum\User\Search\UserSearcher;
-### Add Filtering to a New Model
+return [
+ // Other extenders..
-To filter a model that doesn't support filtering, you'll need to create a subclass of `Flarum/Filter/AbstractFilterer` for that model. For an example, see core's [UserFilterer](https://github.com/flarum/framework/blob/main/framework/core/src/User/Filter/UserFilterer.php).
+ (new Extend\SearchDriver(DatabaseSearchDriver::class))
+ ->addFilter(UserSearcher::class, CountryFilter::class)
+ ->addMutator(UserSearcher::class, OnlySameCountryFilterMutator::class),
-Then, you'll need to use that filterer in your model's `List` controller. For an example, see core's [ListUsersController](https://github.com/flarum/framework/blob/main/framework/core/src/Api/Controller/ListUsersController.php#L93-L98).
+ // Other extenders..
+];
+```
-## Searching
+## Making a new model searchable
-Searching constrains queries by applying `Gambit`s, which are classes that implement `Flarum\Search\GambitInterface`, based on the `filter[q]` query param. After searching is complete, a set of callbacks called "search mutators" run for every search request.
+If you want to make a non-searchable model searchable *(for instance, your extension adds a new model)*, you'll need to create a searcher class for the model, by implementing the `Flarum\Search\SearcherInterface` interface. Assuming this is meant for the default database search driver, you can instead extend `Flarum\Search\Database\AbstractSearcher`:
-When the `search` method on a `Searcher` class is called, the following process takes place ([relevant code](https://github.com/flarum/framework/blob/main/framework/core/src/Search/AbstractSearcher.php#L55-L79)):
+```php
+namespace YourPackage\Search;
-1. An Eloquent query builder instance for the model is obtained. This is provided by the per-model `{MODEL_NAME}Searcher` class's `getQuery()` method.
-2. The `filter[q]` param is split by spaces into "tokens". Each token is matched against the model's registered `Gambit`s (each gambit has a `match` method). For any tokens that match a gambit, that gambit is applied, and the token is removed from the query string. Once all regular `Gambit`s have ran, all remaining unmatched tokens are passed to the model's `FullTextGambit`, which implements the actual searching logic. For example if searching discussions, in the `filter[q]` string `'author:1 hello is:hidden' world`, `author:1` and `is:hidden` would get matched by core's Author and Hidden gambits, and `'hello world'` (the remaining tokens) would be passed to the `DiscussionFulltextGambit`.
-3. [Sorting](https://jsonapi.org/format/#fetching-sorting), [pagination](https://jsonapi.org/format/#fetching-pagination) are applied.
-4. Any "search mutators" are applied. These are callbacks that receive the search state (a wrapper around the query builder and current user) and criteria, and perform some arbitrary changes. All "search mutators" run on any request.
-5. We calculate if there are additional matching model instances beyond the query set we're returning for this request, and return this value along with the actual model data, wrapped in a `Flarum\Query\QueryResults` object.
+use Flarum\Search\Database\AbstractSearcher;
+use YourPackage\Model\Acme;
-### Modify Searching for an Existing Model
+class AcmeSearcher extends AbstractSearcher
+{
+ public function getQuery(User $actor): Builder
+ {
+ return Acme::query()->select('acmes.*'); // The selection is recommended to avoid conflicts with other extensions.
+ }
+}
+```
-Let's reuse the "country" examples we used above, and see how we'd implement the same things for searching:
+You can optionally create a fulltext filter implementation for actual searching. This is a special filter that is always applied when a search query is provided. For instance, if you want to search Acme models by their `name` column:
```php
-
+ */
+class AcmeFulltextFilter extends AbstractFulltextFilter
{
- public function getGambitPattern(): string
+ public function search(SearchState $state, string $value): void
{
- return 'country:(.+)';
+ $state->getQuery()
+ ->where('acmes.name', 'like', "%$value%");
}
+}
+```
- public function conditions(SearchState $search, array $matches, bool $negate)
- {
- $country = trim($matches[1], '"');
+Then, you'll need to register this searcher via the search driver extender:
+
+```php
+use Flarum\Extend;
+use Flarum\Search\Database\DatabaseSearchDriver;
+
+return [
+ // Other extenders..
+
+ (new Extend\SearchDriver(DatabaseSearchDriver::class))
+ ->addSearcher(Acme::class, AcmeSearcher::class)
+ ->setFullText(AcmeSearcher::class, AcmeFulltextFilter::class),
+
+ // Other extenders..
+];
+```
+
+## Creating a new search driver
- $search->getQuery()->where('users.country', $negate ? '!=' : '=', $country);
+If you want to create a new search driver, you'll need to:
+
+1. First create a driver class that extends `Flarum\Search\AbstractDriver`.
+2. Then for each model that your driver implements searching for, you'll need to create a model searcher class that implements `Flarum\Search\SearcherInterface`.
+3. (*Optionally*) you can create a custom search state class that extends `Flarum\Search\SearchState` to store any additional state you need for your driver.
+4. Refer to the section above for registering a filter and/or a fulltext filter for your model searcher.
+5. Finally, you'll need to register your driver via the `SearchDriver` extender.
+
+```php
+namespace YourPackage\Search;
+
+use Flarum\Search\AbstractDriver;
+
+class AcmeSearchDriver extends AbstractDriver
+{
+ public static function name(): string
+ {
+ return 'your-package-driver-name';
}
}
```
-:::warning No Spaces in Gambit Patterns!
+```php
+use Flarum\Extend;
-Flarum splits the `filter[q]` string into tokens by splitting it at spaces. This means that your custom gambits can NOT use spaces as part of their pattern.
+return [
-:::
+ // Other extenders..
+
+ (new Extend\SearchDriver(AcmeSearchDriver::class))
+ ->addSearcher(Acme::class, AcmeSearcher::class)
+ // Optionally, you can set a fulltext filter for your searcher, a filter and/or a mutator.
+ ->setFullText(AcmeSearcher::class, AcmeFulltextFilter::class)
+ ->addFilter(AcmeSearcher::class, AcmeFilter::class)
+ ->addMutator(AcmeSearcher::class, AcmeMutator::class),
+
+ // Other extenders..
+
+];
+```
+
+Your model searcher and fulltext filter implementations is where the specific logic for your search driver goes. You will want to create an abstract searcher class to reuse the logic for all your model searchers.
+
+```php
+namespace YourPackage\Search;
+
+use Flarum\Search\SearcherInterface;
+use Illuminate\Database\Eloquent\Builder;
-:::tip AbstractRegexGambit
+abstract class AbstractAcmeSearcher implements SearcherInterface
+{
+ public function __construct(
+ protected FilterManager $filters,
+ /** @var array */
+ protected array $mutators
+ ) {
+ }
-All a gambit needs to do is implement `Flarum\Search\GambitInterface`, which receives the search state and a token. It should return if this gambit applies for the given token, and if so, make whatever mutations are necessary to the query builder accessible as `$searchState->getQuery()`.
+ abstract public function getQuery(User $actor): Builder;
-However, for most gambits, the `AbstractRegexGambit` abstract class (used above) should be used as a base class. This makes it a lot simpler to match and apply gambits.
+ public function search(SearchCriteria $criteria): SearchResults
+ {
+ // Your searching logic here.
+ }
+}
+```
+
+:::bilgi
+
+You can check the [default database search driver implementation](https://github.com/flarum/framework/blob/2.x/framework/core/src/Search/Database) for an example of how to implement the searcher.
:::
-Similarly, the search mutator we need is almost identical to the filter mutator from before:
+## Indexing
-```php
-getQuery()->where('users.country', $filterState->getActor()->country);
+ // Delete the models from the index.
+ }
+
+ public function build(): void
+ {
+ // Build the index.
+ }
+
+ public function flush(): void
+ {
+ // Flush the index.
}
}
```
-We can register these via the `SimpleFlarumSearch` extender (in the future, the `Search` extender will be used for registering custom search drivers):
-
```php
- // Other extenders
- (new Extend\SimpleFlarumSearch(UserSearcher::class))
- ->addGambit(CountryGambit::class)
- ->addSearchMutator(OnlySameCountrySearchMutator::class),
- // Other extenders
+use Flarum\Extend;
+
+return [
+
+ // Other extenders..
+
+ (new Extend\SearchIndex())
+ ->indexer(Acme::class, AcmeIndexer::class),
+
+ // Other extenders..
+
+];
+```
+
+:::bilgi
+
+Checkout this [proof of concept elastic search driver](https://github.com/SychO9/flarum-ext-search) for more examples.
+
+:::
+
+## Configuring the driver for a model
+
+You can select which driver a search model can use from the advanced admin page. This page needs to be toggled from the button on the dashboard page tools dropdown:
+
+![Toggle advanced page](https://user-images.githubusercontent.com/20267363/277113270-f2e9c91d-2a29-436b-827f-5c4d20e2ed54.png)
+
+![Advanced page](https://user-images.githubusercontent.com/20267363/277113315-9d75b9a3-f225-4a2b-9f42-8e5b9d13d5e8.png)
+
+
+## Gambits
+
+Gambits are a way of adding filters through the search input of the frontend. The concept of gambits is only relevant to the frontend as they are used to translate string queries into filters and filters back into their string format. For example, the `is:unread` gambit translates to a `filter[unread]` filter, and vice versa.
+
+Gambits are applied any time you call `app.store.find()` and provide a `q` filter. For example:
+
+```ts
+app.store.find('discussions', { q: 'is:unread' });
+```
+
+Gambits are automatically shown in the autocomplete options of the global search:
+
+![Global search modal](../assets/global_search_modal.png)
+
+### Basic gambits
+
+To create a new gambit, determine if it is a `key:value` type of gambit, or a boolean `is:` type of gambit. If it is the former, you may create a class that extends `KeyValueGambit`. For example, the `country` column example we used earlier is a `key:value` gambit:
+
+```ts
+import app from 'flarum/common/app';
+import { KeyValueGambit } from 'flarum/common/query/IGambit';
+
+export default class CountryGambit extends KeyValueGambit {
+ key(): string {
+ return app.translator.trans('acme.lib.gambits.users.country.key', {}, true);
+ }
+
+ hint(): string {
+ return app.translator.trans('acme.lib.gambits.users.country.hint', {}, true);
+ }
+
+ filterKey(): string {
+ return 'country';
+ }
+}
+```
+
+The `key` is the localized gambit key, `country` would be the english word used, and other languages can appropriately translate. The key must have no spaces. The `hint` is used for the autocomplete in the global search modal. The implementation will produce a `filter[country]=value` filter. The filter key must not be localized.
+
+If the gambit you are creating is a boolean `is:` type of gambit, you can extend the `BooleanGambit` class. Here is an example from a built-in gambit (The filter key must not be localized.):
+
+```ts
+import app from 'flarum/common/app';
+import { BooleanGambit } from 'flarum/common/query/IGambit';
+
+export default class UnreadGambit extends BooleanGambit {
+ key(): string {
+ return app.translator.trans('core.lib.gambits.discussions.unread.key', {}, true);
+ }
+
+ filterKey(): string {
+ return 'unread';
+ }
+}
+```
+
+:::info No Spaces in Gambit Patterns!
+
+Flarum splits the `filter[q]` string into tokens by splitting it at spaces. This means that your custom gambits can NOT use spaces as part of their pattern.
+
+:::
+
+:::info Use the common frontend
+
+Gambits may be used from both the forum and admin frontends. So you want to make sure your gambit is added within the common frontend.
+
+:::
+
+### Advanced gambits
+
+If neither of the above gambit classes are suitable for your needs, you may directly implement the `IGambit` interface. Your class must implement the following:
+
+###### `type`
+The type of gambit. It can be `key:value` or `grouped`. The `key:value` gambit is a single key with a single value. The `grouped` gambit is a key with multiple values. For example, boolean gambits are grouped, because they are all prefixed with `is:`.
+###### `pattern`
+The regular expression pattern that will be used to match the gambit. The pattern language can be localized. For example, the pattern for the author gambit is `author:(.+)` in English, but `auteur:(.+)` in French.
+###### `toFilter`
+The method to transform a gambit into a filter format. The returned POJO will be combined into the filter POJO. For example, the author gambit will return `{ author: 'username' }`.
+###### `filterKey`
+The server standardised filter key for this gambit. The filter key must not be localized.
+###### `fromFilter`
+The method to transform a filter into a gambit format. The gambit format can be localized.
+###### `suggestion`
+Returns information about how the gambit is structured for the UI. Use localized values. For example, the author gambit will return `{ key: 'author', hint: 'the username of the author' }`.
+###### `predicates`
+Whether this gambit can use logical operators. For example, the tag gambit can be used as such: `tag:foo,bar tag:baz` which translates to `(foo OR bar) AND baz`. The info allows generation of the correct filtering format, which would be:
+```json
+{
+ "tag": [
+ "foo,bar", // OR because of the comma.
+ "baz" // AND because it's a separate item.
+ ]
+}
+```
+The backend filter must be able to handle this format. Checkout the `TagGambit` and `TagFilter` classes for an example.
+###### `enabled`
+Whether this gambit can be used by the actor. Some filters are protected and can only be used by certain actors. For example, the `is:suspended` gambit can only be used by actors with permission to suspend users.
+
+```ts
+enabled(): bool {
+ return !!app.session.user && app.forum.attribute('canSuspendUsers');
+}
```
-### Add Searching to a New Model
+### Registering gambits
-To support searching for a model, you'll need to create a subclass of `Flarum/Search/AbstractSearcher` for that model. For an example, see core's [UserSearcher](https://github.com/flarum/framework/blob/main/framework/core/src/User/Search/UserSearcher.php).
+Once you have created your gambit, you will need to register it. You can do so using the `Search` frontend extender:
-Then, you'll need to use that searcher in your model's `List` controller. For an example, see core's [ListUsersController](https://github.com/flarum/framework/blob/main/framework/core/src/Api/Controller/ListUsersController.php#L93-L98).
+```ts
+import Extend from 'flarum/common/extenders';
+import CountryGambit from './query/users/CountryGambit';
-Every searcher **must** have a fulltext gambit (the logic that actually does the searching). Otherwise, it won't be booted by Flarum, and you'll get an error. See core's [FulltextGambit for users](https://github.com/flarum/framework/blob/main/framework/core/src/User/Search/Gambit/FulltextGambit.php) for an example. You can set (or override) the full text gambit for a searcher via the `SimpleFlarumSearch` extender's `setFullTextGambit()` method.
+// prettier-ignore
+export default [
+ new Extend.Search()
+ .gambit('users', CountryGambit),
+];
+```
+
+### Autocomplete for custom inputs
-### Search Drivers
+If you have a custom input for which you want to provide gambit autocompletion, you may use the `GambitAutocompleteDropdown` wrapper component. The built-in user list admin page uses this component. Here is an example:
-Coming soon!
+```tsx
+import GambitsAutocompleteDropdown from 'flarum/common/components/GambitsAutocompleteDropdown';
+import Input from 'flarum/common/components/Input';
+
+
+
+
+```
-## Frontend Tools
+This will automatically produce an autocomplete dropdown with the appropriate gambits for the `users` resource. The `query` prop is the current search query, and the `onchange` prop is a callback that will be called when the query changes.
-Coming soon!
+![Gambit autocomplete dropdown component](../assets/gambit_autocomplete_dropdown.png)
From 046058e1064830da84e974a78f79d120d85b5b2b Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:31 -0500
Subject: [PATCH 121/477] New translations service-provider.md (Spanish)
---
.../current/extend/service-provider.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/extend/service-provider.md b/i18n/es/docusaurus-plugin-content-docs/current/extend/service-provider.md
index ee4370f58..2091ab434 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/extend/service-provider.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/extend/service-provider.md
@@ -1,6 +1,6 @@
# Proveedor de servicios
-Como se ha señalado a lo largo de esta documentación, Flarum utiliza [el contenedor de servicios de Laravel](https://laravel.com/docs/6.x/container) (o contenedor IoC) para la inyección de dependencias. Los [Service Providers](https://laravel.com/docs/6.x/providers) permiten la configuración y modificación de bajo nivel del backend de Flarum. El caso de uso más común para los proveedores de servicio es crear, modificar o reemplazar los enlaces del contenedor. Dicho esto, los proveedores de servicios le permiten un acceso completo para ejecutar cualquier lógica que necesite durante el arranque de la aplicación con acceso al contenedor.
+As noted throughout this documentation, Flarum uses [Laravel's service container](https://laravel.com/docs/11.x/container) (or IoC container) for dependency injection. [Service Providers](https://laravel.com/docs/11.x/providers) allow low-level configuration and modification of the Flarum backend. El caso de uso más común para los proveedores de servicio es crear, modificar o reemplazar los enlaces del contenedor. Dicho esto, los proveedores de servicios le permiten un acceso completo para ejecutar cualquier lógica que necesite durante el arranque de la aplicación con acceso al contenedor.
:::caution ¡¡¡Sólo para uso avanzado!!!
@@ -47,7 +47,7 @@ class CustomServiceProvider extends AbstractServiceProvider
El método `register` se ejecutará durante el paso (3) anterior, y el método `boot` se ejecutará durante el paso (5) anterior. En ambos métodos, el contenedor está disponible a través de `$this->app`. In the `boot` method, the container (or any other arguments), should be injected via typehinted method arguments.
-Flarum does not currently support Laravel Octane, but some [best practices](https://laravel.com/docs/8.x/octane#dependency-injection-and-octane), like using the `$container` argument inside `bind`, `singleton`, and `resolving` callbacks instead of `$this->container` should be used. See the [Octane documentation](https://laravel.com/docs/8.x/octane#dependency-injection-and-octane) for more information.
+Flarum does not currently support Laravel Octane, but some [best practices](https://laravel.com/docs/11.x/octane#dependency-injection-and-octane), like using the `$container` argument inside `bind`, `singleton`, and `resolving` callbacks instead of `$this->container` should be used. See the [Octane documentation](https://laravel.com/docs/11.x/octane#dependency-injection-and-octane) for more information.
Para registrar tu proveedor de servicios personalizado, puedes usar el extensor `ServiceProvider` en `extend.php`:
From fe039466428a3877ccc79bd8bd2d5e02ab33045c Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:32 -0500
Subject: [PATCH 122/477] New translations service-provider.md (German)
---
.../current/extend/service-provider.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/extend/service-provider.md b/i18n/de/docusaurus-plugin-content-docs/current/extend/service-provider.md
index 65d98e0bf..1fa4b0b50 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/extend/service-provider.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/extend/service-provider.md
@@ -1,6 +1,6 @@
# Service Provider
-As noted throughout this documentation, Flarum uses [Laravel's service container](https://laravel.com/docs/8.x/container) (or IoC container) for dependency injection. [Service Providers](https://laravel.com/docs/8.x/providers) allow low-level configuration and modification of the Flarum backend. The most common use case for service providers is to create, modify, or replace container bindings. That being said, service providers allow you full access to run whatever logic you need during application boot with access to the container.
+As noted throughout this documentation, Flarum uses [Laravel's service container](https://laravel.com/docs/11.x/container) (or IoC container) for dependency injection. [Service Providers](https://laravel.com/docs/11.x/providers) allow low-level configuration and modification of the Flarum backend. The most common use case for service providers is to create, modify, or replace container bindings. That being said, service providers allow you full access to run whatever logic you need during application boot with access to the container.
:::caution Nur für Fortgeschrittene!!!
@@ -47,7 +47,7 @@ class CustomServiceProvider extends AbstractServiceProvider
The `register` method will run during step (3) above, and the `boot` method will run during step (5) above. In the `register` method, the container is available via `$this->container`. In the `boot` method, the container (or any other arguments), should be injected via typehinted method arguments.
-Flarum does not currently support Laravel Octane, but some [best practices](https://laravel.com/docs/8.x/octane#dependency-injection-and-octane), like using the `$container` argument inside `bind`, `singleton`, and `resolving` callbacks instead of `$this->container` should be used. See the [Octane documentation](https://laravel.com/docs/8.x/octane#dependency-injection-and-octane) for more information.
+Flarum does not currently support Laravel Octane, but some [best practices](https://laravel.com/docs/11.x/octane#dependency-injection-and-octane), like using the `$container` argument inside `bind`, `singleton`, and `resolving` callbacks instead of `$this->container` should be used. See the [Octane documentation](https://laravel.com/docs/11.x/octane#dependency-injection-and-octane) for more information.
To actually register your custom service provider, you can use the `ServiceProvider` extender in `extend.php`:
From 3648da5b166ef6e1ec7e0a44e31f1217b51318ca Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:34 -0500
Subject: [PATCH 123/477] New translations service-provider.md (Italian)
---
.../current/extend/service-provider.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/extend/service-provider.md b/i18n/it/docusaurus-plugin-content-docs/current/extend/service-provider.md
index 7d8590174..ace5e88a9 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/extend/service-provider.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/extend/service-provider.md
@@ -1,6 +1,6 @@
# Provider di servizi
-Come notato in questa documentazione, Flarum utilizza [il contenitore dei servizi Laravel](https://laravel.com/docs/6.x/container) (o IoC container) per l'iniezione di dipendenze. [I provider di servizi](https://laravel.com/docs/6.x/providers) consentono la configurazione e la modifica del backend Flarum a basso livello. Il caso d'uso più comune per i provider di servizi è creare, modificare o sostituire i binding del contenitore. Detto questo, i provider di servizi consentono l'accesso completo per eseguire qualsiasi logica necessaria durante l'avvio dell'applicazione con accesso al contenitore.
+As noted throughout this documentation, Flarum uses [Laravel's service container](https://laravel.com/docs/11.x/container) (or IoC container) for dependency injection. [Service Providers](https://laravel.com/docs/11.x/providers) allow low-level configuration and modification of the Flarum backend. Il caso d'uso più comune per i provider di servizi è creare, modificare o sostituire i binding del contenitore. Detto questo, i provider di servizi consentono l'accesso completo per eseguire qualsiasi logica necessaria durante l'avvio dell'applicazione con accesso al contenitore.
:::caution Solo per utenti avanzati!!!
@@ -47,7 +47,7 @@ class CustomServiceProvider extends AbstractServiceProvider
Il metodo `register` verrà eseguito durante il passaggio (3) qui sopra, e il metodo `boot` verrà eseguito durante la fase (5). In entrambi i metodi, il contenitore è disponibile tramite `$this->app`. In the `boot` method, the container (or any other arguments), should be injected via typehinted method arguments.
-Flarum does not currently support Laravel Octane, but some [best practices](https://laravel.com/docs/8.x/octane#dependency-injection-and-octane), like using the `$container` argument inside `bind`, `singleton`, and `resolving` callbacks instead of `$this->container` should be used. See the [Octane documentation](https://laravel.com/docs/8.x/octane#dependency-injection-and-octane) for more information.
+Flarum does not currently support Laravel Octane, but some [best practices](https://laravel.com/docs/11.x/octane#dependency-injection-and-octane), like using the `$container` argument inside `bind`, `singleton`, and `resolving` callbacks instead of `$this->container` should be used. See the [Octane documentation](https://laravel.com/docs/11.x/octane#dependency-injection-and-octane) for more information.
Per registrare effettivamente il tuo provider di servizi personalizzato, puoi utilizzare l'extender `ServiceProvider` in `extend.php`:
From 9d956049fbfab5e7596d230ceb8d25dbcb05c2b8 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:35 -0500
Subject: [PATCH 124/477] New translations service-provider.md (Turkish)
---
.../current/extend/service-provider.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/extend/service-provider.md b/i18n/tr/docusaurus-plugin-content-docs/current/extend/service-provider.md
index 30fef15df..df0c980c9 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/extend/service-provider.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/extend/service-provider.md
@@ -1,6 +1,6 @@
# Servis Sağlayıcı
-As noted throughout this documentation, Flarum uses [Laravel's service container](https://laravel.com/docs/8.x/container) (or IoC container) for dependency injection. [Service Providers](https://laravel.com/docs/8.x/providers) allow low-level configuration and modification of the Flarum backend. The most common use case for service providers is to create, modify, or replace container bindings. That being said, service providers allow you full access to run whatever logic you need during application boot with access to the container.
+As noted throughout this documentation, Flarum uses [Laravel's service container](https://laravel.com/docs/11.x/container) (or IoC container) for dependency injection. [Service Providers](https://laravel.com/docs/11.x/providers) allow low-level configuration and modification of the Flarum backend. The most common use case for service providers is to create, modify, or replace container bindings. That being said, service providers allow you full access to run whatever logic you need during application boot with access to the container.
:::caution Advanced Use Only!!!
@@ -47,7 +47,7 @@ class CustomServiceProvider extends AbstractServiceProvider
The `register` method will run during step (3) above, and the `boot` method will run during step (5) above. In the `register` method, the container is available via `$this->container`. In the `boot` method, the container (or any other arguments), should be injected via typehinted method arguments.
-Flarum does not currently support Laravel Octane, but some [best practices](https://laravel.com/docs/8.x/octane#dependency-injection-and-octane), like using the `$container` argument inside `bind`, `singleton`, and `resolving` callbacks instead of `$this->container` should be used. See the [Octane documentation](https://laravel.com/docs/8.x/octane#dependency-injection-and-octane) for more information.
+Flarum does not currently support Laravel Octane, but some [best practices](https://laravel.com/docs/11.x/octane#dependency-injection-and-octane), like using the `$container` argument inside `bind`, `singleton`, and `resolving` callbacks instead of `$this->container` should be used. See the [Octane documentation](https://laravel.com/docs/11.x/octane#dependency-injection-and-octane) for more information.
To actually register your custom service provider, you can use the `ServiceProvider` extender in `extend.php`:
From 87359fb615279b2eaa6140ddf6db217ea50f00e2 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:36 -0500
Subject: [PATCH 125/477] New translations settings.md (Spanish)
---
.../current/extend/settings.md | 28 ++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/extend/settings.md b/i18n/es/docusaurus-plugin-content-docs/current/extend/settings.md
index e29999653..1e0b9d292 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/extend/settings.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/extend/settings.md
@@ -4,7 +4,7 @@ En algún momento mientras haces una extensión, puede que quieras leer algunas
## El repositorio de ajustes
-La lectura o el cambio de configuraciones puede hacerse usando una implementación de la `SettingsRepositoryInterface`. En su lugar, puedes confiar en el contenedor para instanciar tu clase e inyectar las dependencias correctas. Debido a que Flarum utiliza el [contenedor de servicios de Laravel](https://laravel.com/docs/6.x/container) (o contenedor IoC) para la inyección de dependencias, no necesitas preocuparte de dónde obtener tal repositorio, o cómo instanciar uno.
+La lectura o el cambio de configuraciones puede hacerse usando una implementación de la `SettingsRepositoryInterface`. Because Flarum uses [Laravel's service container](https://laravel.com/docs/11.x/container) (or IoC container) for dependency injection, you don't need to worry about where to obtain such a repository, or how to instantiate one. Debido a que Flarum utiliza el [contenedor de servicios de Laravel](https://laravel.com/docs/6.x/container) (o contenedor IoC) para la inyección de dependencias, no necesitas preocuparte de dónde obtener tal repositorio, o cómo instanciar uno.
```php
serializeToForum('myCoolSetting', 'my.cool.setting.key')
+ ->default('my.cool.setting.key', 'default value!')
+```
+
+### Reset Settings
+
+Sometimes you might want a setting's value to be reset to its default value based on some condition. You can do this using the `Extender\Settings::resetWhen` method:
+
+```php
+(new Extend\Settings)
+ ->serializeToForum('myCoolSetting', 'my.cool.setting.key')
+ ->default('my.cool.setting.key', 'default value!')
+ ->resetWhen('my.cool.setting.key', function ($value) {
+ return $value === '';
+ })
+```
From 5ea26372f0a52d249ae9bf2547279de510e79134 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:37 -0500
Subject: [PATCH 126/477] New translations settings.md (German)
---
.../current/extend/settings.md | 28 ++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/extend/settings.md b/i18n/de/docusaurus-plugin-content-docs/current/extend/settings.md
index ffefdcde5..e2104e0fc 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/extend/settings.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/extend/settings.md
@@ -4,7 +4,7 @@ At some point while making an extension, you might want to read some of the foru
## The Settings Repository
-Reading or changing settings can be done using an implementation of the `SettingsRepositoryInterface`. Because Flarum uses [Laravel's service container](https://laravel.com/docs/8.x/container) (or IoC container) for dependency injection, you don't need to worry about where to obtain such a repository, or how to instantiate one. Instead, you can rely on the container to instantiate your class and inject the correct dependencies.
+Reading or changing settings can be done using an implementation of the `SettingsRepositoryInterface`. Because Flarum uses [Laravel's service container](https://laravel.com/docs/11.x/container) (or IoC container) for dependency injection, you don't need to worry about where to obtain such a repository, or how to instantiate one. Because Flarum uses [Laravel's service container](https://laravel.com/docs/8.x/container) (or IoC container) for dependency injection, you don't need to worry about where to obtain such a repository, or how to instantiate one.
```php
serializeToForum('myCoolSetting', 'my.cool.setting.key')
+ ->default('my.cool.setting.key', 'default value!')
+```
+
+### Reset Settings
+
+Sometimes you might want a setting's value to be reset to its default value based on some condition. You can do this using the `Extender\Settings::resetWhen` method:
+
+```php
+(new Extend\Settings)
+ ->serializeToForum('myCoolSetting', 'my.cool.setting.key')
+ ->default('my.cool.setting.key', 'default value!')
+ ->resetWhen('my.cool.setting.key', function ($value) {
+ return $value === '';
+ })
+```
From 5e36c7b2b954c396f9c961476d2f36a38d848eb1 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:38 -0500
Subject: [PATCH 127/477] New translations settings.md (Italian)
---
.../current/extend/settings.md | 28 ++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/extend/settings.md b/i18n/it/docusaurus-plugin-content-docs/current/extend/settings.md
index a8e15e917..31703b9a5 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/extend/settings.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/extend/settings.md
@@ -4,7 +4,7 @@ Ad un certo punto durante la creazione di un'estensione, potresti voler leggere
## La repository Impostazioni
-La lettura o la modifica delle impostazioni può essere eseguita utilizzando un'implementazione di `SettingsRepositoryInterface`. Invece, puoi fare affidamento sul contenitore per istanziare la tua classe e inserire le dipendenze corrette. Poichè Flarum utilizza [il contenitore di servizi di Laravel](https://laravel.com/docs/6.x/container) (o IoC container)per l'inserimento di dipendenze, non è necessario preoccuparsi di dove ottenere tale repository o di come istanziarne una.
+La lettura o la modifica delle impostazioni può essere eseguita utilizzando un'implementazione di `SettingsRepositoryInterface`. Because Flarum uses [Laravel's service container](https://laravel.com/docs/11.x/container) (or IoC container) for dependency injection, you don't need to worry about where to obtain such a repository, or how to instantiate one. Poichè Flarum utilizza [il contenitore di servizi di Laravel](https://laravel.com/docs/6.x/container) (o IoC container)per l'inserimento di dipendenze, non è necessario preoccuparsi di dove ottenere tale repository o di come istanziarne una.
```php
serializeToForum('myCoolSetting', 'my.cool.setting.key')
+ ->default('my.cool.setting.key', 'default value!')
+```
+
+### Reset Settings
+
+Sometimes you might want a setting's value to be reset to its default value based on some condition. You can do this using the `Extender\Settings::resetWhen` method:
+
+```php
+(new Extend\Settings)
+ ->serializeToForum('myCoolSetting', 'my.cool.setting.key')
+ ->default('my.cool.setting.key', 'default value!')
+ ->resetWhen('my.cool.setting.key', function ($value) {
+ return $value === '';
+ })
+```
From 1137d13d2c327105087a9cfb441f84c36f18a1bb Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:40 -0500
Subject: [PATCH 128/477] New translations settings.md (Turkish)
---
.../current/extend/settings.md | 28 ++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/extend/settings.md b/i18n/tr/docusaurus-plugin-content-docs/current/extend/settings.md
index 4fe60d6aa..f2c9c2529 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/extend/settings.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/extend/settings.md
@@ -4,7 +4,7 @@ At some point while making an extension, you might want to read some of the foru
## The Settings Repository
-Reading or changing settings can be done using an implementation of the `SettingsRepositoryInterface`. Because Flarum uses [Laravel's service container](https://laravel.com/docs/8.x/container) (or IoC container) for dependency injection, you don't need to worry about where to obtain such a repository, or how to instantiate one. Instead, you can rely on the container to instantiate your class and inject the correct dependencies.
+Reading or changing settings can be done using an implementation of the `SettingsRepositoryInterface`. Because Flarum uses [Laravel's service container](https://laravel.com/docs/11.x/container) (or IoC container) for dependency injection, you don't need to worry about where to obtain such a repository, or how to instantiate one. Because Flarum uses [Laravel's service container](https://laravel.com/docs/8.x/container) (or IoC container) for dependency injection, you don't need to worry about where to obtain such a repository, or how to instantiate one.
```php
serializeToForum('myCoolSetting', 'my.cool.setting.key')
+ ->default('my.cool.setting.key', 'default value!')
+```
+
+### Reset Settings
+
+Sometimes you might want a setting's value to be reset to its default value based on some condition. You can do this using the `Extender\Settings::resetWhen` method:
+
+```php
+(new Extend\Settings)
+ ->serializeToForum('myCoolSetting', 'my.cool.setting.key')
+ ->default('my.cool.setting.key', 'default value!')
+ ->resetWhen('my.cool.setting.key', function ($value) {
+ return $value === '';
+ })
+```
From 6d7e7456da66f1fad90824561199b6160d017f02 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:41 -0500
Subject: [PATCH 129/477] New translations start.md (Spanish)
---
.../docusaurus-plugin-content-docs/current/extend/start.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/extend/start.md b/i18n/es/docusaurus-plugin-content-docs/current/extend/start.md
index 91c58ff53..f81f557f1 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/extend/start.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/extend/start.md
@@ -1,6 +1,6 @@
# Cómo empezar
-¿Quieres construir una extensión de Flarum? You've come to the right place! ¡Has venido al lugar correcto! Este documento te llevará a través de algunos conceptos esenciales, después de lo cual construirás tu primera extensión de Flarum desde cero.
+¿Quieres construir una extensión de Flarum? You've come to the right place! You've come to the right place! ¡Has venido al lugar correcto! Este documento te llevará a través de algunos conceptos esenciales, después de lo cual construirás tu primera extensión de Flarum desde cero.
## Arquitectura
@@ -10,7 +10,7 @@ Ten en cuenta que Flarum utiliza algunos lenguajes y herramientas _modernas_. Si
Flarum se compone de tres capas:
-* En primer lugar, está el **backend**. Está escrito en [PHP orientado a objetos](https://laracasts.com/series/object-oriented-bootcamp-in-php), y hace uso de una amplia gama de componentes de [Laravel](https://laravel.com/) y otros paquetes a través de [Composer](https://getcomposer.org/). También querrás familiarizarte con el concepto de [Dependency Injection](https://laravel.com/docs/6.x/container), que se utiliza en todo nuestro backend.
+* En primer lugar, está el **backend**. Está escrito en [PHP orientado a objetos](https://laracasts.com/series/object-oriented-bootcamp-in-php), y hace uso de una amplia gama de componentes de [Laravel](https://laravel.com/) y otros paquetes a través de [Composer](https://getcomposer.org/). You'll also want to familiarize yourself with the concept of [Dependency Injection](https://laravel.com/docs/11.x/container), which is used throughout our backend.
* En segundo lugar, el backend expone una **API pública** que permite a los clientes del frontend interactuar con los datos de tu foro. Está construida de acuerdo con la especificación [JSON:API](https://jsonapi.org/).
@@ -148,6 +148,6 @@ Una vez hecho esto, sigue adelante y activa la extension en la página de admini
*whizzing, whirring, metal clunking*
-Woop! Hello to you too, extension!
+Woop! Woop! Hello to you too, extension!
Estamos haciendo buenos progresos. Hemos aprendido a configurar nuestra extensión y a utilizar los extensores, lo que nos abre muchas puertas. Sigue leyendo para aprender a extender el frontend de Flarum.
From a5030b946b4954881375f333e0786b32f4a343e5 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:42 -0500
Subject: [PATCH 130/477] New translations start.md (German)
---
i18n/de/docusaurus-plugin-content-docs/current/extend/start.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i18n/de/docusaurus-plugin-content-docs/current/extend/start.md b/i18n/de/docusaurus-plugin-content-docs/current/extend/start.md
index b73125a7c..d956037ad 100644
--- a/i18n/de/docusaurus-plugin-content-docs/current/extend/start.md
+++ b/i18n/de/docusaurus-plugin-content-docs/current/extend/start.md
@@ -10,7 +10,7 @@ Be aware that Flarum uses some _modern_ languages and tools. If you've only ever
Flarum is made up of three layers:
-* First, there is the **backend**. This is written in [object-oriented PHP](https://laracasts.com/series/object-oriented-bootcamp-in-php), and makes use of a wide array of [Laravel](https://laravel.com/) components and other packages via [Composer](https://getcomposer.org/). You'll also want to familiarize yourself with the concept of [Dependency Injection](https://laravel.com/docs/8.x/container), which is used throughout our backend.
+* First, there is the **backend**. This is written in [object-oriented PHP](https://laracasts.com/series/object-oriented-bootcamp-in-php), and makes use of a wide array of [Laravel](https://laravel.com/) components and other packages via [Composer](https://getcomposer.org/). You'll also want to familiarize yourself with the concept of [Dependency Injection](https://laravel.com/docs/11.x/container), which is used throughout our backend.
* Second, the backend exposes a **public API** which allows frontend clients to interface with your forum's data. This is built according to the [JSON:API specification](https://jsonapi.org/).
From 0352e9a5d9481fdb36f91804a14659ebdad62551 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:43 -0500
Subject: [PATCH 131/477] New translations start.md (Italian)
---
i18n/it/docusaurus-plugin-content-docs/current/extend/start.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i18n/it/docusaurus-plugin-content-docs/current/extend/start.md b/i18n/it/docusaurus-plugin-content-docs/current/extend/start.md
index ce22a2d9d..66a621225 100644
--- a/i18n/it/docusaurus-plugin-content-docs/current/extend/start.md
+++ b/i18n/it/docusaurus-plugin-content-docs/current/extend/start.md
@@ -10,7 +10,7 @@ Tieni presente che Flarum utilizza alcuni linguaggi e strumenti _moderni_. Se ha
Flarum � composto da tre strati:
-* Primo, c'� il ** backend **. Questo � scritto in formato [object-oriented PHP](https://laracasts.com/series/object-oriented-bootcamp-in-php), e fa uso di un'ampia gamma di array e componenti [Laravel](https://laravel.com/) e pacchetti tramite [Composer](https://getcomposer.org/). Ti consigliamo anche di familiarizzare con il concetto di [iniezione dipendenze](https://laravel.com/docs/6.x/container), che viene utilizzato in tutto il nostro backend.
+* Primo, c'� il ** backend **. Questo � scritto in formato [object-oriented PHP](https://laracasts.com/series/object-oriented-bootcamp-in-php), e fa uso di un'ampia gamma di array e componenti [Laravel](https://laravel.com/) e pacchetti tramite [Composer](https://getcomposer.org/). You'll also want to familiarize yourself with the concept of [Dependency Injection](https://laravel.com/docs/11.x/container), which is used throughout our backend.
* Secondo, il backend espone una ** API pubblica ** che consente ai client frontend di interfacciarsi con i dati del tuo forum. Questo � costruito secondo il [specifiche JSON:API](https://jsonapi.org/).
From d51f399134c23a8e44f0c21003d35c9c371cb7ce Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:45 -0500
Subject: [PATCH 132/477] New translations start.md (Turkish)
---
i18n/tr/docusaurus-plugin-content-docs/current/extend/start.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i18n/tr/docusaurus-plugin-content-docs/current/extend/start.md b/i18n/tr/docusaurus-plugin-content-docs/current/extend/start.md
index 418dee766..d2b5cd5e2 100644
--- a/i18n/tr/docusaurus-plugin-content-docs/current/extend/start.md
+++ b/i18n/tr/docusaurus-plugin-content-docs/current/extend/start.md
@@ -10,7 +10,7 @@ Flarum'un _ modern _ programlama dillerini ve araçlarını kullandığını bil
Flarum is made up of three layers:
-* First, there is the **backend**. This is written in [object-oriented PHP](https://laracasts.com/series/object-oriented-bootcamp-in-php), and makes use of a wide array of [Laravel](https://laravel.com/) components and other packages via [Composer](https://getcomposer.org/). You'll also want to familiarize yourself with the concept of [Dependency Injection](https://laravel.com/docs/8.x/container), which is used throughout our backend.
+* First, there is the **backend**. This is written in [object-oriented PHP](https://laracasts.com/series/object-oriented-bootcamp-in-php), and makes use of a wide array of [Laravel](https://laravel.com/) components and other packages via [Composer](https://getcomposer.org/). You'll also want to familiarize yourself with the concept of [Dependency Injection](https://laravel.com/docs/11.x/container), which is used throughout our backend.
* Second, the backend exposes a **public API** which allows frontend clients to interface with your forum's data. This is built according to the [JSON:API specification](https://jsonapi.org/).
From acda560b6a59fa75f6aea8f5be3062447ce5cba4 Mon Sep 17 00:00:00 2001
From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Date: Tue, 5 Nov 2024 05:24:46 -0500
Subject: [PATCH 133/477] New translations frontend.md (Chinese Simplified)
---
.../current/extend/frontend.md | 173 +++++++++++++-----
1 file changed, 130 insertions(+), 43 deletions(-)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/extend/frontend.md b/i18n/zh/docusaurus-plugin-content-docs/current/extend/frontend.md
index d2e0533a7..028f424ba 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/extend/frontend.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/extend/frontend.md
@@ -1,6 +1,6 @@
# 前端开发
-这个页面描述如何改变Flarum的用户界面—— 添加按钮、文字滚动、和闪耀的文本 🤩
+这个页面描述如何改变Flarum的用户界面—— 添加按钮、文字滚动、和闪耀的文本 🤩 添加按钮、文字滚动、和闪耀的文本 🤩
[记住](/extend/start.md#architecture), Flarum 的前端是**单页 JavaScript 应用**。 我们不会用到Twig、Blade或任何其他的PHP模板。 后端中存在的少数模板仅用于渲染针对搜索引擎优化的内容。 所有对UI的改动都需要通过JavaScript实现。
@@ -52,16 +52,26 @@ js
"private": true,
"name": "@acme/flarum-hello-world",
"dependencies": {
- "flarum-webpack-config": "^1.0.0",
- "webpack": "^4.0.0",
- "webpack-cli": "^4.0.0"
- },
- "devDependencies": {
- "flarum-tsconfig": "^1.0.0"
+ "@flarum/prettier-config": "^1.0.0",
+ "flarum-tsconfig": "^2.0.0",
+ "flarum-webpack-config": "^3.0.0",
+ "prettier": "^2.5.1",
+ "typescript": "^4.5.4",
+ "typescript-coverage-report": "^0.6.1",
+ "webpack": "^5.65.0",
+ "webpack-cli": "^4.9.1"
},
"scripts": {
"dev": "webpack --mode development --watch",
- "build": "webpack --mode production"
+ "build": "webpack --mode production",
+ "analyze": "cross-env ANALYZER=true <%= params.jsPackageManager %> run build",
+ "format": "prettier --write src",
+ "format-check": "prettier --check src",
+ "clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
+ "build-typings": "<%= params.jsPackageManager %> run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && <%= params.jsPackageManager %> run post-build-typings",
+ "post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'",
+ "check-typings": "tsc --noEmit --emitDeclarationOnly false",
+ "check-typings-coverage": "typescript-coverage-report",
}
}
```
@@ -99,6 +109,21 @@ module.exports = config();
}
}
}
+ "include": [
+ "src/**/*",
+ "../vendor/*/*/js/dist-typings/@types/**/*",
+ "@types/**/*"
+ ],
+ "compilerOptions": {
+ // This will output typings to `dist-typings`
+ "declarationDir": "./dist-typings",
+ "baseUrl": ".",
+ "paths": {
+ "flarum/*": ["../vendor/flarum/core/js/dist-typings/*"],
+ }
+ }
+}
+
```
This is a standard configuration file to enable support for Typescript with the options that Flarum needs.
@@ -107,13 +132,13 @@ Always ensure you're using the latest version of this file: https://github.com/f
Even if you choose not to use TypeScript in your extension, which is supported natively by our Webpack config, it's still recommended to install the `flarum-tsconfig` package and to include this configuration file so that your IDE can infer types for our core JS.
-To get the typings working, you'll need to run `composer update` in your extension's folder to download the latest copy of Flarum's core into a new `vendor` folder. Remember not to commit this folder if you're using a version control system such as Git.
+To get the typings working, you'll need to run `composer update` in your extension's folder to download the latest copy of Flarum's core into a new `vendor` folder. Remember not to commit this folder if you're using a version control system such as Git. Remember not to commit this folder if you're using a version control system such as Git.
-You may also need to restart your IDE's TypeScript server. In Visual Studio Code, you can press F1, then type "Restart TypeScript Server" and hit ENTER. This might take a minute to complete.
+You may also need to restart your IDE's TypeScript server. You may also need to restart your IDE's TypeScript server. In Visual Studio Code, you can press F1, then type "Restart TypeScript Server" and hit ENTER. This might take a minute to complete. This might take a minute to complete.
### admin.js and forum.js
-These files contain the root of our actual frontend JS. You could put your entire extension here, but that would not be well organized. For this reason, we recommend putting the actual source code in `src`, and having these files just export the contents of `src`. For instance:
+These files contain the root of our actual frontend JS. You could put your entire extension here, but that would not be well organized. For this reason, we recommend putting the actual source code in `src`, and having these files just export the contents of `src`. For instance: You could put your entire extension here, but that would not be well organized. For this reason, we recommend putting the actual source code in `src`, and having these files just export the contents of `src`. For instance:
```js
// admin.js
@@ -125,7 +150,7 @@ export * from './src/forum';
### src
-If following the recommendations for `admin.js` and `forum.js`, we'll want to have 2 subfolders here: one for `admin` frontend code, and one for `forum` frontend code. If you have components, models, utils, or other code that is shared across both frontends, you may want to create a `common` subfolder and place it there.
+If following the recommendations for `admin.js` and `forum.js`, we'll want to have 2 subfolders here: one for `admin` frontend code, and one for `forum` frontend code. If you have components, models, utils, or other code that is shared across both frontends, you may want to create a `common` subfolder and place it there. If you have components, models, utils, or other code that is shared across both frontends, you may want to create a `common` subfolder and place it there.
Structure for `admin` and `forum` is identical, so we'll just show it for `forum` here:
@@ -137,13 +162,17 @@ src/forum/
└── index.js
```
-`components`, `models`, and `utils` are directories that contain files where you can define custom [components](#components), [models](models.md#frontend-models), and reusable util helper functions. Please note that this is all simply a recommendation: there's nothing forcing you to use this particular file structure (or any other file structure).
+`components`, `models`, and `utils` are directories that contain files where you can define custom [components](#components), [models](models.md#frontend-models), and reusable util helper functions. Please note that this is all simply a recommendation: there's nothing forcing you to use this particular file structure (or any other file structure). Please note that this is all simply a recommendation: there's nothing forcing you to use this particular file structure (or any other file structure).
-The most important file here is `index.js`: everything else is just extracting classes and functions into their own files. Let's go over a typical `index.js` file structure:
+The most important file here is `index.js`: everything else is just extracting classes and functions into their own files. Let's go over a typical `index.js` file structure: Let's go over a typical `index.js` file structure:
```js
import { extend, override } from 'flarum/common/extend';
+// We provide our extension code in the form of an "initializer".
+// This is a callback that will run after the core has booted.
+import { extend, override } from 'flarum/common/extend';
+
// We provide our extension code in the form of an "initializer".
// This is a callback that will run after the core has booted.
app.initializers.add('acme-flarum-hello-world', function(app) {
@@ -158,23 +187,26 @@ We'll go over tools available for extensions below.
You should familiarize yourself with proper syntax for [importing js modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import), as most extensions larger than a few lines will split their js into multiple files.
-Pretty much every Flarum extension will need to import *something* from Flarum Core. Like most extensions, core's JS source code is split up into `admin`, `common`, and `forum` folders. You can import the file by prefixing its path in the Flarum core source code with `flarum`. So `admin/components/AdminLinkButton` is available as `flarum/admin/components/AdminLinkButton`, `common/Component` is available as `flarum/common/Component`, and `forum/states/PostStreamState` is available as `flarum/forum/states/PostStreamState`.
+Pretty much every Flarum extension will need to import *something* from Flarum Core. Like most extensions, core's JS source code is split up into `admin`, `common`, and `forum` folders. You can import the file by prefixing its path in the Flarum core source code with `flarum`. So `admin/components/AdminLinkButton` is available as `flarum/admin/components/AdminLinkButton`, `common/Component` is available as `flarum/common/Component`, and `forum/states/PostStreamState` is available as `flarum/forum/states/PostStreamState`. Like most extensions, core's JS source code is split up into `admin`, `common`, and `forum` folders. You can import the file by prefixing its path in the Flarum core source code with `flarum`. So `admin/components/AdminLinkButton` is available as `flarum/admin/components/AdminLinkButton`, `common/Component` is available as `flarum/common/Component`, and `forum/states/PostStreamState` is available as `flarum/forum/states/PostStreamState`.
+
+In some cases, an extension may want to extend code from another flarum extension. This is only possible for extensions which explicitly export their contents. You can use the same [import format](./extending-extensions#importing-from-extensions) valid for any third-party extension.
-In some cases, an extension may want to extend code from another flarum extension. This is only possible for extensions which explicitly export their contents.
+For example, to import from tags extension:
-* `flarum/tags` and `flarum/flags` are currently the only bundled extensions that allow extending their JS. You can import their contents from `flarum/{EXT_NAME}/PATH` (e.g. `flarum/tags/components/TagHero`).
-* The process for extending each community extension is different; you should consult documentation for each individual extension.
+```js
+import TagsPage from 'ext:flarum/tags/components/TagsPage';
+```
### 转译
-OK, time to fire up the transpiler. Run the following commands in the `js` directory:
+OK, time to fire up the transpiler. OK, time to fire up the transpiler. Run the following commands in the `js` directory:
```bash
npm install
npm run dev
```
-This will compile your browser-ready JavaScript code into the `js/dist/forum.js` file, and keep watching for changes to the source files. Nifty!
+This will compile your browser-ready JavaScript code into the `js/dist/forum.js` file, and keep watching for changes to the source files. Nifty! Nifty!
When you've finished developing your extension (or before a new release), you'll want to run `npm run build` instead of `npm run dev`: this builds the extension in production mode, which makes the source code smaller and faster.
@@ -182,7 +214,7 @@ When you've finished developing your extension (or before a new release), you'll
### JavaScript
-In order for your extension's JavaScript to be loaded into the frontend, we need to tell Flarum where to find it. We can do this using the `Frontend` extender's `js` method. Add it to your extension's `extend.php` file:
+In order for your extension's JavaScript to be loaded into the frontend, we need to tell Flarum where to find it. We can do this using the `Frontend` extender's `js` method. Add it to your extension's `extend.php` file: We can do this using the `Frontend` extender's `js` method. Add it to your extension's `extend.php` file:
```php
` tags to the frontend document.
+Only one main JavaScript file per extension is permitted. Only one main JavaScript file per extension is permitted. If you need to include any external JavaScript libraries, either install them with NPM and `import` them so they are compiled into your JavaScript file, or see [Routes and Content](/extend/routes.md) to learn how to add extra `