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

Setting a translation should verify the project has a locale for the language #4718

Open
agjohnson opened this issue Oct 3, 2018 · 1 comment
Labels
Accepted Accepted issue on our roadmap Needed: design decision A core team decision is required

Comments

@agjohnson
Copy link
Contributor

agjohnson commented Oct 3, 2018

I think to avoid confusion, part of the translation UX upgrade should be verifying that the locale actually exists during the Sphinx build. A couple options:

  • This is a sphinx ext feature
  • This is part of our context data override?
  • There is already an option for this in Sphinx, or we contribute it there?

The piece of UX that is not clear is when you use a locale code like tr_TR, but we use just tr. The output doesn't really indicate that there is no tr locale, Sphinx just happily chugs along without translating any strings.

The only hiccup here is that having a locale path isn't necessarily required, as perhaps you only wanted the translations from Sphinx or other layers? This seems like an odd choice though, I'm fine being stricter about locales.

There are a few other features that we might be able to determine from Sphinx or from an integration with Transifex/weblate:

  • Is the translations out of date?
  • Is the translation below a threshold of translation %?

These are probably harder to determine, but gettext might have some reporting.

@agjohnson agjohnson added Needed: design decision A core team decision is required Accepted Accepted issue on our roadmap labels Oct 3, 2018
@agjohnson agjohnson added this to the I18n improvements milestone Oct 3, 2018
@csezenoglu
Copy link

I built with this command "sphinx-build -b html -D language=tr_TR . _build/html/tr_TR" while I have only "tr" folder in my root. Response:

Running Sphinx v1.8.1
loading translations [tr_TR]... done
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
pickling environment... done
no targets are out of date.
build succeeded.
The HTML pages are in _build\html\tr_TR.

I think Sphinx should give an error about folder does not exist. In other words, it should be a Sphinx feature. I could not find any option in Sphinx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

2 participants