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
=================
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.
Source Distribution
Built Distribution
Close
Hashes for pybabel_angularjs-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fac67dbb7bf188bf70ec4408efad813108c3f0dc245475cfa73eef350d872e83 |
|
MD5 | 6bf879127faadbe0503fe39568eab22e |
|
BLAKE2b-256 | ff28f2c35985175a225eaaea5a62709548cb8e2974ba9488df1a2e83747fca37 |