Skip to content

Commit

Permalink
Rename locale directory to locales (#58)
Browse files Browse the repository at this point in the history
* Rename locale dir to locales

* Use newly-renamed locales dir

* Place locales dir in sphinx doc
  • Loading branch information
rffontenelle authored Nov 4, 2024
1 parent 8920559 commit 45d98f0
Show file tree
Hide file tree
Showing 2,056 changed files with 17 additions and 15 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,33 @@ jobs:
# 2. Remove obsolete POT files from repository and obsolete resources from Transifex
- name: Generate templates from scratch
run: |
rm -rf ./locale/pot
./locale/generate_templates.sh
rm -rf ./locales/pot
./locales/generate_templates.sh
- name: Just print what would be locked and deleted of the resources in Transifex
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'sphinx-doc/sphinx-doc-translations' }}
run: locale/lock-translations.py locale/.tx/config -d
run: locales/lock-translations.py locales/.tx/config -d
- name: Lock and delete obsolete resources in Transifex
if: github.event_name != 'pull_request'
run: locale/lock-translations.py locale/.tx/config
run: locales/lock-translations.py locales/.tx/config
- name: Include obsolete catalog templates (pot files) for removal
run: |
deleted_files=$(git status -s | grep ^' D' | cut -d' ' -f3)
if [ -n "$deleted_files" ]; then git rm $deleted_files; fi
git checkout locale/
git checkout locales/
# 3. Update translation files
- name: Update translations
run: |
sh ./locale/generate_templates.sh
cat ./locale/.tx/config
sh ./locale/update.sh
sh ./locales/generate_templates.sh
cat ./locales/.tx/config
sh ./locales/update.sh
- name: Include obsolete catalog messages (po files) for removal
run: |
deleted_files=$(git status -s | grep ^' D' | cut -d' ' -f3)
if [ -n "$deleted_files" ]; then git rm $deleted_files; fi
# 4. Commit and push changes
- name: After success
run: |
git add locale
git add locales
git add sphinx
git diff-index --cached --quiet HEAD || git commit -vm "Update translations by GHA https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: GitHub Push
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: List languages
id: languages
working-directory: locale
working-directory: locales
run: |
list=$(find * -maxdepth 0 -type d | sed '/pot/d' | jq -nRc '[inputs]')
echo "languages=$list" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -63,14 +63,16 @@ jobs:
run: |
pip install -U pip setuptools
pip install -r ./requirements.txt
- name: Place locales directory in Sphinx doc
run: cp -a locales sphinx/doc/
- name: Set Sphinx problem matcher
uses: sphinx-doc/[email protected]
- name: Build translated docs in ${{ matrix.language }}
run: |
TZ=UTC make html -C sphinx/doc SPHINXOPTS='-W --keep-going -D locale_dirs=$(realpath locale) -D language=${{ matrix.language }}'
TZ=UTC make html -C sphinx/doc SPHINXOPTS='-W --keep-going -D language=${{ matrix.language }}'
- name: Set Sphinx Lint problem matcher
if: always()
uses: rffontenelle/[email protected]
- name: Lint translation file
if: always()
run: sphinx-lint locale/${{ matrix.language }}
run: sphinx-lint locales/${{ matrix.language }}
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:
- graphviz
jobs:
post_create_environment:
- cp -a locale sphinx/doc/
- cp -a locales sphinx/doc/

submodules:
include: all
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Key points:
How to add a new language translation
-------------------------------------

1. Add new language to ``locale/update.sh``:
1. Add new language to ``locales/update.sh``:

.. code-block:: diff
Expand All @@ -115,7 +115,7 @@ How to add a new language translation

.. code-block::
sh ./locale/update.sh
sh ./locales/update.sh
4. Commit them

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 45d98f0

Please sign in to comment.