Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 56 additions & 72 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,111 +1,95 @@
# Website
# open.mp Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. It serves as the primary documentation and wiki for open.mp and SA-MP.

## Documentation Structure
## Project layout

- **Docs Source:** All documentation pages are located in `docs/`. They are written in Markdown (`.md`) or MDX (`.mdx`).
- **Translations:** Localized content is stored in `i18n/`. Each language has its own subdirectory (e.g., `i18n/es/` for Spanish).
- **Static Assets:** Images and other static files used in docs are in `static/images/`.
- `docs/` — all documentation pages, written in Markdown (`.md`) or MDX (`.mdx`).
- `i18n/` — localized content, with one directory per locale (`i18n/es/`, `i18n/pt-BR/`, …).
- `src/` — React pages, theme overrides, and shared components.
- `static/` — static files; documentation images live in `static/images/`.

## Contributing to Documentation
## Local development

We welcome contributions to our documentation! Whether you're fixing a typo or adding a new guide, your help is appreciated.

### Local Development

To preview your changes locally:

1. **Navigate to the frontend directory:**

```bash
cd frontend
```

2. **Install dependencies:**
Node.js 20 or newer is required.

```bash
npm install
```
To preview your changes locally, install the dependencies and start the development server:

3. **Start the development server:**
```bash
cd frontend
npm install
npm start
```

```bash
npm start
```
The site will be available at <http://localhost:3000>. Most changes to Markdown files will live-reload in the browser.

The site will be available at `http://localhost:3000`. Most changes to Markdown files will live-reload in the browser.
To preview a translation, run one dev server per locale:

#### Choosing a locale
```bash
npm start -- --locale <locale> # one locale per server
```

```bash
npm start -- --locale pt-BR # http://localhost:3000/pt-BR/
npm start -- --locale zh-CN # http://localhost:3000/zh-CN/
```
`start` takes a single locale — passing `--locale` twice does not start two sites; the last value wins silently. Run a separate dev server per language, with different ports if needed:

`start` accepts a **single** locale — a second `--locale` is silently ignored (the last one wins) — so run one dev server per language on different ports.
```bash
npm start -- --locale pt-BR --port 3001
npm start -- --locale es --port 3002
```

### Adding or Editing Pages
## Documentation

- To **edit** an existing page, find the corresponding `.md` file in `docs/` and make your changes.
- To **add** a new page, create a new `.md` file in the appropriate subdirectory of `docs/`.
- Remember to update the **metadata** (front matter) at the top of the file:
We welcome contributions to our documentation! Whether you're fixing a typo or adding a new guide, your help is appreciated.

```markdown
---
title: Page Title
sidebar_label: Sidebar Label
description: Brief description of the page.
---
```
- To edit an existing page, find the corresponding `.md` or `.mdx` file under `docs/` and make your changes.
- To add a new page, create a `.md` or `.mdx` file in the appropriate subdirectory of `docs/`.
- Remember to update the metadata (front matter) at the top of the file:

### Workflow
```markdown
---
title: Page Title
sidebar_label: Sidebar Label
description: Brief description of the page.
---
```

For a detailed guide on our documentation standards and the "Edit this page" workflow, please refer to the [Contributing Guide](docs/meta/Contributing.md).
See the [Contributing Guide](docs/meta/Contributing.md) for our documentation standards and the "Edit this page" workflow.

## Project Commands
## UI translations (`code.json`)

### Installation
UI strings live in `i18n/<locale>/code.json` and are generated from the `translate()` / `<Translate>` calls in the source. Update a locale with:

```bash
npm i
npm run write-translations -- --locale <locale>
```

### Local Development
This keeps existing messages, fills in missing keys, and refreshes descriptions from the English source. `message` is the rendered text; `description` is translator context only — it is not rendered, so leave it in English.

```bash
npm start # default locale
npm start -- --locale pt-BR # specific locale
```
Use `import Translate, { translate }` rather than `{ default as Translate }`; aliasing the default import hides those keys from the extractor. The command never deletes obsolete keys, so clean up unused keys separately.

### Build
## Build and preview

```bash
npm run build # all locales
npm run build -- --locale pt-BR # one locale
npm run build -- --locale en --locale pt-BR --locale zh-CN # several locales
npm run build # all locales, plus the agent Markdown files
npx docusaurus build --locale <locale> # one locale
npx docusaurus build --locale es --locale pt-BR # several locales
```

This command generates static content into the `build` directory.
Unlike `start`, `build` accepts repeated `--locale` flags.

This generates static content in the `build` directory. `npm run build` builds every locale and then runs `scripts/agent-build.mjs`, which mirrors English pages to Markdown and writes `llms.txt`, `sitemap.md`, `agent-manifest.json`, and related files. A single-locale build skips that step; for English, run `node scripts/agent-build.mjs` afterward if you need those files.

### Local Preview
To preview the production build:

```bash
npm run serve
```

### Deployment

Using SSH:
## Deployment

```
$ USE_SSH=true npm run deploy
```

Not using SSH:
If you are using GitHub Pages for hosting, `npm run deploy` builds the site and pushes it to the `gh-pages` branch:

```bash
USE_SSH=true npm run deploy
# or
GIT_USER=<your GitHub username> npm run deploy
```
$ GIT_USER=<Your GitHub username> npm run deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
156 changes: 0 additions & 156 deletions frontend/i18n/ar/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,24 @@
"feature.fullyBackwardsCompatible.title": {
"message": "توافق تام مع السكربتات والعملاء الحاليين"
},
"feature.fullyBackwardsCompatible.description": {
"message": "هل لديك ملف AMX قديم؟ حمّله مباشرةً على خادم open.mp وانضم إلى أصدقائك عبر عميل SA-MP. راجع التوثيق عندما ترغب في تحسين الشفرة."
},
"feature.fullyBackwardsCompatible.linkText": {
"message": "البدء"
},
"feature.newScriptingSystem.title": {
"message": "نظام سكربتات جديد ومحسّن"
},
"feature.newScriptingSystem.description": {
"message": "يدعم open.mp سكربتات SA-MP وإضافاته الحالية، ويقدّم واجهة API حديثة تضم هياكل بيانات وعمليات إدخال وإخراج غير متزامنة وغيرها لتطوير تعديلات أفضل."
},
"feature.newScriptingSystem.linkText": {
"message": "اعرف المزيد"
},
"feature.developerFriendly.title": {
"message": "مصمّم للمطورين"
},
"feature.developerFriendly.description": {
"message": "نطوّر open.mp بواجهة API متسقة وتوثيق محدّث ومجتمع متعاون وشفرة مفتوحة بالكامل. نرحب بكل المساهمات."
},
"feature.developerFriendly.linkText": {
"message": "ساهم في المشروع"
},
"feature.scriptingSystem.title": {
"message": "نظام سكربتات جديد ومحسّن"
},
"feature.scriptingSystem.description": {
"message": "نواصل استخدام Pawn مع مصرّف جديد يجعل الشفرة أكثر متانة ودوال إضافية للخادم والعميل."
},
"feature.scriptingSystem.linkText": {
"message": "تعرّف على التحسينات"
},
"feature.communityDevelopment.title": {
"message": "يطوّره المجتمع"
},
"feature.communityDevelopment.description": {
"message": "شفرة الخادم مفتوحة بالكامل. ساعد في إعداد الإصدار التالي أو أبلغ عن الأخطاء التي تجدها. نرحب بكل مساهمة ونقدّر ملاحظاتك."
},
"feature.communityDevelopment.linkText": {
"message": "زيارة المؤسسة على GitHub"
},
"feature.cppApi.title": {
"message": "واجهة C++ قابلة للتوسعة"
},
"feature.cppApi.description": {
"message": "استخدم جميع وظائف الخادم المتاحة في Pawn إلى جانب مكتبات C++ وأطرها. يمكنك المساهمة في تحسين الخادم على GitHub."
},
"feature.cppApi.linkText": {
"message": "تصفّح مستودع SDK"
},
Expand All @@ -68,12 +38,6 @@
"partners.note": {
"message": "كما أعلنّا، لا يقبل برنامج الشراكة طلبات جديدة حاليًا. لا يزال بإمكان الخوادم التي حجزت مكانًا الانضمام. اطرح أسئلتك الأخرى على خادمنا في Discord."
},
"announcement.title": {
"message": "يتوفر الآن إصدار جديد من خادم open.mp ومشغّله!"
},
"announcement.link": {
"message": "اقرأ المزيد هنا"
},
"theme.ErrorPageContent.title": {
"message": "هذه الصفحة لا تستجيب.",
"description": "The title of the fallback page when the page crashed"
Expand Down Expand Up @@ -142,54 +106,6 @@
"message": "الوسوم",
"description": "The title of the tag list page"
},
"announcement.serverVersion": {
"message": "يتوفر خادم open.mp {version} مع إصلاحات كثيرة وتحسينات في الأداء وميزات جديدة!"
},
"announcement.serverReleaseSummary": {
"message": "يضيف هذا الإصدار أدوات للتحكم في مركبات NPC ويحسّن حركتها ويصلح مشاكل الشبكة والسكربتات."
},
"announcement.changelog": {
"message": "سجل تعديلات الخادم"
},
"announcement.download": {
"message": "تنزيل الخادم"
},
"announcement.launcherUpdate": {
"message": "حصل المشغّل أيضًا على تحديث!"
},
"announcement.launcherReleaseSummary": {
"message": "يحسّن المشغّل الواجهة المتراكبة داخل اللعبة ودعم التعديلات الرسومية واستقرار الاتصال."
},
"announcement.launcherReleaseTitle": {
"message": "يتوفر الآن مشغّل open.mp {version}!"
},
"announcement.serverReleaseTitle": {
"message": "يتوفر الآن خادم open.mp {version}!"
},
"announcement.bothReleaseTitle": {
"message": "يتوفر الآن خادم open.mp {serverVersion} والمشغّل {launcherVersion}!"
},
"announcement.seeWhatsNew": {
"message": "جديد المشغّل"
},
"announcement.dismiss": {
"message": "إغلاق هذه الرسالة"
},
"homepage.heroDescription": {
"message": "تعديل جديد متعدد اللاعبين للعبة Grand Theft Auto: San Andreas، وهو {compatibility} مع {samp}."
},
"homepage.heroDescription.compatibility": {
"message": "متوافق تمامًا"
},
"homepage.downloadLauncher": {
"message": "تنزيل المشغّل 🎮"
},
"homepage.downloadServer": {
"message": "تنزيل الخادم 🖥️"
},
"homepage.documentation": {
"message": "التوثيق 📜"
},
"animations.title": {
"message": "عارض الحركات في open.mp"
},
Expand Down Expand Up @@ -265,15 +181,9 @@
"serverInfo.quickJoin": {
"message": "انضمام سريع"
},
"serverInfo.noDescription": {
"message": "لا يوجد وصف لهذا الخادم"
},
"serverInfo.playersOnline": {
"message": "اللاعبون المتصلون"
},
"serverInfo.modVersion": {
"message": "إصدار التعديل"
},
"serverInfo.language": {
"message": "اللغة"
},
Expand All @@ -289,72 +199,6 @@
"serverInfo.notFound": {
"message": "تعذّر العثور على الخادم. قد يكون غير متصل أو لم يعد في القائمة."
},
"theme.footer.title.Documentations": {
"message": "التوثيق"
},
"theme.footer.title.Community": {
"message": "المجتمع"
},
"theme.footer.title.More": {
"message": "المزيد"
},
"theme.footer.link.Introduction": {
"message": "مقدمة"
},
"theme.footer.link.open.mp Migration": {
"message": "الانتقال إلى open.mp"
},
"theme.footer.link.Discord": {
"message": "Discord"
},
"theme.footer.link.GitHub": {
"message": "GitHub"
},
"theme.footer.link.Donate": {
"message": "تبرّع"
},
"theme.footer.link.YouTube": {
"message": "YouTube"
},
"theme.footer.link.X": {
"message": "X"
},
"theme.footer.link.Servers": {
"message": "الخوادم"
},
"theme.footer.link.Blog": {
"message": "المدونة"
},
"theme.footer.link.Animations": {
"message": "الحركات"
},
"theme.footer.link.UID Generator": {
"message": "مولّد UID"
},
"theme.footer.link.SA-MP": {
"message": "SA-MP"
},
"theme.footer.copyright": {
"message": "حقوق النشر © {year} open.mp. بُني باستخدام Docusaurus."
},
"navbar.item.Docs": {
"message": "التوثيق"
},
"navbar.item.Blog": {
"message": "المدونة"
},
"navbar.item.Forums": {
"message": "المنتديات"
},
"navbar.item.Servers": {
"message": "الخوادم"
},
"navbar.item.Partners": {
"message": "الشركاء"
},
"navbar.item.Donate": {
"message": "تبرّع"
},
"serverInfo.copied": {
"message": "تم النسخ",
"description": "Copied server address state"
Expand Down
4 changes: 0 additions & 4 deletions frontend/i18n/ar/docusaurus-theme-classic/navbar.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
"message": "الشركاء",
"description": "Navbar item with label Partners"
},
"item.label.Donate": {
"message": "تبرّع",
"description": "Navbar item with label Donate"
},
"logo.alt": {
"message": "شعار open.mp",
"description": "The alt text of navbar logo"
Expand Down
Loading