diff --git a/Makefile b/Makefile index 63ef93544b..8776885272 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ help: @echo " pot Create/Update POT files from source files" @echo " serve Serve a built documentation on http://localhost:8000" @echo " spell Check spelling, storing output in $(POSPELL_TMP_DIR)" + @echo " progress To compute current progression on the tutorial" @echo "" @@ -202,3 +203,7 @@ clean: rm -fr $(VENV) rm -rf $(POSPELL_TMP_DIR) find -name '*.mo' -delete + +.PHONY: progress +progress: venv + $(VENV)/bin/python scripts/print_percentage.py diff --git a/requirements.txt b/requirements.txt index 77a79af888..15d8647ee8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ Sphinx==2.2.0 blurb +polib pospell powrap python-docs-theme diff --git a/scripts/print_percentage.py b/scripts/print_percentage.py new file mode 100644 index 0000000000..1f38fe8e62 --- /dev/null +++ b/scripts/print_percentage.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +import glob +import os + +import polib # fades + +PO_DIR = os.path.abspath( + os.path.join( + os.path.dirname(__file__), + '..', + )) + + +def main(): + for pofilename in glob.glob(PO_DIR + '**/tutorial/*.po'): + po = polib.pofile(pofilename) + file_per = po.percent_translated() + print(f"{pofilename} ::: {file_per}%") + + +if __name__ == "__main__": + main()