Darned good question, and I'm not sure I know the answer. Because the Cheetah template engine allows you to include Python code, one thing you could try is to set the desired locale at the top of the template. Something like
#import locale #locale.setlocale(locale.LC_ALL, 'fr_FR.utf8') ## Hopefully this is in french! $current.dateTime I'm not sure if this will work, because I'm not sure exactly when the binding happens for Python included in the template. I assume (and hope!) that it's early, so this would work. Give it a try. -tk On Fri, Nov 25, 2016 at 3:08 PM, M0GLH <[email protected]> wrote: > I’m running v3.6.1 deb on an RPi 2 with a Vantage Pro 2 and have built > Dutch and English versions of the web pages, but I’m having problems with > default languages (environment locale) and tags that return dateTime values. > > > The OS environment locale is set to GB English by default, mainly for my > convenience, but I want Weewx to generate web pages in both Dutch and > English, with date related names correct for each language. Localising > text in the templates and skins is dead easy, but how can I separately > define a language variable for tags which return dateTime values (e.g. > week.*****.minTime > or month.*****.maxTime) so that these are correct for the language of > the particular skin and templates it appears in, for example, Monday on > English pages, Maandag on Dutch pages, and Lundi on French pages. > > > I have two different skins, each with a full set of templates. I plan on > adding a third set in French, and I want date presentations in each to > match that page's language. If I change the default environment locale, *all > *labels which use locale are generated in that language which will be > incorrect for one or more of the three languages. > > > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "weewx-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
