Skip to content

Commit

Permalink
feat: multilingual docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Aug 10, 2024
1 parent c58505e commit 621ab76
Show file tree
Hide file tree
Showing 507 changed files with 396,536 additions and 29 deletions.
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
/discord/ext/testing/ @Pycord-Development/maintain-tests
/discord/ext/bridge/ @Pycord-Development/maintain-ext-bridge
/.github/ @Pycord-Development/project-leads
/docs/locales/ @Pycord-Dvelopment/maintain-translations
/docs/build/locales/ @Pycord-Dvelopment/maintain-translations
/.github/workflows/docs-localization-download.yml @Pycord-Dvelopment/maintain-translations
/.github/workflows/docs-localization-upload.yml @Pycord-Dvelopment/maintain-translations
/crowdin.yml @Pycord-Dvelopment/maintain-translations
/requirements/_locale.txt @Pycord-Dvelopment/maintain-translations
50 changes: 50 additions & 0 deletions .github/workflows/docs-localization-download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Multilingual Docs Download

on:
workflow_dispatch:

jobs:
localizse:
permissions: write-all
name: "Localisize Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "requirements/_locale.txt"
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/_locale.txt
pip install .[speed,voice,docs]
- name: "Get locales"
run: |
make html
sphinx-build -b gettext . ./build/locales
working-directory: ./docs
- name: "Build locales"
run: sphinx-intl update -p ./build/locales -l de -l ja -l de -l ja -l fr -l it -l hi -l ko -l pt -l es -l zh
working-directory: ./docs
- name: "Crowdin"
uses: crowdin/github-action@v2
with:
upload_sources: false
upload_translations: false
download_translations: false
download_bundle: ${{ secrets.CROWDIN_BUNDLE_ID }}
localization_branch_name: l10n_master
create_pull_request: true
pull_request_title: 'New Crowdin Translations'
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
pull_request_base_branch_name: 'master'
pull_request_reviewers: 'Lulalaby'
config: 'crowdin.yml'
base_path: '.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/docs-localization-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Multilingual Docs Upload

on:
push:
branches:
- master

jobs:
localizse:
permissions: write-all
name: "Localisize Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "requirements/_locale.txt"
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/_locale.txt
pip install .[speed,voice,docs]
- name: "Get locales"
run: |
make html
sphinx-build -b gettext . ./build/locales
working-directory: ./docs
- name: "Build locales"
run: sphinx-intl update -p ./build/locales -l de -l ja -l de -l ja -l fr -l it -l hi -l ko -l pt -l es -l zh
working-directory: ./docs
- name: "Crowdin"
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: false
download_translations: false
localization_branch_name: l10n_master
create_pull_request: false
config: 'crowdin.yml'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ jobs:
SHA: ${{ github.sha }}
REF: ${{ github.ref }}
COMMENT_ON_ISSUES: true
EXCLUDE_PATTERN: "\\.(doctree|doctrees|pickle)$"
35 changes: 20 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ __pycache__/

# Distribution / packaging
.Python
build/
./build/
./_build/
develop-eggs/
dist/
downloads/
Expand Down Expand Up @@ -51,10 +52,6 @@ coverage.xml
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
Expand Down Expand Up @@ -165,17 +162,16 @@ cython_debug/
*.egg-info
.venv/
docs/_build
docs/crowdin.py
*.buildinfo
*.mp3
*.m4a
*.wav
*.mp4
*.ogg
*.pcm
*.png
*.jpg
*.flac
!*.mp3
!*.m4a
!*.wav
!*.mp4
!*.ogg
!*.pcm
!*.png
!*.jpg
!*.flac
.vs/
.DS_Store
__pycache__
Expand All @@ -186,3 +182,12 @@ node_modules/*

# changelog is autogenerated from CHANGELOG.md
docs/changelog.md

# Translations
docs/build/html
docs/build/doctrees
!docs/build/locales/*
*.mo
!docs/locales/*
/build/
/vscode/
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Pycord
.. image:: https://img.shields.io/github/v/release/Pycord-Development/pycord?include_prereleases&label=Latest%20Release&logo=github&sort=semver&style=for-the-badge&logoColor=white
:target: https://github.com/Pycord-Development/pycord/releases
:alt: Latest release
.. image:: https://badges.crowdin.net/badge/dark/crowdin-on-light.png
:target: https://crowdin.com/?utm_source=badge&utm_medium=referral&utm_campaign=badge-add-on
:alt: Crowdin | Agile localization for tech companies

A fork of discord.py. Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.

Expand Down Expand Up @@ -141,3 +144,9 @@ Useful Links
- `Learn how to create Discord bots with Pycord <https://guide.pycord.dev>`_
- `Our Official Discord Server <https://pycord.dev/discord>`_
- `Official Discord Developers Server <https://discord.gg/discord-developers>`_

Translations
------------

.. image:: https://badges.awesome-crowdin.com/translation-200034237-5.png
:alt: Translation Status
19 changes: 19 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
base_path: "docs/build/locales"
base_url: "https://pycord.crowdin.com"

preserve_hierarchy: true

commit_message: "docs: Update translations"

export_languages: ["de", "ja", "fr", "it", "hi", "ko", "pt-BR", "es-ES", "zh-CN"]

bundles:
- 4

files:
[
{
source: "**/*.pot",
translation: "/docs/locales/%two_letters_code%/LC_MESSAGES/%original_path%/%file_name%.po"
}
]
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
BUILDDIR = build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
Expand Down
Binary file added docs/build/locales/.doctrees/api/abcs.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added docs/build/locales/.doctrees/api/clients.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/api/cogs.doctree
Binary file not shown.
Binary file not shown.
Binary file added docs/build/locales/.doctrees/api/enums.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/api/events.doctree
Binary file not shown.
Binary file not shown.
Binary file added docs/build/locales/.doctrees/api/index.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/api/models.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/api/sinks.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/api/ui_kit.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/api/utils.doctree
Binary file not shown.
Binary file not shown.
Binary file added docs/build/locales/.doctrees/api/voice.doctree
Binary file not shown.
Binary file not shown.
Binary file added docs/build/locales/.doctrees/changelog.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/cogs.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/discord.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added docs/build/locales/.doctrees/faq.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/index.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/installing.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/intents.doctree
Binary file not shown.
Binary file added docs/build/locales/.doctrees/logging.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added docs/build/locales/.doctrees/quickstart.doctree
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 621ab76

Please sign in to comment.