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

Empty line comments are not properly extracted #23

Closed
pronebird opened this issue Feb 27, 2019 · 0 comments
Closed

Empty line comments are not properly extracted #23

pronebird opened this issue Feb 27, 2019 · 0 comments
Labels

Comments

@pronebird
Copy link

pronebird commented Feb 27, 2019

Hi,

As per your suggestion in #22 and based on docs, I use multiple single line comments prefixed with the keyword, in my case it's TRANSLATORS:.

However the empty lines are not extracted properly, consider this:

// TRANSLATORS: Product price label
// TRANSLATORS:
// TRANSLATORS: Available placeholder:
// TRANSLATORS: {currency} - the runtime substitution for the price currency
// TRANSLATORS: {amount}   - the runtime substation for the amount

Extracted as:

#. Product price label
#. TRANSLATORS:
#. Available placeholder:
#. {currency} - the runtime substitution for the price currency
#. the runtime substation for the amount

I would expect that the second line in the generated POT has to be an empty string, i.e: #. only.

The regex I use: /^TRANSLATORS:\s*(.*)$/.
Running it manually via match works fine:

> "TRANSLATORS:".match(/^TRANSLATORS:\s*(.*)$/)
[ 'TRANSLATORS:',
  '', // <-- empty string - ALL GOOD
  index: 0,
  input: 'TRANSLATORS:',
  groups: undefined ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants