Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karfield/babel-plugin-langpack
https://github.com/karfield/babel-plugin-langpack
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/karfield/babel-plugin-langpack
- Owner: karfield
- Created: 2015-07-06T06:15:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-16T01:58:34.000Z (over 9 years ago)
- Last Synced: 2024-06-22T20:23:07.927Z (6 months ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# langPack generator plugin for Babel
This plugin is used to traverse the code and replace 'L' callback as append a hash value, it alse generates a langpack export file, which you can translate your localizton file in a json file.
# Usage
install:
```
$ npm install karfield/babel-plugin-langpack --save-dev
```Use
```
$ babel --plugins langpack some-code.js --extra langpackImport=langutils --extra langpackExportDir=/path/to/export/
```or:
```
require("babel").transform("code", { plugins: ["langpack"],
extra: ["langpackImport=langutils", "langpackExportDir=/path/to/export/"] });
```with webpack loader parameters:
```
var babel="babel?optional[]=es7.objectRestSpread&optional[]=runtime&plugins[]=langpack&extra[]=langpackImport=langutils&extra[]=langpackExportDir=/path/to/export/"
```the parameter: "langpackImport" and "langpackExportDir" are essential for langpack, so don't miss it.
# License
The MIT License (MIT)
Copyright (c) 2015 Jed Watson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.