question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

babel.cfg keywords?

See original GitHub issue

I’m finding it hard to locate documentation on how to specify keywords in my babel.cfg. I have a config file that looks like this:

[python: **.py]
encoding = utf-8
[jinja2: **/templates/**.html]
encoding = utf-8
extensions=jinja2.ext.autoescape,jinja2.ext.with_
[javascript: .tmp/**.js]
encoding = utf-8
keywords = translate, ifPlural

All messages are extracted as expected except javascript. I’ve tried just setting one keyword in the config, changing the key from keywords to extract_messages, and keyword but none seem to work. I’ve checked what keywords get passed to babel.messages.extract.extract_javascript (by simply doing sys.exit(keywords) at the start of the function) and they never appear. However, doing pybabel extract -k translate -k ifPlural works just fine.

Issue Analytics

  • State:open
  • Created 10 years ago
  • Reactions:5
  • Comments:6

github_iconTop GitHub Comments

1reaction
remram44commented, Oct 14, 2019

There still doesn’t seem to be any way to specify keywords in the mapping file 😦 I’m considering duplicating the keywords in my extractor as both an option (specifiable in mapping file, not cli) and keywords (specifiable on cli, not mapping file), but it sounds like this would be very easy to support in Babel.

0reactions
dmitriidcommented, Aug 11, 2016

@scop @akx @mbirtwell Alerting you to this old/weird issue 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command-Line Interface — Babel 2.11.0 documentation
Babel includes a command-line interface for working with message catalogs, ... multiple times) --no-default-keywords do not include the default keywords -F ...
Read more >
Babel Documentation - Read the Docs
:param keywords: a list of keywords (i.e. function names) that should ... either be specified on the command-line, or in the setup.cfg file....
Read more >
babel/plugin-transform-classes
When extending a native class (e.g., class extends Array {} ), the super class needs to be wrapped. This is needed to workaround...
Read more >
Popular "keywords:"babel-config"" JavaScript packages | Skypack
14 results for "keywords:"babel-config"" ... webhint parser to analyze babel config ... A babel config for Trend Micro Frontend.
Read more >
keywords:babelrc - npm search
Find the closest babel config based on a directory ... Read the closet Babel configuration file ... Helper for integrating babel config &...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found