Skip to main content

Django app that collect thirdparty translations into local folder.

Project description

WebCase locales collector

Collects locales from any python third parties to some local folder. It's useful for a more easier local translations management.

Installation

pip install wc-django-locales-collector

In settings.py:

INSTALLED_APPS += [
  'wcd_locales_collector',
]

WCD_LOCALES_COLLECTOR = {
  # List of modules for which locales will be collected.
  'MODULES': [
    # For example:
    'rest_framework',
  ],
  # Path to save collected locales.
  'PATH' = BASE_ROOT / 'exported_locale'
}

# All root options could also be provided as standalone ones(for overriding, etc.):
WCD_LOCALES_COLLECTOR_PATH = BASE_ROOT / 'replaced_locale'

# ...

# Your static `LOCALE_PATHS` config should be wrapped by paths extender.
# If it's not, then all exported locales will not be applied.
from wcd_locales_collector.helpers import locale_paths_extender

LOCALE_PATHS = locale_paths_extender(LOCALE_PATHS)

# OR!
# If you have some issues with that approach - you can extend `LOCALE_PATHS`
# manually:
from wcd_locales_collector.services import pathifier

LOCALE_PATHS = LOCALE_PATHS + pathifier.get_modules_result_paths(
  WCD_LOCALES_COLLECTOR['MODULES'], WCD_LOCALES_COLLECTOR_PATH
)

Usage

python manage.py collectlocales

That's it. You have collected all locales from all provided apps into a separate folder.

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

[0.1.3]

Added

  • Automatic mo2po sources conversion if library doesn't have po files but ships with compiled mo files.

[0.1.2]

Fixed

  • Initial merge issue with unicode symbols.

[0.1.0]

Initial version.

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

wc-django-locales-collector-0.1.3.tar.gz (6.8 kB view hashes)

Uploaded Source

Supported by

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