This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Release notes

  • 0.2.2 -
    • Fixed bug with n_ extraction
    • Fixed bug when _ and n_ variable translations being inserted into .po file
  • 0.2.1 - Great speed improvement (x4) by moving file reading to nodejs.
  • 0.2.0 - Now only one nodejs process spawned for single babel run, so in total for big amount of files will work much faster.
  • 0.1.4 - minor bugfixes
  • 0.1.3 - Initial release

Installation

pip install pybabel-hbs

Usage

Add [hbs: path/**.hbs] to babel.cfg

Expected workflow

  1. Use helpers inside handlebar (gettext/ngettext as both regular and block heleprs supported)
  2. JS side should pass data to Jed wrapper (see client_side_usage)
  3. Jed wrapper passes the strings and parameters to Jed
  4. Jed instance translates string to language it was initiated with
  5. Jed uses po2json output (use po2json on generated .po files and then pass output to Jed)
  6. As for generating .po files just add [hbs: **.hbs] to babel config (babel.cfg), (considering extension installed via pip or via setup.py install)
  • Extension for babel to support handlebars.
  • Uses native Handlebars.js parsing with small hack for passing line numbers.
  • Since Handlebars.js is JS this babel extension requires node.js

Supported handlebars helpers:

  • _ (Undercore) helper

    {{_ "Some text to be translated %(param)s" param="some param"}}
    
  • n_ helper

    {{\n_ num_to_check_against "Some text to be translated with %(num)s" "Some plural text to be translated with %(num)s" num=num_to_check_against}}
    
  • trans block helper:

    {{#trans params_1="something"}}
        Some text to be translated with %(param_1)s
    {{/trans}}
    
  • ntrans block helper:

    {{#ntrans num_to_check_aganst param_1="something" num=num_to_check_against}}
        Some text to be translated with %(param_1)s and %(num)s
    {{else}}
        Some plural text to be translated with %(param_1)s and %(num)s
    {{/ntrans}}
    

Summarizing

  • Every helper can have params, they will be passed to sprintf (built-in into Jed)
  • n_ and ntrans helpers MUST have some integer as first parameter, it will determine if plural or singular form should be used
Release History

Release History

0.2.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
PyBabel-hbs-0.2.2.tar.gz (24.4 kB) Copy SHA256 Checksum SHA256 Source Nov 7, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting