Skip to content
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

Do not use fuzzy matching #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ After the `.pot` file has been generated, you can [msgmerge](https://www.gnu.org
You can enable this by setting `msgmerge` to `true`, in which case the `.po` files are assumed to be in the same directory as the generated `.pot` file. If you wish to specify an alternative directory for the `.po` files you may set this option to that directory path (with trailing slash).


#### no_fuzzy
Type: `Bool`
Default value: `false`

Do not use fuzzy matching


#### add_location
Type: `Null|String`
Default value: `null`
Expand Down
5 changes: 4 additions & 1 deletion tasks/pot.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = function(grunt) {
copyright_holder: false,
comment_tag: '/',
msgmerge: false,
no_fuzzy: false
});

grunt.verbose.writeflags(options, 'Pot options');
Expand Down Expand Up @@ -121,9 +122,11 @@ module.exports = function(grunt) {
}

if( poFilePaths && options.msgmerge ){
// do not use fuzzy matching
var no_fuzzy = ( options.no_fuzzy ? "-N " : "" );

poFilePaths.forEach( function( poFile ) {
exec( 'msgmerge -U ' + poFile +' ' + potFile, function(error, stdout, stderr) {});
exec( 'msgmerge -U ' + no_fuzzy + poFile +' ' + potFile, function(error, stdout, stderr) {});
});

}
Expand Down