Closed rffontenelle closed 1 month ago
locale_dirs += [path.join(package_dir, 'locale')]
is using the Sphinx sphinx.locale
directory as a final fallback, so I think unrelated.
@AA-Turner I see. So the usage/configuration page that says locale_dirs defaults to 'locales' is incorrect, right?
config.locale_dirs
defaults to ['locales']
When I try and run locally with the .mo
files under Doc/locales/pt_BR/LC_MESSAGES
, I get translated results. When under Doc/locale
, I don't.
This seems opposite to your reproducer @rffontenelle?
A
It doesn't, hence my original statement is incorrect (now?). Proposed a fix for the Configuration page that is currently stating 'locale' is the default.
Describe the bug
sphinx-build searches for translation files in the directory 'locale', even though locale_dirs conf value defaults to 'locales' since Sphinx 1.5, as per changelog entry.
This causes weird behaviors like sphinx-intl looking for translations in 'locales' (https://github.com/sphinx-doc/sphinx-intl/issues/14), but sphinx-build builds translated docs using translations from 'locale'.
Related code (I think, not sure though):
https://github.com/sphinx-doc/sphinx/blob/a1510de4777eaa2e569435f95b05f6f3293d7035/sphinx/application.py#L321
https://github.com/sphinx-doc/sphinx/blob/a1510de4777eaa2e569435f95b05f6f3293d7035/sphinx/config.py#L217
How to Reproduce
Environment Information
Sphinx extensions
No response
Additional context
No response