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

Skip to content

Show completed files in progress page #458

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 1 commit into from
Jun 28, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 18 additions & 1 deletion .overrides/progress.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,25 @@ y otras estadísticas.

.. note::

Esta lista se actualiza automáticamente cuando Pull Requests se *mergean* a la rama ``3.8``.
Estas listas se actualiza automáticamente cuando Pull Requests se *mergean* a la rama ``3.8``.


En progreso
-----------

Muestra los porcentajes completados por directorio y solo los archivos que no están al 100%.

.. runblock:: console

$ potodo --offline --path .


Completados
-----------

Lista todos los archivos con un porcentaje de traducción mayor al 90% (para contemplar los que tienen fuzzy).


.. runblock:: console

$ python scripts/completed_files.py
25 changes: 25 additions & 0 deletions scripts/completed_files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/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 sorted(glob.glob(PO_DIR + '**/*/*.po')):
po = polib.pofile(pofilename)
percent_translated = po.percent_translated()
if percent_translated > 90:
pofilename = pofilename.replace(PO_DIR + os.sep, '')
print(f"{pofilename:<30} :: {percent_translated}%")


if __name__ == "__main__":
main()