Skip to content

Commit 496f6fa

Browse files
authored
adding Portuguese and Quechua locales, fixes #24 and #25 (#26)
1 parent 7e73541 commit 496f6fa

File tree

8 files changed

+8
-6
lines changed

8 files changed

+8
-6
lines changed

bin/translate.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#!/bin/sh
22
uv run pybabel extract -F babel.cfg -o messages.pot .
33
uv run pybabel init -i messages.pot -d translations -l es
4+
uv run pybabel init -i messages.pot -d translations -l qu
5+
uv run pybabel init -i messages.pot -d translations -l pt
46
uv run pybabel init -i messages.pot -d translations -l it
57
uv run pybabel init -i messages.pot -d translations -l fr
68
echo "Translating..."
79
uv run ./bin/translate.py translations/es/LC_MESSAGES/messages.po es
10+
uv run ./bin/translate.py translations/qu/LC_MESSAGES/messages.po qu
11+
uv run ./bin/translate.py translations/pt/LC_MESSAGES/messages.po pt
812
uv run ./bin/translate.py translations/it/LC_MESSAGES/messages.po it
913
uv run ./bin/translate.py translations/fr/LC_MESSAGES/messages.po fr
1014
uv run pybabel compile -d translations

src/edit_python_pe/constants.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Locales
22
EN_LOCALE = "en"
3-
ES_LOCALE = "es"
4-
IT_LOCALE = "it"
5-
FR_LOCALE = "fr"
63

74
# Social network options
85
GITHUB_OPTION = ("GitHub", "github")

src/edit_python_pe/strings.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
import locale
33
from pathlib import Path
44

5-
from .constants import EN_LOCALE, ES_LOCALE, FR_LOCALE, IT_LOCALE
5+
from .constants import EN_LOCALE
66

77
default_locale = locale.getlocale()[0] or EN_LOCALE
8-
localedir = Path(__file__).parent.parent / "translations"
8+
localedir = Path(__file__).parent.parent.parent / "translations"
9+
print(localedir)
910
_ = gettext.translation(
1011
domain="messages",
1112
localedir=localedir,
12-
languages=[default_locale, ES_LOCALE, IT_LOCALE, FR_LOCALE],
13+
languages=[default_locale],
1314
fallback=True,
1415
).gettext
1516

42 Bytes
Binary file not shown.
46 Bytes
Binary file not shown.
46 Bytes
Binary file not shown.
2.67 KB
Binary file not shown.
2.79 KB
Binary file not shown.

0 commit comments

Comments
 (0)