-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document options #72
Open
gabegorelick
wants to merge
1
commit into
rubenv:master
Choose a base branch
from
gabegorelick:docs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Document options #72
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,82 @@ Used to construct build tools for [`angular-gettext`](https://github.com/rubenv/ | |
|
||
[![Build Status](https://travis-ci.org/rubenv/grunt-angular-gettext.png?branch=master)](https://travis-ci.org/rubenv/angular-gettext-tools) | ||
|
||
Implementations: | ||
## Usage | ||
|
||
You probably want to use one of the build plugins that wrap this library | ||
instead. Current implementations: | ||
|
||
* [Grunt plugin](https://github.com/rubenv/grunt-angular-gettext) | ||
* [Gulp plugin](https://github.com/gabegorelick/gulp-angular-gettext) | ||
|
||
Check the website for usage instructions: [http://angular-gettext.rocketeer.be/](http://angular-gettext.rocketeer.be/). | ||
## API | ||
|
||
`angular-gettext-tools` has two components: an `Extractor` for extracting | ||
translatable strings into a [POT file](http://www.icanlocalize.com/site/tutorials/how-to-translate-with-gettext-po-and-pot-files), | ||
and a `Compiler` for converting [PO files](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) | ||
into a format that the runtime library ([angular-gettext](https://github.com/rubenv/angular-gettext)) | ||
can consume. | ||
|
||
For more information, check out the [official website](https://angular-gettext.rocketeer.be). | ||
|
||
### `Extractor` options | ||
|
||
All `Extractor` options are optional. | ||
|
||
#### `startDelim` | ||
Delimiter that starts your Angular expressions. If you're using | ||
[custom delimiters](https://docs.angularjs.org/api/ng/provider/$interpolateProvider) | ||
for your Angular expressions, you should set the the `Extractor` can parse your | ||
expressions. Defaults to `{{`, which is Angular's default. | ||
|
||
#### `endDelim` | ||
Delimiter that ends your Angular expressions. Defaults to `}}`, which is | ||
Angular's default. | ||
|
||
#### `markerName` | ||
String to use as marker when parsing JavaScript for extractable strings. | ||
Defaults to `gettext`. | ||
|
||
#### `markerNames` | ||
Array of additional markers. If you're using a custom service that wraps | ||
`angular-gettext`, you'll probably want to pass the name of your service here | ||
so `angular-gettext-tools` can extract your strings. | ||
|
||
#### `lineNumbers` | ||
`false` to disable outputting line numbers in PO file references. Defaults to | ||
`true`. | ||
|
||
#### `extensions` | ||
Object mapping file extensions to extraction strategies. Valid | ||
strategies are `html` or `js`. For example, if you have a file `foo.bar` you | ||
want parsed as HTML, pass `{extensions: {foo: 'html'}}` to the `Extractor`. | ||
|
||
#### `postProcess` | ||
Callback to post process the resulting PO file. Passed a | ||
[`pofile`](https://www.npmjs.com/package/pofile) object. | ||
|
||
### `Compiler` options | ||
|
||
All `Compiler` options are optional. | ||
|
||
#### `format` | ||
Output format. `javascript` or `json`. Defaults to `javascript` for ease of use, | ||
but for more control over how strings are loaded into your app, consider using | ||
`json` and then generating your own JavaScript to suit your needs. | ||
|
||
#### `module` | ||
Name of the Angular module to output. Only used if `format` is `javascript`. | ||
Defaults to `gettext`. | ||
|
||
#### `requirejs` | ||
Whether to wrap the output in a [RequireJS](http://requirejs.org) module. Only | ||
used if `format` is `javascript`. Defaults to false. | ||
|
||
## License | ||
|
||
(The MIT License) | ||
|
||
Copyright (C) 2013-2014 by Ruben Vermeersch <[email protected]> | ||
Copyright (C) 2013-2015 by Ruben Vermeersch <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add a line here with your details, given the amount of contributions it's only fair to do so :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to like
Copyright (c) 2013-2015 by angular-gettext-tools contributors
, especially since there's no copyright assignment, which means individual contributors maintain full rights.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this was automatically updated by my editor :-)