diff --git a/bin/weewx/cheetahgenerator.py b/bin/weewx/cheetahgenerator.py index 75478a4b..f5d7cd26 100644 --- a/bin/weewx/cheetahgenerator.py +++ b/bin/weewx/cheetahgenerator.py @@ -90,7 +90,8 @@ default_search_list = [ "weewx.cheetahgenerator.Stats", "weewx.cheetahgenerator.UnitInfo", "weewx.cheetahgenerator.Extras", - "weewx.cheetahgenerator.JSONHelpers"] + "weewx.cheetahgenerator.JSONHelpers", + "weewx.gettext.Gettext"] # ============================================================================= @@ -149,7 +150,7 @@ class CheetahGenerator(weewx.reportengine.ReportGenerator): self.initExtensions(gen_dict[section_name]) # Generate any templates in the given dictionary: - ngen = self.generate(gen_dict[section_name], self.gen_ts) + ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts) self.teardown() @@ -198,7 +199,7 @@ class CheetahGenerator(weewx.reportengine.ReportGenerator): while len(self.search_list_objs): del self.search_list_objs[-1] - def generate(self, section, gen_ts): + def generate(self, section, section_name, gen_ts): """Generate one or more reports for the indicated section. Each section in a period is a report. A report has one or more templates. @@ -219,7 +220,7 @@ class CheetahGenerator(weewx.reportengine.ReportGenerator): if subsection in CheetahGenerator.generator_dict: section[subsection]['summarize_by'] = subsection # Call recursively, to generate any templates in this subsection - ngen += self.generate(section[subsection], gen_ts) + ngen += self.generate(section[subsection], subsection, gen_ts) # We have finished recursively processing any subsections in this # section. Time to do the section itself. If there is no option @@ -308,7 +309,7 @@ class CheetahGenerator(weewx.reportengine.ReportGenerator): pass searchList = self._getSearchList(encoding, timespan, - default_binding) + default_binding, section_name) tmpname = _fullname + '.tmp' try: @@ -369,14 +370,15 @@ class CheetahGenerator(weewx.reportengine.ReportGenerator): return ngen - def _getSearchList(self, encoding, timespan, default_binding): + def _getSearchList(self, encoding, timespan, default_binding, section_name): """Get the complete search list to be used by Cheetah.""" # Get the basic search list timespan_start_tt = time.localtime(timespan.start) searchList = [{'month_name' : time.strftime("%b", timespan_start_tt), 'year_name' : timespan_start_tt[0], - 'encoding' : encoding}, + 'encoding' : encoding, + 'page' : section_name}, self.outputted_dict] # Bind to the default_binding: diff --git a/bin/weewx/gettext.py b/bin/weewx/gettext.py new file mode 100644 index 00000000..0d993671 --- /dev/null +++ b/bin/weewx/gettext.py @@ -0,0 +1,142 @@ +# Simple localization for WeeWX +# Copyright (C) 2021 Johanna Karen Roedenbeck + +# See the file LICENSE.txt for your full rights. + +""" + provides tag $gettext(key, page) + + Language dependent texts are stored in special localization files. + The are merged into skin_dict in reportengine.py according to the + language the user chooses in weewx.conf for the given report. + Different reports can be in different languages. + + The file defines language dependent label texts as well as other + texts used in skins. + + The values provided by $gettext(key, page) are found in the file + in the [Texts] section. Subsections in the [Texts] section can + provide special texts for certain templates. To get values from + subsections $gettext() is called with special tag $page for the + parameter page. That is especially useful in include files that + are included in multiple templates. + + Examples: + + Assume the localization file to be: + + [Texts] + Key1 = Text1 + [[index]] + Title = Text2 + [[othertemplate]] + Title = Text3 + + With that file is: + + $gettext("Key1") ==> Text1 + + $gettext("Title",$page) ==> is Text2 if included in template "index" + and Text3 if included in template + "othertemplate" + + $gettext(page=$page).Title ==> same as before + + You can use "speaking" key names. If they contain whitespace they need + to be enclosed in quotes in the localization file + + If the value contains commas you must enclose it in single or double + quotes. Otherwise an array instead of a string is returned. + +""" + +from six.moves import collections_abc +from weewx.cheetahgenerator import SearchList +from weeutil.weeutil import KeyDict +import weeutil.config + +# Test for new-style weewx v4 logging by trying to import weeutil.logger +import weeutil.logger +import logging + +log = logging.getLogger(__name__) + + +class Gettext(SearchList): + + def get_extension_list(self,timespan,db_lookup): + + def locale_label(key='',page=''): + """ $gettext() + + key: key to look up for + page: section name + + """ + _text_dict = self.generator.skin_dict.get('Texts',{}) + + # get the appropriate section for page if defined + # Note: no hierarchy here + if page: + if page not in _text_dict: + log.error("could not find section [Texts][[%s]] for report %s" % (page,self.generator.skin_dict.get('REPORT_NAME','unknown'))) + # Note: no 'else:' here, because we need the empty dict + # page is specified --> get subsection "page" + _text_dict = _text_dict.get(page,{}) + + # if key is not empty, get the value for key + if key: + # return the value for key + # if key not in _text_dict return key instead + return KeyDict(_text_dict)[key] + + + # if key is empty but page is not return further class instance + if page: + _page_dict = weeutil.config.config_from_str('') + #merge_dict = self.generator.skin_dict.get('Labels',{}).get('Generic',{}) + #if merge_dict: + # weeutil.config.merge_config(_page_dict,merge_dict) + merge_dict = Gettext._get_cheetah_dict(self.generator.skin_dict.get('CheetahGenerator',{}),page) + if merge_dict: + weeutil.config.merge_config(_page_dict,merge_dict) + weeutil.config.merge_config(_page_dict,_text_dict) + return _page_dict + + # if key as well as page are empty + return ParallelDict(_text_dict) + + return [{'gettext':locale_label}] + + @staticmethod + def _get_cheetah_dict(cheetah_dict,page): + """ find section page in cheetah_dict recursively """ + + for section in cheetah_dict.sections: + subsection = Gettext._get_cheetah_dict(cheetah_dict[section],page) + if subsection is not None: + return subsection + if page in cheetah_dict: + return cheetah_dict[page] + return None + + + +class ParallelDict(collections_abc.Mapping): + + def __init__(self, source): + self.source = source + + def __getitem__(self, key): + try: + return self.source[key] + except KeyError: + return key + + + def __len__(self): + return self.source.__len__() + + def __iter__(self): + for key in self.source: + yield key diff --git a/bin/weewx/reportengine.py b/bin/weewx/reportengine.py index c3b45977..a9d761cd 100644 --- a/bin/weewx/reportengine.py +++ b/bin/weewx/reportengine.py @@ -254,6 +254,72 @@ class StdReportEngine(threading.Thread): for scalar in self.config_dict['StdReport'].scalars: skin_dict[scalar] = self.config_dict['StdReport'][scalar] + ####################################################################### + # internationalization support + + # The key 'lang' defines a language code like 'en' or 'de'. It is + # used as a file name for a language file that is located in the + # 'lang' subdirectory of the skin directory. + + # get the language option if defined + # (As config_dict is not merged into skin_dict so far, + # skin_dict['lang'] has not the final value here. We + # have to take config_dict into account, too.) + lang_config = self.config_dict['StdReport'][report].get('lang',skin_dict.get('lang',None)) + + if lang_config: + + # Now add the options in the report's localization file. Start by figuring where it is located. + lang_config_path = os.path.join( + self.config_dict['WEEWX_ROOT'], + self.config_dict['StdReport']['SKIN_ROOT'], + self.config_dict['StdReport'][report].get('skin', ''), + 'lang', + lang_config+'.conf') + + # Now retrieve the language dictionary for the skin. Wrap it in a try block in case we fail. It is ok if + # there is no file - everything for a skin might be defined in the weewx configuration. + try: + merge_dict = configobj.ConfigObj(lang_config_path, file_error=True, encoding='utf-8') + log.debug("Found localization file %s for report '%s'", lang_config_path, report) + # make sure 'Texts' is present and a dict (section) + if not isinstance(merge_dict.get('Texts',None),dict): + if 'Texts' in merge_dict: + log.error("'Texts' is not a section in '%s'" % lang_config_path) + merge_dict['Texts']={} + # set language code for $gettext.lang + merge_dict['Texts']['lang'] = os.path.basename(lang_config_path).split('.')[0] + # Merge the skin config file in: + weeutil.config.merge_config(skin_dict, merge_dict) + if self.first_run: + log.info("Using localization file %s for report '%s'" % + (lang_config_path, report)) + except IOError as e: + log.debug("Cannot read localization file %s for report '%s': %s", + lang_config_path, report, e) + except SyntaxError as e: + log.error("Failed to read localization file %s for report '%s': %s", + lang_config_path, report, e) + raise + + # See if the user wants this report based on another unit system than US. + # The value can be US, METRIC, or METRICWX. + # (As config_dict is not merged into skin_dict so far, + # skin_dict['units_base'] has not the final value here. We + # have to take config_dict into account, too.) + report_units_base = self.config_dict['StdReport'][report].get('units_base',skin_dict.get('units_base',None)) + + if report_units_base: + # Get the chosen unit system out of units.py. Copy it to prevent + # the original from being changed. Merge it into skin_dict. + try: + merge_dict = weewx.units.std_groups[weewx.units.unit_constants[report_units_base]].copy() + weeutil.config.merge_config(skin_dict, {'Units':{'Groups':merge_dict}}) + except (SyntaxError,TypeError,IndexError,ValueError,IOError) as e: + log.error("error merging unit system '%s' for report '%s'" % (report_units_base,report)) + + ####################################################################### + # Finally, inject any overrides for this specific report. Because this is the last merge, it will have the # final say. weeutil.config.merge_config(skin_dict, self.config_dict['StdReport'][report]) diff --git a/docs/customizing.htm b/docs/customizing.htm index 5a890f01..eea22bef 100644 --- a/docs/customizing.htm +++ b/docs/customizing.htm @@ -443,7 +443,8 @@ Version: 4.6

Each report has a skin associated with it. For most reports, the relationship with the skin is an - obvious one: it contains the templates, any auxiliary files such as background GIFs or CSS style sheets, and + obvious one: it contains the templates, any auxiliary files such as background + GIFs or CSS style sheets, files with localization data, and a skin configuration file, skin.conf. If you will, the skin controls the look and feel of the report. Note that more than one report can use the same skin. For example, you might want to run a report that uses US Customary units, then run another report against the same skin, but @@ -807,6 +808,16 @@ db_manager.getSql("SELECT SUM(rain) FROM %s "\ [[[Labels]]] / [[[[Generic]]]] Highest precedence. Has the final say. + + skins/report_name/ lang/language_code.conf + + Affects only the report report_name. + [Labels] / [[Generic]] + Internationalization support. Preferably + supplied by the skin author. + weewx.conf [StdReport] / [[Defaults]] @@ -884,6 +895,46 @@ db_manager.getSql("SELECT SUM(rain) FROM %s "\ wants to use the string Exterior Temperature, instead of Outside Temperature for the label for outTemp. The file includes no definition for inTemp.

+ +

+ Now suppose the skin author took care of internationalization + and provided language files. In this case s/he would not have + set the label in skin.conf but in + a language file, for English in + lang/en.conf, for german in + lang/de.conf etc. +

+

+ lang/en.conf would contain + what was defined in skin.conf + before: +

+
+...
+[Labels]
+    ...
+    [[Generic]]
+        ...
+        outTemp = Exterior Temperature
+
+

+ lang/de.conf would contain: +

+
+...
+[Labels]
+    ...
+    [[Generic]]
+        ...
+        outTemp = Außentemperatur
+        inTemp = Innentemperatur
+
+

+ The user sets the language by the optional + lang option in + weewx.conf. +

+

Finally, for purposes of illustrating precedence, suppose the [StdReport] section of weewx.conf contains this: @@ -904,6 +955,10 @@ db_manager.getSql("SELECT SUM(rain) FROM %s "\ [[[Labels]]] [[[[Generic]]]] outTemp = Barn Temperature + + [[LifeC]] + skin = Life + lang = de

@@ -931,20 +986,31 @@ db_manager.getSql("SELECT SUM(rain) FROM %s "\ Inside Temperature Barn Temperature + + LifeC + Innentemperatur + Außentemperatur +

- Note how the values specified for inTemp are not overridden anywhere, so the value + Note how the values specified for inTemp + are not overridden anywhere, except + lang/de.conf, so the value specified in weewx/defaults.py, that is, Inside Temperature, is used for all reports.

+ class="code">Inside Temperature, is used for all reports, + except LifeC.

The value for outTemp is not overridden for report SeasonsA, so it uses the label specified in weewx/defaults.py, that is, Outside Temperature. By contrast, for the "Life" reports, a value for outTemp was specified in the skin so, in the absence of any user override, its value, Exterior - Temperature will be used as the new default. Finally, for the report LifeB, + Temperature will be used as the new default. For the report LifeB, the user has specified an override for outTemp, so that value, Barn Temperature, is used. + Finally, for the report LifeC + a language has been set, so the labels are taken from the + specified language file.

@@ -1119,7 +1185,40 @@ db_manager.getSql("SELECT SUM(rain) FROM %s "\

To accomplish this, we will generate two reports, one using the defaults, the other using overrides to - change the target unit system and the target directory. The section [StdReport] + change the target unit system and the target directory. +

+

+ If you only want to use one of the predefined unit systems + like US or + METRIC you can simply specify + a unit system in the report configuration like this: +

+
+[StdReport]
+
+    # Where the skins reside, relative to WEEWX_ROOT
+    SKIN_ROOT = skins
+
+    # Where the generated reports should go, relative to WEEWX_ROOT
+    HTML_ROOT = public_html
+
+    # The database binding indicates which data should be used in reports.
+    data_binding = wx_binding
+
+    [[SeasonsUSReport]]
+        skin = Seasons
+        units_base = US
+        enable = true
+
+    [[SeasonsMetricReport]]
+        skin = Seasons
+        units_base = METRIC
+        enable = true
+        HTML_ROOT = public_html/metric
+

+ If you need individual settings for a lot of units you + can specify the units directly in the report configuration. + In this case the section [StdReport] will look like this:

@@ -2962,6 +3061,207 @@ $month.outTemp.series(aggregate_type='max', aggregate_interval='day', time_serie
             Tags for series.
         

+

General tags

+ +

+ There are some general tags, that do not reflect observation + data but technical data of processing the template files. + You can especially use them in #if + expressions to control how Cheetah processes the template. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TagDescription
$month_nameName of the month, the file is created for
$year_nameYear, the file is created for
$encodingCharacter encoding, to which the file is converted + after creation. Possible values are + html_entities, + strict_ascii, + normalized_ascii, and + utf-8. +
$pageName of the page that is actually processed. + This is the section name from + skin.conf + where the template is described. You can especially + use it in include files that are included in multiple + templates. So parts of the content defined in the include + file can depend on the template file, for example + header lines. You can also use it together with + $gettext to structure + the language file.
$gettext.langLanguage code set by the + lang option + for the report. You can use this tag in + #if expressions and + to include language codes where the HTML + specification requires them. +
$gettext(page=$page).template + File name of the template actually processed +
+ + +

+ Internationalization support with + $gettext +

+

+ Web pages and other files to be created do not only contain + observation values and their labels but also static text. + The $gettext tag provides + internationalization support for those static texts. + To support internationalization do not write static + text into to template or include files but use + $gettext there to define it. +

+

+ Suppose you write a skin called + "YourSkin" + and + you want to have a head line in there, that + is "Current Conditions" in English, but "aktuelle Werte" + in german, "Conditions actuelles" in french etc. Then + the template file could contain: +

+
...
+<h1>$gettext("Current Conditions")</h1>
+...
+

+ The section of weewx.conf + configuring your skin could now look like this: +

+
...
+[StdReport]
+    ...
+    [[YourSkinReport]]
+        skin = YourSkin
+        lang = fr
+    ...
+

+ With lang = fr the report + is in french. To get it in English, replace the language + code fr by the code for English + en. And to get it in german + use de. +

+

+ To make that work a language file has to be created for + each language supported. The language files reside in + the lang subdirectory of the + skin directory that is defined by the + skin option. The file name + of the language file is the language code appended + by .conf, for example + en.conf, + de.conf, or + fr.conf. +

+

+ The language file has the same layout as + skin.conf, i.e. + you can put language specific versions of the labels there. + Additionally a section [Texts] + can be defined to hold the static texts used in the skin. + For the example above the language files would contain + the following: +

+

en.conf

+
...
+[Texts]
+    "Current Conditions" = Current Conditions
+    ...
+

de.conf

+
...
+[Texts]
+    "Current Conditions" = Aktuelle Werte
+    ...
+

fr.conf

+
...
+[Texts]
+    "Current Conditions" = Conditions actuelles
+        
+

+ While it is not technically necessary we recommend to use + the whole English text for key. The template is easier to + read then. And it is easier for the person who translates + the texts if the original English version of the text is + found on the left side. But there are cases when that is + not possible, and then you can use any string you find + reasonable enough to describe the entry. +

+

+ See the SKIN_ROOT/Seasons/lang + subdirectory for examples of language files. +

+ +

+ If your skin is big and there are lots of texts to define + you can structure the [Texts] + section by subsections. Each template can have its own + subsection. The subsections need to be called identically + to the respective sections in skin.conf. +

+

+ Assuming you have a template section called + [[[index]]] and another + section called [[[othertemplate]]], + then the language files could look like this: +

+
...
+[Texts]
+    ...some general texts here...
+    [[index]]
+        ...some texts for template index here, for example
+        Key = Some text
+    [[othertemplate]]
+        ...some texts for template othertemplate here, for example
+        Key = Some other text
+

+ To refer to these template specific texts add + $page as parameter to + $gettext(). For example: +

+
...
+$gettext("Key",$page)
+...
+

+ If template "index" is processed, the entry "Key" in + subsection [[index]] is + used, and the value is "Some text". + If template "othertemplate" is processed, the + entry "Key" in subsection + [[othertemplate]] + is used, and the value is "Some other text". + You can place this tag in an include file + that is called by both "index" and "othertemplate", + and the value is chosen from the appropriate subsection. +

+ +

Almanac

@@ -4179,10 +4479,49 @@ class MyStats(SearchList): # 1

Localization

- This section is provides suggestions for localization, including translation to different languages and + This section provides suggestions for localization, + including translation to different languages and display of data in formats specific to a locale.

+ +

If localization is already done

+

+ First look whether the skin already came with a localization + for your language. If there is a + lang subdirectory in the skin + directory, look into it. There you find a file for each + language this skin is already localized to. If your + language is there, all you need to do is to select it + in weewx.conf: +

+
...
+[StdReport]
+    ...
+    [[TheSkin]]
+        skin = skin_directory
+        lang = language_code
+        ...
+

If only your language is missing

+ +

+ If the lang subdirectory + is present in the skin directory the skin is + probably prepared already for localization. + The only thing to do then is translating. + To do so, copy the file + en.conf and name it + according to the language code of your language. + Then translate all the strings on the right + side of the equal signs to your language. + The skin author may be interested in your + language file to ship it together with the + skin for the use of other users. + Last set the language code in + weewx.conf + as described in the previous section. +

+

How to localize a single report

@@ -4191,15 +4530,37 @@ class MyStats(SearchList): # 1 formats and language.

+

Create the language file

+ +

+ Create a subdirectory called lang + in the skin directory. + + Then create a file named by the language code with the + suffix .conf. For example, if + you want to translate to spanish, name the file + es.conf. + The next step is + to make the templates language-aware as described in the + following section. +

+

Translate the templates

- In every HTML template (these typically have a file suffix of .html.tmpl) change - the HTML "lang" attribute to the target language. For example, for Spanish use es: + Open the template file and the language file in different + editor windows. It is much easier if you can change both + files simultaneously. +

+ +

+ In every HTML template (these typically have a file suffix of + .html.tmpl) change + the HTML "lang" attribute to a configurable value.

 <!DOCTYPE html>
-<html lang="es">
+<html lang="$gettext.lang">
   <head>
     <meta charset="UTF-8">
     ...
@@ -4232,12 +4593,26 @@ class MyStats(SearchList):                                                   # 1
         
 <div id='current_widget' class="widget">
   <div class="widget_title">
-    Conditions Actuelle
+    $gettext("Current Conditions")
     <a class="widget_control"
       onclick="toggle_widget('current')">&diams;</a>
   </div>
         
- +

+ In the language file start a + [Texts] section and place the + translation there like: +

+
...
+[Texts]
+    ...
+    "Current Conditions" = Conditions Actuelles
+    ...
+

+ Repeat that for all strings you find. Make sure not + to replace HTML tags and HTML options. +

+

Translate labels and modify local options

@@ -4354,13 +4729,21 @@ class MyStats(SearchList): # 1 locales? This example shows how to translate the Seasons skin for multiple languages.

- Create a directory for each language. Each directory contains template files and a skin configuration file. - Any text in each template file should be in the target language. Ensure that each HTML template file has the - lang set properly. + Create a subdirectory called + lang in the skin directory. + The language files containing the language dependent + information go there. Start creating a language file + for the primary language and save it to the + lang directory. The name + of the file consists of the language code of the + target language and the suffix + .conf. Later on you can + create language files for each language you want + to support based on that file.

- Translate observation names and other labels, and put them into the skin configuration files. There should - be one configuration file for each language. + Translate observation names and other labels, and put them + into the created language file.

Ensure that any locale-specific formatting is specified properly. For example, consider the

- The result will be a directory of templates and configurations, with one directory for each + Static texts are localized using the + $gettext("original text") tag. + Create a section [Texts] + in the language file and place a line +

+
"original text" = translated text
+

+ there in each language file. In the template file you refer + to those texts by +

+
$gettext("original text")
+

+ According to the language setting of the report the tag + stands for the text in the appropriate language. +

+ +

+ The result will be a directory of language files + with one file for each language/localization.

-
-skins/Seasons/
-skins/Seasons/en/skin.conf
-skins/Seasons/en/index.html.tmpl
-skins/Seasons/es/skin.conf
-skins/Seasons/es/index.html.tmpl
-skins/Seasons/de/skin.conf
-skins/Seasons/de/index.html.tmpl
-skins/Seasons/fr/skin.conf
-skins/Seasons/fr/index.html.tmpl

Users will then create each report in the WeeWX configuration file. @@ -4392,16 +4783,20 @@ skins/Seasons/fr/index.html.tmpl

 [StdReport]
     [[Seasons_en]]
-        skin = Seasons/en
+        skin = Seasons
+        lang = en
         HTML_ROOT = public_html/en
     [[Seasons_es]]
-        skin = Seasons/es
+        skin = Seasons
+        lang = es
         HTML_ROOT = public_html/es
     [[Seasons_de]]
-        skin = Seasons/de
+        skin = Seasons
+        lang = de
         HTML_ROOT = public_html/de
     [[Seasons_fr]]
-        skin = Seasons/fr
+        skin = Seasons
+        lang = fr
         HTML_ROOT = public_html/fr

The result is multiple reports, each in a different language and localization, independent of the locale of @@ -5696,7 +6091,23 @@ xstats/bin/user/xstats.py

This section contains the options available in the skin configuration file, skin.conf. + class="code">skin.conf. The same options apply to the + language files found in the subdirectory + lang, like + lang/en.conf for English. +

+

+ We recommend to put +

@@ -6104,10 +6515,48 @@ growing_base = 50.0, degree_F class="code">time_delta will be accepted. Default is 300 seconds.

- +

[Texts]

+ +

+ This section applies to language files only. +

+

+ The section [Texts] holds + static texts that are used in the templates. + Generally there are multiple language files, each file + for one language and named by the language code + defined in ISO 639-1. + The entries + give the translation of the texts to the target language, like +

+
"English text" = same text in the target language
+

+ or define texts by keys that can be refereced within the template. +

+
"Key" = some text to display
+

+ To use the English text for the key is recommended, because + the template is easier to read then and while translating + you see the original English text on the left side. +

+

+ Note!
+ Strings that include commas must be included in single or + double quotes. +

+

+ There may be subsections, named like the template + subsections in the + [CheetahGenerator] section of + skin.conf. The entries defined + in such subsections apply to the respective template only. +

[CheetahGenerator]

-

This section contains the options for the Cheetah generator.

+

This section contains the options for the Cheetah generator. + It applies to skin.conf only.

search_list

diff --git a/docs/usersguide.htm b/docs/usersguide.htm index c2dfce2d..d9e3b3fe 100644 --- a/docs/usersguide.htm +++ b/docs/usersguide.htm @@ -2273,8 +2273,11 @@ longitude = -77.0366

These are the four reports that actually generate HTML files and plots. They all ship in the standard WeeWX - distribution. They all use US Customary units by default, but this can be changed by editing section [Defaults]. + distribution. They all use US Customary units by default, but this can be changed + by setting the option units_base or + by editing section [StdReport][[Defaults]].

They all have the following options in common.

@@ -2284,6 +2287,55 @@ longitude = -77.0366 the directory should be any templates used by the skin and a skin configuration file, skin.conf.

+

lang

+

+ Which language to display the skin. + The value to this option is a two-character language code as defined in ISO 639-1. + It defines the language the skin shall be displayed in. + For each language, that a certain skin can display, an appropriate + language file resides in the + lang subdirectory of the + skin directory. It is named by the language code, appended + by .conf, for example + en.conf for English. + If there is no file for your language, + copy en.conf and translate + the texts on the right side of the equal signs to the + language you want to use. It is important that you name + the file according to the list in ISO 639-1. +

+ +

units_base

+

+ Which unit system to use with the skin. That can be + US, + METRIC, or + METRICWX. + If the option is not set, the units set in the + [StdReport][[Defaults]] + section are used. If no defaults are + set, US is the default. + See the section "Changing + the unit system" in the "Customization Guide" + for more details. + The difference between METRICDE + and the other metric unit systems is that it uses + mm for rain and + km/h for wind. + Settings in the section + [[[Units]]][[[[Groups]]]] + overwrite the unit settings resulting from this option + for individual observation types. See "How to + change units" in the "Customization Guide" + for more details. +

+

enable

Set to true to enable the processing of this skin. Set to deleted on the remote server. Valid values are 1 to enable and 0 to disable. Required. Default is 0.

+

[[Defaults]]

+ +

+ This section defines default values for all skins. You can set: +

+ See the Customization Guide + for more details. +

+

+ If the skin you use comes with internationalization + support and you set a language by the + lang option, the settings + resulting from this option overwrite the settings in + the [[Defaults]] section. +

+ +

[StdConvert]

This section is for configuring the StdConvert service. This service acts as a @@ -3081,12 +3155,6 @@ longitude = -77.0366 Default is INNODB.

-

[Defaults]

-

- This section covers a suite of default values, which control things such as which unit system should be - used in reports, what label to be used for an observation type, and how it should be formatted. -

-

[Engine]

diff --git a/skins/Seasons/about.inc b/skins/Seasons/about.inc index 424ab377..85a2d4fd 100644 --- a/skins/Seasons/about.inc +++ b/skins/Seasons/about.inc @@ -6,7 +6,7 @@

- About this weather station + $gettext["About"]
@@ -17,15 +17,15 @@ $station.hardware - Latitude + $gettext["Latitude"] $station.latitude[0]° $station.latitude[1]' $station.latitude[2] - Longitude + $gettext["Longitude"] $station.longitude[0]° $station.longitude[1]' $station.longitude[2] - Altitude + $gettext["GeoAltitude"] $station.altitude diff --git a/skins/Seasons/celestial.html.tmpl b/skins/Seasons/celestial.html.tmpl index 08cfc3f2..467daea4 100644 --- a/skins/Seasons/celestial.html.tmpl +++ b/skins/Seasons/celestial.html.tmpl @@ -3,7 +3,7 @@ #errorCatcher Echo #encoding UTF-8 - + $station.location Celestial Details @@ -31,7 +31,7 @@ #include "titlebar.inc"
-

❰ Current Conditions

+

❰ $gettext["Current Conditions"]

#include "celestial.inc" diff --git a/skins/Seasons/celestial.inc b/skins/Seasons/celestial.inc index 71b75d0d..3f79e92b 100644 --- a/skins/Seasons/celestial.inc +++ b/skins/Seasons/celestial.inc @@ -49,131 +49,131 @@
- Celestial + $gettext[$page]["Title"]
#if $almanac.hasExtras
- + - + - + - + - + - + - + - + - + - + #if $almanac.next_equinox.raw < $almanac.next_solstice.raw ## The equinox is before the solstice. Display them in order. - + - + #else ## The solstice is before the equinox. Display them in order. - + - + #end if - +
☀ Sun
☀ $gettext[$page]["Sun"]
Start civil twilight$gettext[$page]["Start civil twilight"] $almanac(horizon=-6).sun(use_center=1).rise
Rise$gettext[$page]["Rise"] $almanac.sun.rise.format(None_string=$sun_None)
Transit$gettext[$page]["Transit"] $almanac.sun.transit
Set$gettext[$page]["Set"] $almanac.sun.set.format(None_string=$sun_None)
End civil twilight$gettext[$page]["End civil twilight"] $almanac(horizon=-6).sun(use_center=1).set
Azimuth$gettext[$page]["Azimuth"] $("%.1f°" % $almanac.sun.az)
Altitude$gettext[$page]["AstroAltitude"] $("%.1f°" % $sun_altitude)
Right ascension$gettext[$page]["Right ascension"] $("%.1f°" % $almanac.sun.ra)
Declination$gettext[$page]["Declination"] $("%.1f°" % $almanac.sun.dec)
Equinox$gettext[$page]["Equinox"] $almanac.next_equinox
Solstice$gettext[$page]["Solstice"] $almanac.next_solstice
Solstice$gettext[$page]["Solstice"] $almanac.next_solstice
Equinox$gettext[$page]["Equinox"] $almanac.next_equinox
Total daylight$gettext[$page]["Daylight"] $daylight_str
- + - + - + - + - + - + - + - + #if $almanac.next_full_moon.raw < $almanac.next_new_moon.raw - + - + #else - + - + #end if - + diff --git a/skins/Seasons/current.inc b/skins/Seasons/current.inc index 3f31d5c1..219e35c3 100644 --- a/skins/Seasons/current.inc +++ b/skins/Seasons/current.inc @@ -6,7 +6,7 @@
- Current Conditions + $gettext["Current Conditions"]
diff --git a/skins/Seasons/hilo.inc b/skins/Seasons/hilo.inc index 18ba85ab..f67ce3d8 100644 --- a/skins/Seasons/hilo.inc +++ b/skins/Seasons/hilo.inc @@ -8,7 +8,7 @@
@@ -18,14 +18,15 @@
- - - + + + diff --git a/skins/Seasons/identifier.inc b/skins/Seasons/identifier.inc index 1473ada4..49f242ba 100644 --- a/skins/Seasons/identifier.inc +++ b/skins/Seasons/identifier.inc @@ -10,15 +10,15 @@
☽ Moon
☽ $gettext[$page]["Moon"]
  
Rise$gettext[$page]["Rise"] $almanac.moon.rise
Transit$gettext[$page]["Transit"] $almanac.moon.transit
Set$gettext[$page]["Set"] $almanac.moon.set
  
Azimuth$gettext[$page]["Azimuth"] $("%.1f°" % $almanac.moon.az)
Altitude$gettext[$page]["AstroAltitude"] $("%.1f°" % $almanac.moon.alt)
Right ascension$gettext[$page]["Right ascension"] $("%.1f°" % $almanac.moon.ra)
Declination$gettext[$page]["Declination"] $("%.1f°" % $almanac.moon.dec)
Full moon$gettext[$page]["Full moon"] $almanac.next_full_moon
New moon$gettext[$page]["New moon"] $almanac.next_new_moon
New moon$gettext[$page]["New moon"] $almanac.next_new_moon
Full moon$gettext[$page]["Full moon"] $almanac.next_full_moon
Phase$gettext[$page]["Phase"] $almanac.moon_phase
$almanac.moon_fullness% full
 
Today
 
Week
 
Month
 
$gettext["Today"]
 
$gettext["Week"]
 
$gettext["Month"]
-         
Year
+         
$gettext["Year"]
- Rain
Year
+ $gettext["Rainyear1"]
$gettext["Rainyear2"]
- + - + - + diff --git a/skins/Seasons/index.html.tmpl b/skins/Seasons/index.html.tmpl index b4c95aab..7763793c 100644 --- a/skins/Seasons/index.html.tmpl +++ b/skins/Seasons/index.html.tmpl @@ -6,7 +6,7 @@ #encoding UTF-8 ## - + ## This choice should match the #encoding directive above @@ -33,15 +33,15 @@
-
History:   +
$gettext[$page]["Plots"]:   Day + onclick="choose_history('day')">$gettext["Day"] Week + onclick="choose_history('week')">$gettext["Week"] Month + onclick="choose_history('month')">$gettext["Month"] Year + onclick="choose_history('year')">$gettext["Year"]
$obs.label.barometer @@ -160,8 +160,7 @@

- This station is controlled by WeeWX, an - experimental weather software system written in Python. + $gettext["footnote1"]WeeWX$gettext["footnote2"]

#include "analytics.inc" diff --git a/skins/Seasons/lang/de.conf b/skins/Seasons/lang/de.conf new file mode 100644 index 00000000..a3f8213c --- /dev/null +++ b/skins/Seasons/lang/de.conf @@ -0,0 +1,178 @@ +############################################################################### +# Localization File # +# German # +# Copyright (c) 2018-2021 Tom Keffer and Matthew Wall # +# Copyright (c) 2021 Johanna Karen Roedenbeck # +# See the file LICENSE.txt for your rights. # +############################################################################### + +[Units] + + # The following section overrides the label used for each type of unit + [[Labels]] + meter = " m", " m" + day = " Tag", " Tage" + hour = " Stunde", " Stunden" + minute = " Minute", " Minuten" + second = " Sekunde", " Sekunden" + NONE = "" + + [[Ordinates]] + + # Ordinal directions. The last one is for no wind direction + directions = N, NNO, NO, ONO, O, OSO, SO, SSO, S, SSW, SW, WSW, W, WNW, NW, NNW, N/A + +[Labels] + + # Set to hemisphere abbreviations suitable for your location: + hemispheres = N, S, O, W + + # Generic labels, keyed by an observation type. + [[Generic]] + dateTime = "Datum/Zeit" + interval = Intervall + altimeter = Luftdruck (QNH) # QNH + altimeterRate = Luftdruckänderung + barometer = Luftdruck # QFF + barometerRate = Luftdruckänderung + pressure = abs. Luftdruck # QFE + pressureRate = Luftdruckänderung + dewpoint = Taupunkt + ET = ET + heatindex = Hitzeindex + inHumidity = Raumluftfeuchte + inTemp = Raumtemperatur + inDewpoint = Raumtaupunkt + outHumidity = Luftfeuchte + outTemp = Außentemperatur + radiation = Sonnenstrahlung + rain = Regen + rainRate = Regen-Rate + UV = UV-Index + wind = Wind + windDir = Windrichtung + windGust = Böen Geschwindigkeit + windGustDir = Böen Richtung + windSpeed = Windgeschwindigkeit + windchill = Windchill + windgustvec = Böen-Vektor + windvec = Wind-Vektor + extraTemp1 = Temperatur1 + extraTemp2 = Temperatur2 + extraTemp3 = Temperatur3 + appTemp = gefühlte Temperatur + appTemp1 = gefühlte Temperatur + THSW = THSW-Index + lightning_distance = Blitzentfernung + lightning_strike_count = Blitzanzahl + cloudbase = Wolkenuntergrenze + + # used in Seasons skin but not defined + feel = gefühlte Temperatur + + # Sensor status indicators + rxCheckPercent = Signalqualität + txBatteryStatus = Übertragerbatteriestatus + windBatteryStatus = Anemometerbatteriestatus + rainBatteryStatus = Regenmesserbatteriestatus + outTempBatteryStatus = Außentemperatursensorbatteriestatus + inTempBatteryStatus = Innentemperatursensorbatteriestatus + consBatteryVoltage = Konsolenbatteriestatus + heatingVoltage = Heizungsspannung + supplyVoltage = Versorgungsspannung + referenceVoltage = Referenzspannung + + +[Almanac] + + # The labels to be used for the phases of the moon: + moon_phases = Neumond, zunehmend, Halbmond, zunehmend, Vollmond, abnehmend, Halbmond, abnehmend + +[Texts] + + # Section Titles + "Current Conditions" = Aktuelle Werte + "Celestial" = Sonne und Mond + "HiLo" = "Höchst- und Tiefstwerte" + "Sensor Status" = "Sensorenstatus" + "About" = "Stationsdaten" + "Statistics" = "Statistik" + + # titlebar.inc + "Monthly Reports" = "Monatswerte" + "Yearly Reports" = "Jahreswerte" + "select month" = "Monat wählen" + "select year" = "Jahr wählen" + + # identifier.inc + "Latitude" = "geogr. Breite" + "Longitude" = "geogr. Länge" + "GeoAltitude" = "Höhe ü. NN" # geographisch + + # time spans + "Today" = Heute + "Day" = Tag + "Week" = Woche + "Month" = Monat + "Year" = Jahr + "Rainyear" = Regenjahr + "Rainyear1" = "Regen-" + "Rainyear2" = "jahr" + + # footnote + "footnote1" = "Diese Station wird von " + "footnote2" = " gesteuert, einer experimentellen Wetter-Software, geschrieben in Python." + + [[index]] + + "Plots" = Diagramme + "Daylight" = "Tageslicht" + + [[statistics]] + + "Title" = "Statistik" + + [[celestial]] + + "Title" = "Sonne und Mond" + + "Sun" = Sonne + "Moon" = Mond + "Rise" = Aufgang + "Transit" = Transit + "Set" = Untergang + "Start civil twilight" = Dämmerungsbeginn + "End civil twilight" = Dämmerungsende + "Daylight" = Tageslicht gesamt + + "Azimuth" = Azimut + "AstroAltitude" = Höhe # astronomisch + "Right ascension" = Rektaszension + "Declination" = Deklination + + "Solstice" = Sonnenwende # Solstitium + "Equinox" = Tagundnachtgleiche # Äquinoktium + + "Full moon" = Vollmond + "New moon" = Neumond + "Phase" = Phase + + [[RSS]] + + "Weather Conditions" = Wetterbedingungen + "description" = "Aktuelle Werte und Tages-, Monats- und Jahreszusammenfassung" + "from" = aus + "Min outside temperature" = Außentemperatur Minimum + "Max outside temperature" = Außentemperatur Maximum + "Min inside temperature" = Innentemperatur Minimum + "Max inside temperature" = Innentemperatur Maximum + "Min barometer" = Luftdruck Minimum + "Max barometer" = Luftdruck Maximum + "Max wind" = Max Wind + "Rain today" = Regen heute + "Rain total for month" = Regen in diesem Monat + "Rain total for year" = Regen in diesem Jahr + "Weather Conditions at" = Wetter am + "Yearly Weather Summary as of" = Jahreszusammenfassung zum + "Monthly Weather Summary as of" = Monatszusammenfassung zum + "Daily Weather Summary as of" = Tageszusammenfassung für den diff --git a/skins/Seasons/lang/en.conf b/skins/Seasons/lang/en.conf new file mode 100644 index 00000000..74a84301 --- /dev/null +++ b/skins/Seasons/lang/en.conf @@ -0,0 +1,176 @@ +############################################################################### +# Localization File # +# English # +# Copyright (c) 2018-2021 Tom Keffer and Matthew Wall # +# Copyright (c) 2021 Johanna Karen Roedenbeck # +# See the file LICENSE.txt for your rights. # +############################################################################### + +[Units] + + [[Labels]] + + day = " day", " days" + hour = " hour", " hours" + minute = " minute", " minutes" + second = " second", " seconds" + + [[Ordinates]] + + # Ordinal directions. The last one should be for no wind direction + directions = N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW, N/A + +[Labels] + + # Set to hemisphere abbreviations suitable for your location: + hemispheres = N, S, E, W + + # Generic labels, keyed by an observation type. + [[Generic]] + dateTime = Time + interval = Interval + altimeter = Altimeter # QNH + altimeterRate = Altimeter Change Rate + barometer = Barometer # QFF + barometerRate = Barometer Change Rate + pressure = Pressure # QFE + pressureRate = Pressure Change Rate + dewpoint = Dew Point + ET = ET + heatindex = Heat Index + inHumidity = Inside Humidity + inTemp = Inside Temperature + inDewpoint = Inside Dew Point + outHumidity = Humidity + outTemp = Outside Temperature + radiation = Radiation + rain = Rain + rainRate = Rain Rate + UV = UV Index + wind = Wind + windDir = Wind Direction + windGust = Gust Speed + windGustDir = Gust Direction + windSpeed = Wind Speed + windchill = Wind Chill + windgustvec = Gust Vector + windvec = Wind Vector + windrun = Wind Run + extraTemp1 = Temperature1 + extraTemp2 = Temperature2 + extraTemp3 = Temperature3 + appTemp = Apparent Temperature + appTemp1 = Apparent Temperature + THSW = THSW Index + lightning_distance = Lightning Distance + lightning_strike_count = Lightning Strikes + cloudbase = Cloud Base + + # used in Seasons skin, but not defined + feel = apparent temperature + + # Sensor status indicators + rxCheckPercent = Signal Quality + txBatteryStatus = Transmitter Battery + windBatteryStatus = Wind Battery + rainBatteryStatus = Rain Battery + outTempBatteryStatus = Outside Temperature Battery + inTempBatteryStatus = Inside Temperature Battery + consBatteryVoltage = Console Battery + heatingVoltage = Heating Battery + supplyVoltage = Supply Voltage + referenceVoltage = Reference Voltage + + +[Almanac] + + # The labels to be used for the phases of the moon: + moon_phases = New, Waxing crescent, First quarter, Waxing gibbous, Full, Waning gibbous, Last quarter, Waning crescent + +[Texts] + + # Section Titles + "Current Conditions" = Current Conditions + "Celestial" = Celestial + "HiLo" = "High/Low" + "Sensor Status" = "Sensor Status" + "About" = "About this weather station" + "Statistics" = "Statistics" + + # titlebar.inc + "Monthly Reports" = "Monthly Reports" + "Yearly Reports" = "Yearly Reports" + "select month" = "Select Month" + "select year" = "Select Year" + + # identifier.inc + "Latitude" = "Latitude" + "Longitude" = "Longitude" + "GeoAltitude" = "Altitude" # geographic + + # time spans + "Today" = Today + "Day" = Day + "Week" = Week + "Month" = Month + "Year" = Year + "Rainyear" = Rain Year + "Rainyear1" = "Rain" + "Rainyear2" = "Year" + + # footnote + "footnote1" = "This station is controlled by " + "footnote2" = ", an experimental weather software system written in Python." + + [[index]] + + "Plots" = History + "Daylight" = Daylight + + [[statistics]] + + "Title" = "Statistics" + + [[celestial]] + + "Title" = "Celestial" + "Sun" = "Sun" + "Moon" = "Moon" + "Rise" = Rise + "Transit" = Transit + "Set" = Set + "Start civil twilight" = Start civil twilight + "End civil twilight" = End civil twilight + "Daylight" = Total daylight + + "Azimuth" = Azimuth + "AstroAltitude" = Altitude # astronomical + "Right ascension" = Right ascension + "Declination" = Declination + + "Solstice" = Solstice + "Equinox" = Equinox + + "Full moon" = Full moon + "New moon" = New moon + "Phase" = Phase + + [[RSS]] + + "Weather Conditions" = Weather Conditions + "description" = "Current conditions, and daily, monthly, and yearly summaries" + "from" = from + "Min outside temperature" = Min outside temperature + "Max outside temperature" = Max outside temperature + "Min inside temperature" = Min inside temperature + "Max inside temperature" = Max inside temperature + "Min barometer" = Min barometer + "Max barometer" = Max barometer + "Max wind" = Max wind + "Rain today" = Rain today + "Rain total for month" = Rain total for month + "Rain total for year" = Rain total for year + "Weather Conditions at" = Weather Conditions at + "Yearly Weather Summary as of" = Yearly Weather Summary as of + "Monthly Weather Summary as of" = Monthly Weather Summary as of + "Daily Weather Summary as of" = Daily Weather Summary as of diff --git a/skins/Seasons/rss.xml.tmpl b/skins/Seasons/rss.xml.tmpl index 6f9d38dd..093c9cd7 100644 --- a/skins/Seasons/rss.xml.tmpl +++ b/skins/Seasons/rss.xml.tmpl @@ -3,10 +3,10 @@ xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" > - $station.location, Weather Conditions + $station.location, $gettext[$page]["Weather Conditions"] $station.station_url - Current conditions, and daily, monthly, and yearly summaries - en-us + $gettext[$page]["description"] + $gettext.lang $current.dateTime.format("%a, %d %b %Y %H:%M:%S %Z") $current.dateTime.format("%a, %d %b %Y %H:%M:%S %Z") @@ -18,116 +18,116 @@ Weather Conditions at $current.dateTime $station.station_url - Outside temperature: $current.outTemp; - Barometer: $current.barometer; - Wind: $current.windSpeed from $current.windDir; - Rain rate: $current.rainRate; - Inside temperature: $current.inTemp + $obs.label.outTemp: $current.outTemp; + $obs.label.barometer: $current.barometer; + $obs.label.wind: $current.windSpeed $gettext[$page]["from"] $current.windDir; + $obs.label.rainRate: $current.rainRate; + $obs.label.inTemp: $current.inTemp $current.dateTime.format("%a, %d %b %Y %H:%M:%S %Z") $station.latitude_f $station.longitude_f - Time: $current.dateTime
- Outside Temperature: $current.outTemp
- Inside Temperature: $current.inTemp
- Wind Chill: $current.windchill
- Heat Index: $current.heatindex
- Dewpoint: $current.dewpoint
- Humidity: $current.outHumidity
- Barometer: $current.barometer
- Wind: $current.windSpeed from $current.windDir
- Rain Rate: $current.rainRate
+ $obs.label.dateTime: $current.dateTime
+ $obs.label.outTemp: $current.outTemp
+ $obs.label.inTemp: $current.inTemp
+ $obs.label.windchill: $current.windchill
+ $obs.label.heatindex: $current.heatindex
+ $obs.label.dewpoint: $current.dewpoint
+ $obs.label.outHumidity: $current.outHumidity
+ $obs.label.barometer: $current.barometer
+ $obs.label.wind: $current.windSpeed $gettext[$page]["from"] $current.windDir
+ $obs.label.rainRate: $current.rainRate

]]>
- Daily Weather Summary as of $current.dateTime + $gettext[$page]["Daily Weather Summary as of"] $current.dateTime $station.station_url - Min outside temperature: $day.outTemp.min at $day.outTemp.mintime; - Max outside temperature: $day.outTemp.max at $day.outTemp.maxtime; - Min inside temperature: $day.inTemp.min at $day.inTemp.mintime; - Max inside temperature: $day.inTemp.max at $day.inTemp.maxtime; - Min barometer: $day.barometer.min at $day.barometer.mintime; - Max barometer: $day.barometer.max at $day.barometer.maxtime; - Max wind : $day.wind.max from $day.wind.gustdir at $day.wind.maxtime; - Rain today: $day.rain.sum + $gettext[$page]["Min outside temperature"]: $day.outTemp.min at $day.outTemp.mintime; + $gettext[$page]["Max outside temperature"]: $day.outTemp.max at $day.outTemp.maxtime; + $gettext[$page]["Min inside temperature"]: $day.inTemp.min at $day.inTemp.mintime; + $gettext[$page]["Max inside temperature"]: $day.inTemp.max at $day.inTemp.maxtime; + $gettext[$page]["Min barometer"]: $day.barometer.min at $day.barometer.mintime; + $gettext[$page]["Max barometer"]: $day.barometer.max at $day.barometer.maxtime; + $gettext[$page]["Max wind"] : $day.wind.max $gettext[$page]["from"] $day.wind.gustdir at $day.wind.maxtime; + $gettext[$page]["Rain today"]: $day.rain.sum $current.dateTime.format("%a, %d %b %Y %H:%M:%S %Z") $station.latitude_f $station.longitude_f - Day: $day.dateTime.format("%d %b %Y")
- Min Outside Temperature: $day.outTemp.min at $day.outTemp.mintime
- Max Outside Temperature: $day.outTemp.max at $day.outTemp.maxtime
- Min Inside Temperature: $day.inTemp.min at $day.inTemp.mintime
- Max Inside Temperature: $day.inTemp.max at $day.inTemp.maxtime
- Min Barometer: $day.barometer.min at $day.barometer.mintime
- Max Barometer: $day.barometer.max at $day.barometer.maxtime
- Max Wind : $day.wind.max from $day.wind.gustdir at $day.wind.maxtime
- Rain today: $day.rain.sum
+ $gettext["Day"]: $day.dateTime.format("%d %b %Y")
+ $gettext[$page]["Min outside temperature"]: $day.outTemp.min at $day.outTemp.mintime
+ $gettext[$page]["Max outside temperature"]: $day.outTemp.max at $day.outTemp.maxtime
+ $gettext[$page]["Min inside temperature"]: $day.inTemp.min at $day.inTemp.mintime
+ $gettext[$page]["Max inside temperature"]: $day.inTemp.max at $day.inTemp.maxtime
+ $gettext[$page]["Min barometer"]: $day.barometer.min at $day.barometer.mintime
+ $gettext[$page]["Max barometer"]: $day.barometer.max at $day.barometer.maxtime
+ $gettext[$page]["Max wind"] : $day.wind.max $gettext[$page]["from"] $day.wind.gustdir at $day.wind.maxtime
+ $gettext[$page]["Rain today"]: $day.rain.sum

]]>
- Monthly Weather Summary as of $current.dateTime + $gettext[$page]["Monthly Weather Summary as of"]) $current.dateTime $station.station_url - Min outside temperature: $month.outTemp.min at $month.outTemp.mintime; - Max outside temperature: $month.outTemp.max at $month.outTemp.maxtime; - Min inside temperature: $month.inTemp.min at $month.inTemp.mintime; - Max inside temperature: $month.inTemp.max at $month.inTemp.maxtime; - Min barometer: $month.barometer.min at $month.barometer.mintime; - Max barometer: $month.barometer.max at $month.barometer.maxtime; - Max wind : $month.wind.max from $month.wind.gustdir at $month.wind.maxtime; - Rain total for month: $month.rain.sum + $gettext[$page]["Min outside temperature"]: $month.outTemp.min at $month.outTemp.mintime; + $gettext[$page]["Max outside temperature"]: $month.outTemp.max at $month.outTemp.maxtime; + $gettext[$page]["Min inside temperature"]: $month.inTemp.min at $month.inTemp.mintime; + $gettext[$page]["Max inside temperature"]: $month.inTemp.max at $month.inTemp.maxtime; + $gettext[$page]["Min barometer"]: $month.barometer.min at $month.barometer.mintime; + $gettext[$page]["Max barometer"]: $month.barometer.max at $month.barometer.maxtime; + $gettext[$page]["Max wind"] : $month.wind.max $gettext[$page]["from"] $month.wind.gustdir at $month.wind.maxtime; + $gettext[$page]["Rain total for month"]: $month.rain.sum $current.dateTime.format("%a, %d %b %Y %H:%M:%S %Z") - Month: $month.dateTime.format("%B %Y")
- Max Outside Temperature: $month.outTemp.max at $month.outTemp.maxtime
- Min Outside Temperature: $month.outTemp.min at $month.outTemp.mintime
- Max Inside Temperature: $month.inTemp.max at $month.inTemp.maxtime
- Min Inside Temperature: $month.inTemp.min at $month.inTemp.mintime
- Min Barometer: $month.barometer.min at $month.barometer.mintime
- Max Barometer: $month.barometer.max at $month.barometer.maxtime
- Max Wind : $month.wind.max from $month.wind.gustdir at $month.wind.maxtime
- Rain total for month: $month.rain.sum
+ $gettext["Month"]: $month.dateTime.format("%B %Y")
+ $gettext[$page]["Max outside temperature"]: $month.outTemp.max at $month.outTemp.maxtime
+ $gettext[$page]["Min outside temperature"]: $month.outTemp.min at $month.outTemp.mintime
+ $gettext[$page]["Max inside temperature"]: $month.inTemp.max at $month.inTemp.maxtime
+ $gettext[$page]["Min inside temperature"]: $month.inTemp.min at $month.inTemp.mintime
+ $gettext[$page]["Min barometer"]: $month.barometer.min at $month.barometer.mintime
+ $gettext[$page]["Max barometer"]: $month.barometer.max at $month.barometer.maxtime
+ $gettext[$page]["Max wind"] : $month.wind.max $gettext[$page]["from"] $month.wind.gustdir at $month.wind.maxtime
+ $gettext[$page]["Rain total for month"]: $month.rain.sum

]]>
- Yearly Weather Summary as of $current.dateTime + $gettext[$page]["Yearly Weather Summary as of"] $current.dateTime $station.station_url - Min outside temperature: $year.outTemp.min at $year.outTemp.mintime; - Max outside temperature: $year.outTemp.max at $year.outTemp.maxtime; - Min inside temperature: $year.inTemp.min at $year.inTemp.mintime; - Max inside temperature: $year.inTemp.max at $year.inTemp.maxtime; - Min barometer: $year.barometer.min at $year.barometer.mintime; - Max barometer: $year.barometer.max at $year.barometer.maxtime; - Max wind : $year.wind.max from $year.wind.gustdir at $year.wind.maxtime; - Rain total for year: $year.rain.sum + $gettext[$page]["Min outside temperature"]: $year.outTemp.min at $year.outTemp.mintime; + $gettext[$page]["Max outside temperature"]: $year.outTemp.max at $year.outTemp.maxtime; + $gettext[$page]["Min inside temperature"]: $year.inTemp.min at $year.inTemp.mintime; + $gettext[$page]["Max inside temperature"]: $year.inTemp.max at $year.inTemp.maxtime; + $gettext[$page]["Min barometer"]: $year.barometer.min at $year.barometer.mintime; + $gettext[$page]["Max barometer"]: $year.barometer.max at $year.barometer.maxtime; + $gettext[$page]["Max wind"] : $year.wind.max $gettext[$page]["from"] $year.wind.gustdir at $year.wind.maxtime; + $gettext[$page]["Rain total for year"]: $year.rain.sum $current.dateTime.format("%a, %d %b %Y %H:%M:%S %Z") - Year: $year.dateTime.format("%Y")
- Max Outside Temperature: $year.outTemp.max at $year.outTemp.maxtime
- Min Outside Temperature: $year.outTemp.min at $year.outTemp.mintime
- Max Inside Temperature: $year.inTemp.max at $year.inTemp.maxtime
- Min Inside Temperature: $year.inTemp.min at $year.inTemp.mintime
- Min Barometer: $year.barometer.min at $year.barometer.mintime
- Max Barometer: $year.barometer.max at $year.barometer.maxtime
- Max Wind : $year.wind.max from $year.wind.gustdir at $year.wind.maxtime
- Rain total for year: $year.rain.sum
+ $gettext["Year"]: $year.dateTime.format("%Y")
+ $gettext[$page]["Max outside temperature"]: $year.outTemp.max at $year.outTemp.maxtime
+ $gettext[$page]["Min outside temperature"]: $year.outTemp.min at $year.outTemp.mintime
+ $gettext[$page]["Max inside temperature"]: $year.inTemp.max at $year.inTemp.maxtime
+ $gettext[$page]["Min inside temperature"]: $year.inTemp.min at $year.inTemp.mintime
+ $gettext[$page]["Min barometer"]: $year.barometer.min at $year.barometer.mintime
+ $gettext[$page]["Max barometer"]: $year.barometer.max at $year.barometer.maxtime
+ $gettext[$page]["Max wind"] : $year.wind.max $gettext[$page]["from"] $year.wind.gustdir at $year.wind.maxtime
+ $gettext[$page]["Rain total for year"]: $year.rain.sum

]]>
diff --git a/skins/Seasons/sensors.inc b/skins/Seasons/sensors.inc index f6fced07..44c70ec1 100644 --- a/skins/Seasons/sensors.inc +++ b/skins/Seasons/sensors.inc @@ -45,7 +45,7 @@ #if $have_conn or $have_battery_status or $have_voltage
diff --git a/skins/Seasons/statistics.html.tmpl b/skins/Seasons/statistics.html.tmpl index a2e7e279..bb406e78 100644 --- a/skins/Seasons/statistics.html.tmpl +++ b/skins/Seasons/statistics.html.tmpl @@ -3,7 +3,7 @@ #errorCatcher Echo #encoding UTF-8 - + $station.location Statistics @@ -39,7 +39,7 @@ #include "titlebar.inc"
-

❰ Current Conditions

+

❰ $gettext["Current Conditions"]

#include "statistics.inc" diff --git a/skins/Seasons/statistics.inc b/skins/Seasons/statistics.inc index cea477e3..0465a839 100644 --- a/skins/Seasons/statistics.inc +++ b/skins/Seasons/statistics.inc @@ -8,7 +8,7 @@
- Statistics + $gettext[$page].Title
@@ -17,11 +17,11 @@
- - - - - + + + + + diff --git a/skins/Seasons/sunmoon.inc b/skins/Seasons/sunmoon.inc index 0e51609a..e7786a20 100644 --- a/skins/Seasons/sunmoon.inc +++ b/skins/Seasons/sunmoon.inc @@ -27,7 +27,7 @@
@@ -37,21 +37,21 @@
Latitude$gettext["Latitude"] $station.latitude[0]° $station.latitude[1]' $station.latitude[2]
Longitude$gettext["Longitude"] $station.longitude[0]° $station.longitude[1]' $station.longitude[2]
Altitude$gettext["GeoAltitude"] $station.altitude
TodayWeekMonthYearRain year$gettext["Today"]$gettext["Week"]$gettext["Month"]$gettext["Year"]$gettext["Rainyear"]
$obs.label.outTemp
- + - + - + - + - + diff --git a/skins/Seasons/tabular.html.tmpl b/skins/Seasons/tabular.html.tmpl index 87695a45..fb39c7ca 100644 --- a/skins/Seasons/tabular.html.tmpl +++ b/skins/Seasons/tabular.html.tmpl @@ -4,7 +4,7 @@ #encoding UTF-8 - +$station.location @@ -23,7 +23,7 @@ #include "titlebar.inc" diff --git a/skins/Seasons/telemetry.html.tmpl b/skins/Seasons/telemetry.html.tmpl index fcbf2864..b76232eb 100644 --- a/skins/Seasons/telemetry.html.tmpl +++ b/skins/Seasons/telemetry.html.tmpl @@ -18,7 +18,7 @@ #end def - +$station.location Telemetry @@ -31,7 +31,7 @@ #include "titlebar.inc"
-

❰ Current Conditions

+

❰ $gettext["Current Conditions"]

#include "sensors.inc" @@ -41,13 +41,13 @@
Telemetry:   Day + onclick="choose_history('day')">$gettext["Day"] Week + onclick="choose_history('week')">$gettext["Week"] Month + onclick="choose_history('month')">$gettext["Month"] Year + onclick="choose_history('year')">$gettext["Year"]
$period_plots($day, 'day') diff --git a/skins/Seasons/titlebar.inc b/skins/Seasons/titlebar.inc index 12c9d664..49c67b42 100644 --- a/skins/Seasons/titlebar.inc +++ b/skins/Seasons/titlebar.inc @@ -11,20 +11,20 @@
- Monthly Reports: + $gettext["Monthly Reports"]:
- Yearly Reports: + $gettext["Yearly Reports"]:
diff --git a/weewx.conf b/weewx.conf index 8b5f0eb0..9c624631 100644 --- a/weewx.conf +++ b/weewx.conf @@ -158,6 +158,8 @@ version = 4.6.0a1 # The SeasonsReport uses the 'Seasons' skin, which contains the # images, templates and plots for the report. skin = Seasons + lang = en + units_base = US enable = true [[SmartphoneReport]]
Rise$gettext["celestial"]["Rise"] $almanac.sun.rise.format(None_string=$sun_None)  Rise$gettext["celestial"]["Rise"] $almanac.moon.rise
Set$gettext["celestial"]["Set"] $almanac.sun.set.format(None_string=$sun_None)  Set$gettext["celestial"]["Set"] $almanac.moon.set
Daylight$gettext[$page]["Daylight"] $daylight_str