Beta of version 4.6.0 available

167 views
Skip to first unread message

Tom Keffer

unread,
Aug 13, 2021, 1:07:54 PM8/13/21
to weewx-development
Notable change since the alpha versions is that the "lang" files have been "flattened." This makes them easier to maintain.

Find the beta in the usual place: https://weewx.com/downloads/development_versions/

CHANGE LOG:
Easy localization of all skins that come with WeeWX. Big thanks to user Karen,
who drove the effort! PR #665.

Allow options --date, --from, and --to to be used with wee_database --reweight.
PR #659. Thanks to user edi-x!

Added Cheetah helper functions $jsonize(), $rnd(), and $to_int().

Added conversions for unix_epoch_ms and unix_epoch_ns. Calculations in
celestial.inc now explicitly use unix_epoch.

Added almanac attribute "visible" and "visible_change". For example,
$almanac.sun.visible returns the amount of daylight, $almanac.sun.visible_change
the difference since yesterday.

Fixed problem that could cause weather xtypes services not to shut down
properly. PR #672. Thanks again to user edi-x!

Added Cheetah tag $filename, the relative path of the generated file. Useful
for setting canonical URLs. PR #671. Thanks again to user Karen!

XType get_scalar() and get_series() calls can now take extra keyword arguments.
PR #673.

Fixed problem where a bad clock packet could crash the WMR100 driver.

Davis documentation for LOOP2 10-minute wind gusts is wrong. The Vantage
actually emits mph, not tenths of mph. Changed driver so it now decodes the
field correctly. Fixes issue #686.

t...@tom.org

unread,
Aug 13, 2021, 5:49:12 PM8/13/21
to weewx-development
If anyone wants to play around with a Docker image of this beta, it's at mitct02/weewx:4.6.0b1

Karen K

unread,
Sep 9, 2021, 10:16:22 AM9/9/21
to weewx-development
Tom Keffer schrieb am Freitag, 13. August 2021 um 19:07:54 UTC+2:
Notable change since the alpha versions is that the "lang" files have been "flattened." This makes them easier to maintain.

I would like to comment this. 

For the skins that come with WeeWX like Seasons skin I would agree with you that the flattened language files are easier to maintain.

For big skins that are available as an extension there is a reason that speaks against flattened files. That is: If the skin has a lot of pages and thus a log of templates, the author may use a central .inc file to define the HTML and page headers including page dependent meta tags and the page title H1 tag. And in this case $gettext[$page]['title'] and something comes in useful as you can put it into the .inc file and it picks the appropriate text for the given template automatically.

Tom Keffer

unread,
Sep 9, 2021, 11:12:49 AM9/9/21
to Karen K, weewx-development
I've tried it both ways, and have come to prefer the "flatted" approach for a few reasons.

If a translator forgets to translate "title", you end up with the literal text "title", which is not very useful. The English equivalent serves as a better backstop.

Better reuse of translated strings. I was able to eliminate a number of duplicates by flattening things.

While $page means something to you and me, it does not to a translator. I had to continually remind myself whether it is a symbol for the HTML page name, the .inc name, or the name of the subsection in the .conf file. 

Finally, having added a bunch of translations to a bunch of different skins, it's hard, tedious work! We desperately need some tools to help. in particular, an equivalent to the GNU utility xgettext. I think this will be a lot easier to write with a flattened name space. In fact, despite having pushed you in that general direction, I'm thinking of doing away with the "subscripting" notation and going back to your original "functional" notation of $gettext('translate me', 'some context'). It would be easier to write a tool for it.

This is why the beta period has been so long. The stakes are high, and I want to experiment and make sure we get it right!

-tk

All-in-all, I didn't see the problem it was trying to solve. 

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/6adf05be-c438-4f76-adc2-9e2751aca6cbn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages