-
Notifications
You must be signed in to change notification settings - Fork 447
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
messages not extracted from folders starting with _ or . #53
Comments
+1, pybabel must enter directories starting with underline. |
Fixes python-babel#53 -- but setup.py configuration support is missing.
This patch adds an --ignore-dir-prefix argument to pybabel, so dot and underline aren't hardcoded anymore (they are still the default, though). Hopefully someone will have time to add setup.py configuration support, too. |
👍 this bug must be solved. Directories with |
why isn't the branch still merged? And most importantly - why this issue still exist after 3 years?! |
@slimakovec I can't find a PR associated with that commit apart from it being incomplete as mentioned in the commit message. Babel was unmaintained for a long time. This time is more or less over and Babel does receive light maintaining from a few people now, we're sorry that so many issues still exist but time is a precious resource. We are happy to accept and review pull requests that solve this issue, maybe based on that existing commit? (In that case please don't forget to attribute at least to the original author.) |
@nandoflorestan Your code seems like a great headstart for me as a new contributor to babel to pick and solve. I will give this a shot and try to fix this. |
@sudheesh001 that's great news, thanks! |
It's 2018 already and nobody touched this?? :) @akx suggestion here #402 sounds most reasonable to me. Is anybody up to fix this ridiculous issue already? Removing |
-1 before fixing #402. I'm using this behavior to avoid traversing directories with many entries (e.g. node_modules to generate css from sass). |
…x option original credit @nandoflorestan
…x option original credit @nandoflorestan
Hello, I'm new to open source contribution and I want to try to attempt at solving this issue. Is this issue still open? |
Hello, I'm new to open source and I want to contribute to solving this issue of pybabel. Is this issue still open for contribution? |
Any workaround for now? It has been 7 years. My current hack is just to write them manually, |
Hello, if this issue is open I would like to work on it. |
Hello, |
Bump |
Here is simple workaround:
# file: pybabel.py
import os
messages_file = "messages.pot"
extract_command = (
"pybabel extract -F babel.cfg -k lazy_gettext "
f"-o {messages_file} ."
)
if os.system(extract_command):
# error
return python3 pybabel.py
# file: pybabel.py
import os
import glob
messages_file = "messages.pot"
files_to_translate = " ".join([
# assuming that you run this script from project root
*glob.glob("src/**/*.py", recursive=True),
*glob.glob("src/**/*.html", recursive=True)
])
extract_command = (
"pybabel extract -F babel.cfg -k lazy_gettext "
f"-o {messages_file} {files_to_translate}"
)
if os.system(extract_command):
# error
return
|
is this still open? It's my first time trying to contribute to an open-source project, but it looks like you guys have already figured it out. |
Unfortunately I have folders like _m containing templates I would like to be translated. Right now pybabel is ignoring those. I can patch this but was wondering if there is a known reason for this before doing so.
The text was updated successfully, but these errors were encountered: