Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c5c4a2

Browse files
committed
Move locales directory inside source dir
1 parent f5d080f commit 4c5c4a2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.github/workflows/tests.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
pip install -r requirements.txt
7171
- name: Remove locale file for testing
7272
shell: bash
73-
run: rm -rf locales/pt_BR/
73+
run: rm -rf python_docs_theme/locales/pt_BR/
7474
- run: python babel_runner.py extract
7575
- run: python babel_runner.py init -l pt_BR
7676
- run: python babel_runner.py update
@@ -79,10 +79,10 @@ jobs:
7979
- run: python babel_runner.py compile -l pt_BR
8080
- name: Print .pot file
8181
shell: bash
82-
run: cat locales/messages.pot
82+
run: cat python_docs_theme/locales/messages.pot
8383
- name: Print .po file
8484
shell: bash
85-
run: cat locales/pt_BR/LC_MESSAGES/messages.po
85+
run: cat python_docs_theme/locales/pt_BR/LC_MESSAGES/messages.po
8686
- name: list files in locales dir
8787
shell: bash
88-
run: ls -R locales/
88+
run: ls -R python_docs_theme/locales/

babel_runner.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/venv python3
1+
#!/usr/bin/env python3
22
"""Script for handling translations with Babel"""
33
from __future__ import annotations
44

@@ -24,9 +24,9 @@
2424
# Global variables used by pybabel below (paths relative to PROJECT_DIR)
2525
DOMAIN = "messages"
2626
COPYRIGHT_HOLDER = "Python Software Foundation"
27-
LOCALES_DIR = "locales"
28-
POT_FILE = Path(LOCALES_DIR, f"{DOMAIN}.pot")
2927
SOURCE_DIR = "python_docs_theme"
28+
LOCALES_DIR = Path(SOURCE_DIR, "locales")
29+
POT_FILE = Path(LOCALES_DIR, f"{DOMAIN}.pot")
3030
MAPPING_FILE = ".babel.cfg"
3131

3232

0 commit comments

Comments
 (0)