Skip to main content

Initium tool for PO files translation using Google Translator

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

initium_translation-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

initium_translation-0.1.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file initium_translation-0.1.1.tar.gz.

File metadata

  • Download URL: initium_translation-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for initium_translation-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ef7e6118925f90524bbf043f278486c535dd5c391bdf183a7088f093c2278219
MD5 fa407c4bdb4a204b106f43a3229f945e
BLAKE2b-256 4bc2d6472cbc1e1337ed63f114140aea53ca90cb0920343b7dc6b68223a84f46

See more details on using hashes here.

File details

Details for the file initium_translation-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for initium_translation-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81fcd5e96a3bf4ad8eee5bae6a3159d90cae0eb0363f37f86e3aeef6ba4fa411
MD5 07c3617c1c74fac4a14dde69136fe006
BLAKE2b-256 4de361aa2d6e3d93adfbfc7f23b9cff734e4dfba529047825ab136ff1cc0bcf6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page