[Qgis-community-team] Translation of images

Tim Sutton tim at linfiniti.com
Wed Aug 1 12:24:53 PDT 2012


Hi Paolo

On Wed, Aug 1, 2012 at 2:48 PM, Paolo Corti <pcorti at gmail.com> wrote:
> On Thu, Jul 19, 2012 at 9:39 AM, Rudi Thiede <rudi at linfiniti.com> wrote:
>> Hi all,
>>
>> Thanks for the help so far Paolo!
>>
>> Just wanted to know, is there a way to have image paths added automatically
>> to the generated .pot files? This is for another project -
>> QGIS-Training-Manual - but using the same structure as QGIS-Documentation
>> for internationalization.
>>
>> Right now when .pot files are generated, image paths are not seen as targets
>> for translation. So a translator editing the .po files would be unable to
>> specify new images.
>>
>> I've been looking at QGIS-Documentation but have been unable to identify so
>> far how this works in that project.
>>
>>
>
> You are right, so this cannot be the approach to follow.
> We could use replacements in the rst_epilog section of conf.py.
>
> For example we could do something like this using a language variable
> in conf.py (but needs to be tested):
>
> rst_epilog = """
> .. |nix| image:: /img/en/nix.png
>    :width: 1em
> .. |win| image:: /img/en/win.png
>    :width: 1em
>    ...
> .. |image_path| replace:: /img/%s
> """ % language
>
> and then use this in the rst files:
>
> .. figure:: |image_path|/shortcuts.png
>
> and compile like this:
>
> $(SPHINXBUILD) -b html -D language=$$lang $(ALLSPHINXOPTS)
> $(BUILDDIR)/$(DESTINATION)/html/$$lang;\
>

We adopted another approach in the end - with a little script we
rename the static directory before generating the docs for each
locale. See

https://github.com/qgis/QGIS-Training-Manual

and

https://github.com/qgis/QGIS-Training-Manual/blob/master/post_translate.sh

We havent announced it widely yet because I want to remove some
linfiniti branding still and add some QGIS branding, but the results
of our efforts so far are here:

http://manual.linfiniti.com

Regards

Tim

> cheers
> p
>
> --
> Paolo Corti
> Geospatial software developer
> web: http://www.paolocorti.net
> twitter: @capooti
> skype: capooti
> _______________________________________________
> Qgis-community-team mailing list
> Qgis-community-team at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-community-team



-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Visit http://linfiniti.com to find out about:
 * QGIS programming services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux Irc: timlinux on #qgis at freenode.net
==============================================


More information about the Qgis-community-team mailing list