Karen, I have not forgotten you. I'm in the midst of the V4.5 deployment, but should have some time later to take a look at this.
On Wed, Mar 24, 2021 at 12:42 PM Karen K <[email protected]> wrote: > Localization seems difficult to me in the moment. It works like that that > the user defines a lot of entries in weewx.conf or skin.conf. > > The disadvantages are to me: > > - It makes the configuration files very long. > - Changing localization involes changing lots of entries. > - Skins cannot come with multiple localizations included. > > So I thought about it for a long time, and I gave it a try. I want to > present a possible solution. > > To simplify the process a localization file is used that is referenced in > weewx.conf. To change localization simply the file name is changed. Then > the values come from another file. Each localization file has the same > structure as skin.conf. If the localization file has no entry for a label > the value from weewx.conf or skin.conf is returned instead. > > Usage is simple: for example $locale('obs.label.outTemp') looks for an > entry 'outTemp' in section [Labels][[Generic]] in the localization file. It > it is there, its value is returned. Otherwise the value from skin_dict is > returned. > > Advantages are: > > - Label value texts can be "outsourced" to separate files. > - Localization can be changed by changing one single entry. > - Skin authors can ship their packages with multiple localizations > included. > - No breaking changes. > > An alternative to that solution would be to include the localization > lookup into the standard $obs.label... or $Extras... lookup. > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-development/259e43e6-efe9-467e-9949-862dda0f13c8n%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-development/259e43e6-efe9-467e-9949-862dda0f13c8n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/CAPq0zEC3qQgVr_-DWMF2q2khft2ZZw-eA9EF1dfS7Xt4h1B8gw%40mail.gmail.com.
