Skip to main content

An AngularJS extractor for Babel

Project description

pybabel-angularjs
=================

A Babel extractor for AngularJS templates.

To translate the content of an HTML element use the `i18n`
attribute:

<div i18n>hello world!</div>

To give somme context to your translators add value to the attribute:

<div i18n="page title">hello world!</div>

## Babel configuration

### extract_attribute

To change default `i18n` attribute use `extract_attribute` options:

[angularjs: **/*.html]
encoding = utf-8
extract_attribute = translate

Then use in template:

<div translate="page title">hello world!</div>

### include_attributes

To translate attributes of HTML nodes use `include_attributes` options:

[angularjs: **/*.html]
encoding = utf-8
include_attributes = title, alt

Then use in template:

<div title="some title">hello world!</div>
<img src="..." alt="some image description">


Heavily inspired by
https://bitbucket.org/shoreware/pybabel-angularjs

Project details


Download files

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

Files for pybabel-angularjs, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pybabel_angularjs-1.1.0-py2.py3-none-any.whl (3.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pybabel-angularjs-1.1.0.tar.gz (7.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page