[go: nahoru, domu]

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

sphinx-intl is using the relative path to cwd not conf.py #79

Closed
12rambau opened this issue Jan 17, 2023 · 3 comments
Closed

sphinx-intl is using the relative path to cwd not conf.py #79

12rambau opened this issue Jan 17, 2023 · 3 comments
Labels

Comments

@12rambau
Copy link
Contributor

I'm using nox to build most of my automated process now and that include generating the translation .pot files for my documentation.

Before I was running:

cd docs 
sphinx-intl update -p build/gettext -l fr -l en

now I would like to run it from the root of my repository as:

sphinx-intl update -p docs/build/gettext -l fr -l en

When I do the last one, the conf.py file is not detected and all my pot files are saved in a default locales directory even though I use _locale in my conf.py.

Is it possible to specify the location of the conf.py file to the command ? If not, could we add this option ?

@shimizukawa
Copy link
Member

Please use -c option like:

sphinx-intl -c docs/conf.py update -p docs/build/gettext -l fr -l en

FYI:

$ sphinx-intl --help       
Usage: sphinx-intl [OPTIONS] COMMAND [ARGS]...

  Environment Variables: All command-line options can be set with environment
  variables using the format SPHINXINTL_<UPPER_LONG_NAME> . Dashes (-) have to
  replaced with     underscores (_).

  For example, to set the languages:

  export SPHINXINTL_LANGUAGE=de,ja

  This is the same as passing the option to txutil directly:

  sphinx-intl update --language=de --language=ja

Options:
  -c, --config <FILE>  Sphinx conf.py file to read a locale directory setting.
  -t, --tag <TAG>      Pass tags to conf.py, as same as passed to sphinx-build
                       -t option.
  --help               Show this message and exit.

Commands:
  build                      Build specified language's po files into mo.
  create-transifexrc         Create `$HOME/.transifexrc`
  create-txconfig            Create `./.tx/config`
  stat                       Print statistics for all po files.
  update                     Update specified language's po files from pot.
  update-txconfig-resources  Update resource sections of `./.tx/config`.

@12rambau
Copy link
Contributor Author

I checked the documentation and didn't found a trace of this option. If the Options are well set, would you consider using sphinxcontrib.autoprogram so that things f=can be found in the docs as well ?

@shimizukawa
Copy link
Member
shimizukawa commented Sep 17, 2023

@12rambau Well... I think documentation is certainly needed. sphinx-intl uses click, so I'll see if we can document it with sphinx-click.

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