Skip to main content

Small tool to help in i18n and l10n

Project description

Pyramid I18N Helper

This is a helper for internationalization and localization in Pyramid

views

This package add 3 view to your pyramid based application:

  • i18n_helper.domain view in route /translate

  • i18n_helper.pot view in route /translate/{domain}

  • i18n_helper.po view in route /translate/{domain}/{lang}

in /translate you see available domains and also you can create new domain.

in /translate/{domain} you can edit pot file for selected domain.

in /translate/{domain}/{lang} you can translate msgid to selected lang in selected domain. also you can update po file from pot file.

additional object

This package add Babel locale object to request.

collecting msgids

you can also use auto collect msgids. for this set i18n_helper.collect_msgid = true in your project config file. by enabling auto collect. new msgids for any domain add to its own pot file. even if pot file for specific is not available it will create automatically

Installation

pip install pyramid_i18n_helper

add then add this package to your application

pyramid.includes =
    pyramid_layout
    pyramid_jinja2
    pyramid_i18n_helper

or

config.include('pyramid_layout')
config.include('pyramid_jinja2')
config.include('pyramid_i18n_helper')

Support

You can use project issue page to submit your issue

Khown Issues

  • After translating a msgid you have to restart your application

  • At now this package use pyramid_layout default layout. form pyramid_layout documentation page main_template is the template object that provides the main template (aka, o-wrap) for the view. so if your application dont have main_layout. you may have problem.

  • main_layout template have to designed via jinja2

Changes

v 0.3.0

  • many change. so new version released.

  • documentation

v 0.2.14

  • complete domain view

v 0.2.13

  • handle duplication error

  • create new domain if not exist

v 0.2.11

  • compatible with pyramid_flash_message 0.2

v 0.2.9

  • add flash message.

v 0.2.8

  • set permission to ‘i18n_helper’. so user want to access pages have to have this permission.

v 0.2.7

  • modify create lang and select lang

  • error in creating new lang if lang not valid in babel

v 0.2.6

  • add ability to collect msgids in pot file via i18n_helper.collect_msgid setting as true

  • some debug

v 0.2.5

  • add babel locale object to request

v 0.2.4

  • some bug fix

v 0.2.3

  • some bug fix

v 0.2

  • add (newlang / go to lang) field

  • some bug fix

v 0.1

  • some modification

  • apply suggestion from #1. thank @mmerickel

v 0.0

  • init project and create skeleton of it

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

pyramid_i18n_helper-0.3.0.tar.gz (7.2 kB view details)

Uploaded Source

File details

Details for the file pyramid_i18n_helper-0.3.0.tar.gz.

File metadata

File hashes

Hashes for pyramid_i18n_helper-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5103ec98db695ca5d2cc65dfe3fd47a680d3ad33f7fc765a82dda134a73a6a59
MD5 f2957510935691b4665dd91f9f007ddb
BLAKE2b-256 0d387071d773239e4a783757654261a353c1a45c20191822843e139c6626fecc

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