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

Question: does a page have the resource-key at build time #37

Open
rduivenvoorde opened this issue Mar 19, 2020 · 1 comment
Open

Question: does a page have the resource-key at build time #37

rduivenvoorde opened this issue Mar 19, 2020 · 1 comment

Comments

@rduivenvoorde
Copy link

Thanks for all this work!!

We (QGIS-project) use sphinx/sphinx-intl/transifex to build/translate our documentation
Eg: https://docs.qgis.org/3.10/ja/docs/

In an earlier version of the docs we created the 'resource-keys' for transifex ourselves, and in that way were able to generate a 'translate this page here' link into every page footer, linking to the exact resource in transifex.

Now we use sphinx-intl update-txconfig-resources

and .tx/config contains keys like:

qgis-documentation.docs--user_manual--introduction--qgis_gui

which can be found on transifex here:

https://www.transifex.com/qgis/qgis-documentation/translate/#ja/docs--user_manual--introduction--qgis_gui

So I was wondering if the machinery to 'create' these keys were also available (or put in some context) during the build of the html pages?

In that way it would be easy to construct direct links to transifex.

I am aware that the build of html and tx-config are two separate processes... so maybe it is harder then I hope :-)

TIA

@rffontenelle
Copy link
Contributor

Hi @rduivenvoorde. I don't think so. Transifex resource slugs are not visible for Sphinx when building a reST doc regardless of the file format (html, epub, etc.). Transifex resources slugs are available when interacting with Transifex, e.g. pulling or pushing translations or source strings.

The qgis-documentation.docs--user_manual--introduction--qgis_gui is a Transifex resource slug which is basically a conversion of the filepath into something compatible with URLs (directory separators become double-hyphens '--', dots become underscore '_' and file extension is removed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants