babel-jsxgettext
Advanced tools
@@ -26,2 +26,5 @@ var jsxBase = { | ||
}, | ||
JSXEmptyExpression (node, st, c) { | ||
} | ||
@@ -28,0 +31,0 @@ } |
{ | ||
"name": "babel-jsxgettext", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A tool like jsxgettext, but works for es6 + jsx that babel support", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,5 +0,12 @@ | ||
# babel-jsxgettext | ||
babel-jsxgettext | ||
================ | ||
[![NPM version][npm-image]][npm-url] | ||
[![build status][travis-image]][travis-url] | ||
[![Downloads][downloads-image]][downloads-url] | ||
[![js-standard-style][standard-image]][standard-url] | ||
A tool like [jsxgettext](https://www.npmjs.com/package/jsxgettext), but works for `es6` + `jsx` that babel support. | ||
This tool is still WIP. | ||
I have a blog post explain my translation workflow in an [Electron app with React + Babel](https://fraserxu.me/2015/09/18/translation-workflow-in-Electron-application/). | ||
@@ -17,2 +24,8 @@ ### Usage | ||
/** | ||
* The parser function | ||
* @param {String} input The path to soure JavaScript file | ||
* @param {String} output The path of the output PO file | ||
* @param {Function} cb The callback function | ||
*/ | ||
parser(inputs, output, function (err) { | ||
@@ -48,3 +61,3 @@ if (err) throw err | ||
I'm Using Babel with React + JSX for most of my project, but there's no perfect and direct way to generate `.po` file from ES6 + JSX code. | ||
I'm Using Babel with React + JSX for most of my project, but there's no perfect and direct way to generate `.po` file from ES6 + JSX code(or from a directory). | ||
@@ -55,1 +68,10 @@ `acron-jsx` support `jsx` but not all the feature I use in Babel(ES7 etc.,). So I grab the `babylon` parser from Babel and use it to generate `.po` file. | ||
MIT | ||
[npm-image]: https://img.shields.io/npm/v/babel-jsxgettext.svg?style=flat-square | ||
[npm-url]: https://npmjs.org/package/babel-jsxgettext | ||
[travis-image]: https://img.shields.io/travis/fraserxu/babel-jsxgettext/master.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/fraserxu/babel-jsxgettext | ||
[downloads-image]: http://img.shields.io/npm/dm/babel-jsxgettext.svg?style=flat-square | ||
[downloads-url]: https://npmjs.org/package/babel-jsxgettext | ||
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square | ||
[standard-url]: https://github.com/feross/standard |
@@ -230,2 +230,3 @@ /* global electronRequire */ | ||
<span className={styles.preview}>{ gettext('New file name: ') } { `${!isFetchingTownships ? this.findTownshipById(townships, selectedTownship).pcode : ''}_${tract || ''}_${currentMeyo && currentMeyo.length > 0 ? currentMeyo.replace(/ /g, '-').replace(/_/g, '-') : ''}_${formType || ''}_${elections && election ? this.findElectionById(elections, election).pcode : ''}_Page${pageNumber || ''}.png` }</span> | ||
{/* only valid meyo when is form 16 and form 16a */} | ||
<button disabled={!validName} className={styles.submit} type='submit'>{ gettext('Rename') }</button> | ||
@@ -232,0 +233,0 @@ </div> |
25558
5.79%11
10%596
0.51%75
41.51%