Agregar script de traducción automática #1682
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Se utiliza deep_translator en vez de googletrans para
evitar los problemas de timeout, y restricciones del módulo.
No se agregó el módulo en el archivo
requirements.txt
puesno es necesario para la construcción de la documentación.
El script utiliza
polib
para iterar sobre las entradas de unarchivo po determinado y luego reemplaza mediante expresiones
regulares todas las sentencias de sphinx, por ejemplo:
This :mod:
polib
module allows you to handle :ref:translations
.quedaría como:
This XASDF00 module allows you to handle XASDF02.
texto que luego peude ser traducido sin problemas de alterar los
espacios, acentos invertidos, dos puntos, etc, que es un problem
usual al utilizar otros servicios de traducción automática.
La traducción quedaría:
Este módulo XASDF00 te permite manejar XASDF02.
a lo que luego se vuelven a reemplazar los textos temporales
por su contenido original:
Este módulo :mod:
polib
te permite manejar :ref:translations
.