I think I finally figured out the html_static_path trick. With the following image:
.. image:: _static/images/image.png And a directory structure like this: _static/en/images/image.png _static/fr/images/image.png If I change my config.py from this: html_static_path = ['_static/en'] To this: > html_static_path = ['_static/fr'] My French images will be placed in the compiled folder and accessible to the generated html. The only downside with this approach is that the build process won't find the images in relationship to the rst files: WARNING: image file not readable: _static/images/image.png > Which makes the warnings useless (would be good to know if I am actually missing an image), and any image processing that could take place. This seems workable, but not entirely desirable. Any better solutions, or is this a gap in the internationalization component of sphinx-doc for now? Thanks Mike > On Monday, May 26, 2014 3:44:03 PM UTC-3, Michael Caplan wrote: > > Hi there, > > I'm evaluating Sphinx for a multi-lingual documentation project. I'm > struggling to find a solution around images containing language sensitive > info. > > *Is their a way that I can handle changing the path path from an "english" > image to a path to an image in another language?* > > The only option I found in my research is outlined here: > > http://wiki.typo3.org/Localization_(reST) > > What they are advocating is that substitutions be used for defining > multiple language based paths to an image, and the translated gettext file > would handle swapping the substitution token for another. This seems > functional (just for images I understand and not for figures), however, it > then puts the power in the translator managing the .po files. I don't see > how practically I can rely on the translator to correctly change the > substitution token. > > Ideally I would have a way to tell sphinx to look for images in a language > specific folder either in the config.py or the command line. I've played > with html_static_path, but that doesn't seem to do what I want. > > Tips? > > > Thanks, > > Mike > > -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.
