Include Files in weewx.conf? Repeated Definitions in Different Sections of the File.

60 views
Skip to first unread message

Karen K

unread,
Dec 29, 2020, 8:08:40 AM12/29/20
to weewx-user
The documentation recommends to place translated texts for labels etc. in weewx.conf. Especially the Belchertown skin has huge amounts of labels and texts. So I got a huge
weewx.conf file containing all those translations to - in that case - german language.

Additionally I want to upload the skin to 2 different places, one local at home and one outside in the Internet. The MQTT configuration is different. So I could put 2 sections for the same skin into weewx.conf, each one with another MQTT configuration.

But for all the label texts I have to copy them to both the 2 sections.

OK, I could put those texts in the general section of StdReport, but then I would loose the english texts that are included in the skin itself. And it would be nice to have both a german and an english version of the skin uploaded to the web server.

Are there any possibilities besides copying all the definitions and have it twice in weewx.conf?

Or is there some special section within weewx.conf to hold language specific definitions?

Karen K

unread,
Dec 30, 2020, 10:48:39 AM12/30/20
to weewx-user
So I had an idea how to manage english and german versions of the skin in parallel.

I created a second directory in the skin directory, in this case called "Belchertown-de". Then I linked all files from the original Belchertown directory by means of Linux "ln -s" command to the new directory, except those, that contain different information, such as skin.conf. The files that contain different information I copied instead of linking, and I edited them afterwards.

The advantage I see is that: 
  • If there is an update of the skin available the changed files are preserved.
  • weewx.conf does not become that huge because of lots of label texts.
  • You can use the template multiple times with little differences that can be included in weewx.conf, for example different mqtt configuration.
  • In case of changes it is not necessary to restart weewx as it would be if the values are within weewx.conf.

The disadvantage is:
  • You need to be very very careful not to open the linked files for editing because - as a side effect - it changes the file for the other version, too.
Reply all
Reply to author
Forward
0 new messages