Skip to content

Enable Read-The-Docs and fix any issues with existing translations #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
- name: Get list with updated .po archives (PR-only)
if: github.event_name == 'pull_request'
id: changed-po-files
uses: tj-actions/changed-files@2d756ea4c53f7f6b397767d8723b3a10a9f35bf2 # v44
uses: tj-actions/changed-files@eaf854ef0c266753e1abec356dcf17d92695b251 # v44.5.3
with:
files: |
**/*.po
files: "**/*.po"
exclude_submodules: true
- name: Create list with .po files to check
id: po-files-to-check
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

locales/
.potodo/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "cpython"]
path = cpython
url = https://github.com/python/cpython
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/JulienPalard/powrap
rev: v1.0.0
hooks:
- id: powrap
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.9.1
hooks:
- id: sphinx-lint
25 changes: 25 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3"

commands:
- python -m pip install -r requirements.txt
- make
- mkdir -p _readthedocs/html/
- cp -r cpython/Doc/build/html/* _readthedocs/html/

python:
install:
- requirements: requirements.txt

submodules:
include: all

22 changes: 9 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
# .po files.
CPYTHON_CURRENT_COMMIT := 9cbde7c6ce6f7b93301a37f03dfa0c0d45e00a39

CPYTHON_PATH := /home/tpetkos/github.com/python/cpython/
CPYTHON_PATH := ./cpython

LANGUAGE := gr
LANGUAGE := el
TRANLATION_BRANCH := main
BRANCH := 3.12

EXCLUDED := whatsnew/ c-api/
Expand All @@ -36,7 +37,7 @@ UPSTREAM := https://github.com/python/cpython

PYTHON := $(shell which python3)
MODE := html
POSPELL_TMP_DIR := .pospell/
POSPELL_TMP_DIR := .pospell
JOBS := auto

# Detect OS
Expand All @@ -58,7 +59,6 @@ endif

.PHONY: all
all: ensure_prerequisites
git -C $(CPYTHON_PATH) checkout $(CPYTHON_CURRENT_COMMIT)
mkdir -p locales/$(LANGUAGE)/LC_MESSAGES/
$(CP_CMD) -u --parents *.po */*.po locales/$(LANGUAGE)/LC_MESSAGES/
$(MAKE) -C $(CPYTHON_PATH)/Doc/ \
Expand All @@ -70,7 +70,6 @@ all: ensure_prerequisites
-D latex_elements.inputenc= \
-D latex_elements.fontenc=' \
$(MODE)
git -C $(CPYTHON_PATH) checkout -
@echo "Build success, open file://$(abspath $(CPYTHON_PATH))/Doc/build/html/index.html or run 'make serve' to see them."


Expand All @@ -83,10 +82,7 @@ ensure_prerequisites:
@if ! [ -d $(CPYTHON_PATH) ]; then \
echo "Building the translation requires a cpython clone."; \
echo "Please provide the path to a clone using the CPYTHON_PATH variable."; \
echo "(Currently CPYTHON_PATH is $(CPYTHON_PATH)."; \
echo "So you may want to run:"; \
echo ""; \
echo " git clone $(UPSTREAM) $(CPYTHON_PATH)"; \
echo "(Currently CPYTHON_PATH is $(CPYTHON_PATH).)"; \
exit 1; \
fi
@if [ -n "$$(git -C $(CPYTHON_PATH) status --porcelain)" ]; then \
Expand All @@ -95,16 +91,16 @@ ensure_prerequisites:
exit 1; \
fi
@if ! (blurb help >/dev/null 2>&1 && sphinx-build --version >/dev/null 2>&1); then \
git -C $(CPYTHON_PATH) checkout $(BRANCH); \
echo "You're missing dependencies, please enable a venv and install:"; \
echo ""; \
echo " python -m pip install -r requirements.txt -r $(CPYTHON_PATH)/Doc/requirements.txt"; \
echo " python -m pip install -r requirements.txt"; \
exit 1; \
fi


.PHONY: serve
serve:
$(MAKE) -C $(CPYTHON_PATH)/Doc/ serve
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('cpython/Doc/build/html/index.html'))"


.PHONY: progress
Expand All @@ -123,7 +119,7 @@ wrap: ensure_prerequisites
@echo "Verify wrapping"
powrap --check --quiet *.po **/*.po

SRCS = $(shell git diff --name-only $(BRANCH) | grep '.po$$')
SRCS = $(shell git diff --name-only $(TRANLATION_BRANCH) | grep '.po$$')
# foo/bar.po => $(POSPELL_TMP_DIR)/foo/bar.po.out
DESTS = $(addprefix $(POSPELL_TMP_DIR)/,$(addsuffix .out,$(SRCS)))

Expand Down
1 change: 1 addition & 0 deletions cpython
Submodule cpython added at 9cbde7
2 changes: 1 addition & 1 deletion dictionaries/about.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
L
L
30 changes: 29 additions & 1 deletion dictionaries/faq_programming.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,32 @@ op
υποαντικείμενα
αντικειμενοστρεφής
αναπαράξετε
παλαιώσουν
παλαιώσουν
int
ints
item
site
iterate
operator
literal
sep
hot
iterable
iterating
iteration
iterator
importer
linters
callables
callable
liners
home
Perl
terminator
terminators
testing
Lisp
list
Perl
self
delegation
25 changes: 24 additions & 1 deletion dictionaries/glossary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,27 @@ If
συντηρησιμότητα
ευρετηριοποιηθούν
παραμετροποιηθεί
αντικειμενοστρεφείς
αντικειμενοστρεφείς
to
it
in
write
hints
iterator
iterable
see
literal
iterables
iterators
iteration
decorator
annotations
generator
like
callable
Storage
decorators
Perl
annotation
function
annotating
10 changes: 9 additions & 1 deletion dictionaries/license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ g
c
ιστότοπο
ρήτρων
v
v
Inc
Stichting
Corporation
National
Creations
Foundation
Zope
doubles
2 changes: 1 addition & 1 deletion dictionaries/sphinx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ C
υποενότητες
προεπισκόπηση
βλ
Μετα
Μετα
2 changes: 1 addition & 1 deletion dictionaries/tutorial-modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ s
ηχούς
επανεκκινήσετε
λπ
ισοσταθμιστή
ισοσταθμιστή
2 changes: 1 addition & 1 deletion dictionaries/tutorial-whatnow.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ιστότοπος
O
ό
ό
2 changes: 1 addition & 1 deletion dictionaries/tutorial_interactive.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
λπ
λπ
22 changes: 11 additions & 11 deletions faq/programming.po
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ msgid ""
"`Eric <https://eric-ide.python-projects.org/>`_ is an IDE built on PyQt and "
"the Scintilla editing component."
msgstr ""
"Το Eric <https://eric-ide.python-projects.org/>`_ είναι ένα IDE που "
"Το `Eric <https://eric-ide.python-projects.org/>`_ είναι ένα IDE που "
"βασίζεται στο PyQt και το component επεξεργασίας Scintilla."

#: faq/programming.rst:42
Expand All @@ -114,7 +114,7 @@ msgid ""
"`Visual Studio Code <https://code.visualstudio.com/>`_ is an IDE with "
"debugging tools that integrates with version-control software."
msgstr ""
"Το Visual Studio Code <https://code.visualstudio.com/>`_ είναι ένας IDE με "
"Το `Visual Studio Code <https://code.visualstudio.com/>`_ είναι ένας IDE με "
"εργαλεία εντοπισμού σφαλμάτων που ενσωματώνεται με λογισμικό ελέγχου έκδοσης."

#: faq/programming.rst:47
Expand Down Expand Up @@ -1517,7 +1517,7 @@ msgstr ""
"διαχωρισμός της γραμμής σε λέξεις οριοθετημένες με κενά διαστήματα "
"χρησιμοποιώντας τη μέθοδο :meth:`~str.split` αντικειμένων συμβολοσειρών και "
"στη συνέχεια μετατροπή δεκαδικών συμβολοσειρών σε αριθμητικές τιμές "
"χρησιμοποιώντας :func:`int` ή :func: `float`. :meth:`!split()` υποστηρίζει "
"χρησιμοποιώντας :func:`int` ή :func:`float`. :meth:`!split()` υποστηρίζει "
"μια προαιρετική παράμετρο \"sep\" που είναι χρήσιμη εάν η γραμμή "
"χρησιμοποιεί κάτι διαφορετικό από κενό διάστημα ως διαχωριστικό."

Expand Down Expand Up @@ -1677,7 +1677,7 @@ msgid ""
"types` and the :mod:`collections` module."
msgstr ""
"Χρησιμοποιήστε τις σωστές δομές δεδομένων. Μελετήστε την τεκμηρίωση για το :"
"ref:`bltin-και το module :mod:`collections`."
"ref:`bltin-types` και το module :mod:`collections`."

#: faq/programming.rst:1101
msgid ""
Expand Down Expand Up @@ -2396,7 +2396,7 @@ msgstr ""
"μετατρέψει τη συμβολοσειρά ορίσματος σε κεφαλαία πριν καλέσει την υποκείμενη "
"μέθοδο ``self._outfile.write()``. Όλες οι άλλες μέθοδοι εκχωρούνται στο "
"υποκείμενο αντικείμενο ``self._outfile``. Το delegation ολοκληρώνεται μέσω "
"της μεθόδου :meth:`~object.__getattr__`∙ συμβουλευτείτε το :ref:`the "
"της μεθόδου :meth:`~object.__getattr__`. Συμβουλευτείτε το :ref:`the "
"language reference <attribute-access>` για περισσότερες πληροφορίες σχετικά "
"με τον έλεγχο της πρόσβασης."

Expand Down Expand Up @@ -2842,12 +2842,12 @@ msgid ""
"2) Detecting optional arguments can be tricky when ``None`` is a valid input "
"value. In those situations, you can create a singleton sentinel object "
"guaranteed to be distinct from other objects. For example, here is how to "
"implement a method that behaves like :meth:`dict.pop`::"
"implement a method that behaves like :meth:`dict.pop`:"
msgstr ""
"2) Ο εντοπισμός προαιρετικών ορισμάτων μπορεί να είναι δύσκολος όταν το "
"`None` είναι μια έγκυρη τιμή εισόδου. Σε αυτές τις περιπτώσεις, μπορείτε να "
"δημιουργήσετε ένα αντικείμενο μεμονωμένου φρουρού που είναι εγγυημένο ότι θα "
"διαφέρει από άλλα αντικείμενα. Για παράδειγμα, δείτε πως μπορείτε να "
"``None`` είναι μια έγκυρη τιμή εισόδου. Σε αυτές τις περιπτώσεις, μπορείτε "
"να δημιουργήσετε ένα αντικείμενο μεμονωμένου φρουρού που είναι εγγυημένο ότι "
"θα διαφέρει από άλλα αντικείμενα. Για παράδειγμα, δείτε πως μπορείτε να "
"εφαρμόσετε μια μέθοδο που συμπεριφέρεται σαν :meth:`dict.pop`::"

#: faq/programming.rst:1901
Expand Down Expand Up @@ -3037,8 +3037,8 @@ msgstr ""
"Εκτός και αν έχει οριστεί η μεταβλητή περιβάλλοντος :envvar:"
"`PYTHONDONTWRITEBYTECODE`, η δημιουργία ενός αρχείου .pyc είναι αυτόματη εάν "
"εισάγετε ένα module και η Python έχει τη δυνατότητα (δικαιώματα, ελεύθερος "
"χώρος, κ.λπ...) να δημιουργήσει ένα __pycache__`` υποκατάλογο και γράψτε το "
"μεταγλωττισμένο module σε αυτόν τον υποκατάλογο."
"χώρος, κ.λπ...) να δημιουργήσει ένα ``__pycache__`` υποκατάλογο και γράψτε "
"το μεταγλωττισμένο module σε αυτόν τον υποκατάλογο."

#: faq/programming.rst:2069
msgid ""
Expand Down
Loading
Loading