Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ff9b1d7
Add po4a config
ArduanovDanil Sep 2, 2025
ec41ec1
Generate file paths for po4a.cfg
ArduanovDanil Sep 3, 2025
31d6bfb
Add files to config
ArduanovDanil Sep 3, 2025
575c8c7
Add files to config
ArduanovDanil Sep 3, 2025
c50d9ac
Fix files list
ArduanovDanil Sep 3, 2025
a000744
Translate concept_aliases to ru lang
ArduanovDanil Sep 3, 2025
6b517fb
Add .mo files to gitignore
ArduanovDanil Sep 4, 2025
445d394
Translate concept_autoloading to ru lang
ArduanovDanil Sep 4, 2025
a68a7be
Translate concept_di-container to ru lang
ArduanovDanil Sep 4, 2025
c94f4ed
Translate intro_what-is-yii to ru lang
ArduanovDanil Sep 4, 2025
ca5c574
Translate security_best-practices to ru lang
ArduanovDanil Sep 4, 2025
4efab96
Translate security_cryptography to ru lang
ArduanovDanil Sep 4, 2025
520606b
Add translation guide to docs
ArduanovDanil Sep 4, 2025
608c3f4
Disable fail on error for review check
ArduanovDanil Sep 4, 2025
73315a4
Merge branch 'master' into add-po4a
ArduanovDanil Sep 4, 2025
6d20382
Change GH Action
ArduanovDanil Sep 4, 2025
d81d29d
Use image for po4a
ArduanovDanil Sep 4, 2025
54c8aca
Fix action
ArduanovDanil Sep 4, 2025
fbdd5aa
Use image and change dir
ArduanovDanil Sep 4, 2025
d118942
Update translation
ArduanovDanil Sep 4, 2025
d6b5caa
Revert readme to master branch
ArduanovDanil Sep 4, 2025
a2bd19e
Delete extra file
ArduanovDanil Sep 4, 2025
684c370
Delete extra files and fix readme
ArduanovDanil Sep 4, 2025
658d2dc
Update translation
ArduanovDanil Sep 4, 2025
cbe99e0
Add dir for auto commit action
ArduanovDanil Sep 4, 2025
7349476
Delete extra po4a.cfg file
ArduanovDanil Sep 4, 2025
9dae6ad
Change action
ArduanovDanil Sep 4, 2025
f089b31
Add files to po4a config file
ArduanovDanil Sep 4, 2025
1aeab2e
Delete files for create files list
ArduanovDanil Sep 4, 2025
cd9245d
Fix readme end of file
ArduanovDanil Sep 4, 2025
08f1a44
Delete paths from action
ArduanovDanil Sep 4, 2025
2e5d60e
Revert paths
ArduanovDanil Sep 4, 2025
e8a347a
Change pull_request_target to pull_request
ArduanovDanil Sep 4, 2025
7e5f909
Update translation
ArduanovDanil Sep 4, 2025
c955c49
Update 014-docs.md
samdark Sep 4, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: errata-ai/vale-action@reviewdog
with:
reporter: github-check
fail_on_error: true
fail_on_error: false
filter_mode: nofilter
files: '["cookbook", "guide"]'
env:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/translation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Update docs translation

on:
pull_request:
paths:
- 'cookbook/**'
- 'guide/**'

jobs:
update-docs:
name: Update docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.YIISOFT_GITHUB_TOKEN || github.token }}
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Use po4a
uses: addnab/docker-run-action@v3
with:
image: arduanovdanil/po4a-fork:v0.73
options: -v ${{ github.workspace }}:/src
run: |
cd guide
po4a po4a.cfg

- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update translation
file_pattern: 'guide'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ Thumbs.db

# Mac DS_Store Files
.DS_Store

# po4a .mo files
*.mo
19 changes: 19 additions & 0 deletions 014-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ focused on a single package but is covering certain use-cases.

The guide should follow [Micosoft style guide](https://learn.microsoft.com/en-us/style-guide/welcome/).

### Translation

The definitive guide uses [po4a](https://github.com/mquinson/po4a) in Github Action for translations.
Translation algorithm:
- Install an application for working with `.po` translation files. For example, [Poedit](https://poedit.net/), [Lokalize](https://apps.kde.org/ru/lokalize/), [Gtranslator](https://wiki.gnome.org/Apps/Gtranslator) or another.
- Find folder with the name of the file you want to translate in `/guide/po`. Note that if the source file is in a subfolder, the subfolder name is appended to the folder and separated by an underscore, for example: for translating `guide/en/concept/aliases.md` file find `guide/po/concept_aliases.md` folder.
- Open the file with the `.po` extension in `Poedit` from the folder with the desired localization, for example `guide/po/intro_what-is-yii.md/ru/intro_what-is-yii.md.ru.po`. If there is no localization yet, create an issue.
- Translate necessary strings and push the changes
- Open pull request to main repository

> [!CAUTION]
> Do not change the translation in files in `/guide/{lang}` manually.

If you have changed English documentation:
- Open pull request to main repository
- Pull updated branch after successful completion of workflow `Update docs translation` in Github Action
- Update translation in `.po` files by `Poedit`
- Push changes

## Blocks

Blocks are in the [GitHub Alerts format](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts):
Expand Down
Loading
Loading