zaach / jsxgettext

Extract gettext calls from JavaScript, EJS, and other template formats.
Mozilla Public License 2.0
105 stars 56 forks source link

fix keyword checking #106

Closed vladikoff closed 8 years ago

vladikoff commented 8 years ago

@BYK @zaach Could you check this?

given "translator.gettext".indexOf("get") will skip the statement and add the keyword into parsed strings?

vladikoff commented 8 years ago

Hm seems like it won't work for most cases

maufl commented 8 years ago

I think the point is that options.keyword is actually an array, not a string. Have you tried supplying an array with your custom string? E.g. ["translator.gettext"].

BYK commented 8 years ago

+1 to what @maufl says.

BYK commented 8 years ago

See https://github.com/zaach/jsxgettext/blob/master/lib/cli.js#L15 and https://github.com/zaach/jsxgettext/blob/master/lib/cli.js#L27-L33

vladikoff commented 8 years ago

Thank you all for a quick response, we've been using that option as a string for a very long time and I guess it got lost somewhere in history. 👍