Skip to main content

Automatic PO file translator

Project description

django-translate-po

Simple quick script for automatically translating .po files using Google or AWS. It speeds up internationalization by giving translators machine translated base version to correct.

Usage

Installation

pip install django_translate_po

Usage with translate function

from django_translate_po.translator_functions import select_translator_function

# Can use AWS or Google translate service,
# but if want use AWS service, you must add some settings into django's settings.py file, like this:
AWS_TRANSLATE_SERVICE = {
    "service_name": "translate",
    "service_region": "us-west-2",
    "access_key": "your-access-key",
    "access_secret": "your-access_secret"
}
translator_function = select_translator_function("AWS")
# translator_function = select_translator_function("Google")
res_text = translator_function("your-text", source_code="us", target_code="de")

Usage with translate po file

from django_translate_po.translate import PoTranslator

po_translator = PoTranslator("./a.po", translator_service="AWS", source_code="en", target_code="zh")
po_translator.generate_text_for_untranslated()

Changelog

0.1.0

  • Release Django-translate_po

0.2.0

  • Fix packages import error and refactor the project structure

0.2.1

  • Update the README.md file

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

django-translate_po-0.2.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

django_translate_po-0.2.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file django-translate_po-0.2.1.tar.gz.

File metadata

  • Download URL: django-translate_po-0.2.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for django-translate_po-0.2.1.tar.gz
Algorithm Hash digest
SHA256 081dde5c50d8217790357b69b4934e591002cae2fb51dae6c92f292f30774f9c
MD5 0a9f415e9e2d83153bbee62ec213e245
BLAKE2b-256 465b2f0b015ea141f1ae987629235cd15ba20ee0d20c59fa4122c2b2b7c00752

See more details on using hashes here.

File details

Details for the file django_translate_po-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: django_translate_po-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for django_translate_po-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a108dc1d607e6d55c714a7121608aaa33a74ad6da74b4471bb4a97ccbede7e6
MD5 1d3568b13ded85a4a06903f10dbb455d
BLAKE2b-256 52ac4fe9df5062a7b5e4bbfd54f59103867f7cc2e43a65105086edfe4bf08a07

See more details on using hashes here.

Supported by

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