Hi Shirou,

Thanks for the suggestion!  The issue I see with this approach is that 
adding a new language will require that I go through all the ifconfig 
statements to add a new case.  That could be a huge undertaking.

Appreciate the suggestion!

Mike


On Monday, May 26, 2014 11:17:41 PM UTC-3, shirou wrote:
>
> Hi, 
>
>
> I think this is not a best solution but how about using ifconfig. 
>
> To use ifconfig, add ifconfig to your conf.py like 
>
> extensions = [ 
>     'sphinx.ext.ifconfig', 
> ] 
>
> and this is an example to use. 
>
> -------- 
> .. ifconfig:: language is 'en' 
>
>    .. figure:: http://sphinx-doc.org/_static/pocoo.png 
>       :alt: english alt 
>
> .. ifconfig:: language is 'ja' 
>
>    .. figure:: http://sphinx-doc.org/_static/sphinxheader.png 
>       :alt: japanese alt 
> -------- 
>
> Note if your language setting in conf.py is commented out, this becomes 
> error. 
>
> I think the better solution is to use po file to set image path but I 
> hope it helps you. 
>
> Regards, 
>
> WAKAYAMA Shirou 
>
>
> 2014-05-27 3:44 GMT+09:00 Michael Caplan <[email protected] <javascript:>>: 
>
> > 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] <javascript:>. 
> > To post to this group, send email to 
> > [email protected]<javascript:>. 
>
> > Visit this group at http://groups.google.com/group/sphinx-users. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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.

Reply via email to