Skip to main content

Traductor PO

Script ejecutable para traducir archivos PO usando Google Translator.

Instalación

El script traductor-po está disponible como comando ejecutable. Para usarlo globalmente, asegúrate de que ~/.local/bin esté en tu PATH:

# Agregar al PATH (temporal)
export PATH=$PATH:~/.local/bin

# O agregar permanentemente a ~/.bashrc o ~/.zshrc
echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrc
source ~/.bashrc

Dependencias

Instala las dependencias necesarias:

pip3 install polib deep-translator

Uso

# Traducir un archivo PO a español (por defecto)
traductor-po archivo.po

# Reemplazar el archivo original (in-place)
traductor-po archivo.po -i

# Especificar idioma de destino
traductor-po archivo.po -t es

# Especificar archivo de salida
traductor-po archivo.po -o archivo_traducido.po

# Sobrescribir traducciones existentes
traductor-po archivo.po -f

# Reemplazar archivo original y sobrescribir traducciones existentes
traductor-po archivo.po -i -f

# Modo verbose (mostrar detalles)
traductor-po archivo.po -v

# Especificar idioma de origen
traductor-po archivo.po -s en -t es

Opciones

  • input_file: Archivo PO de entrada (requerido)
  • -t, --target-language: Código de idioma de destino (default: es)
  • -s, --source-language: Código de idioma de origen (default: auto)
  • -o, --output-file: Archivo PO de salida (default: archivo_translated.po)
  • -i, --in-place: Reemplazar el archivo original en lugar de crear uno nuevo
  • -f, --force: Sobrescribir traducciones existentes
  • -v, --verbose: Mostrar información detallada de la traducción

Nota: No puedes usar -i y -o al mismo tiempo.

Ejemplos

# Traducir a español (crea archivo nuevo)
traductor-po i18n/es.po

# Reemplazar el archivo original
traductor-po i18n/es.po -i

# Traducir a inglés desde español (crea archivo nuevo)
traductor-po i18n/es.po -s es -t en -o i18n/en.po

# Reemplazar archivo original y sobrescribir traducciones existentes
traductor-po i18n/es.po -i -f

# Traducir forzando sobrescritura con modo verbose
traductor-po i18n/es.po -f -v

Características

  • Preserva el contenido entre llaves {} durante la traducción
  • Solo traduce entradas sin traducción existente (a menos que uses -f)
  • Valida que el contenido entre llaves se preserve correctamente
  • Maneja variaciones de espacios que Google Translator puede agregar

Metadata

Release files for initium-translation 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for initium-translation 0.1.1
File Size Uploaded Provenance
initium_translation-0.1.1.tar.gz 5.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for initium-translation 0.1.1
File Interpreter ABI Platform
initium_translation-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / initium_translation-0.1.1.tar.gz

Download URL initium_translation-0.1.1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ef7e6118925f90524bbf043f278486c535dd5c391bdf183a7088f093c2278219
BLAKE2b-256 checksum
How to use checksums
4bc2d6472cbc1e1337ed63f114140aea53ca90cb0920343b7dc6b68223a84f46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / initium_translation-0.1.1-py3-none-any.whl

Download URL initium_translation-0.1.1-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81fcd5e96a3bf4ad8eee5bae6a3159d90cae0eb0363f37f86e3aeef6ba4fa411
BLAKE2b-256 checksum
How to use checksums
4de361aa2d6e3d93adfbfc7f23b9cff734e4dfba529047825ab136ff1cc0bcf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for initium-translation 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page