Le Wed, 4 Apr 2012 17:50:35 +0200, David MENTRE <dmen...@linux-france.org> a écrit :
> To continue this discussion, it has been privately suggested to put > ocitysmap.conf content in a .py file (e.g. __init__.py). That way we > could easily integrate stylesheet names into the set of strings to > translate. > > One counter argument is that ocitysmap.conf is a configuration file, > that can be tweaked by the "user". Considering that installation of > maposmatic is fairly complex and that we are using a scripting > language, it does seem reasonable to me to tweak a Python file than a > configuration file. My point was not that a Python file was harder or easier to modify than a .conf file. My point is that the configuration file is, at least currently, *NOT* part of the Git repository. So this makes it currently impossible to add translations into it, since it wouldn't make sense to ask the i18n.py script to parse a file that isn't part of the Git repository. > Overall, I would: > * Put content of ocitysmap.conf into a Python file, with appropriate > translation markers; > > * Update INSTALL so that the needed external style sheets > (mapnik-osm, MapQuest*) should be installed somewhere and pointed to > in ocitysmap installation through a *well defined* (e.g. mapnik-osm, > MapQuestEU, MapQuestUS, MapQuestUK) symbolic link into stylesheet/ > directory. > > If at one point we need another style sheet, we will update both > Python file and README accordingly. We can also document how to add a > style sheet in a documentation file or on the wiki. So this means that we no longer have a configuration file, but rather an exhaustive list of the stylesheets we support. The user is supposed to make symbolic links to the stylesheet installation directory, as you suggest. I would add something else to this: ocitysmap should gracefully ignore a stylesheet for which the symbolic link is missing, so that users are not forced to install *all* stylesheets to get a working ocitysmap/maposmatic combination. However, all this requires Django to pass the current website language when calling the "get stylesheet list", "get layout list" and "get papersize list" from ocitysmap, but this is certainly doable. Regards, Thomas -- Thomas Petazzoni http://thomas.enix.org MapOSMatic http://www.maposmatic.org Logiciels Libres à Toulouse http://www.toulibre.org Embedded Linux http://www.free-electrons.com