On Tuesday, March 7, 2017 at 2:28:37 AM UTC-5, Ralf Buck wrote:
>
> *I = Anfangs noch Schauer, dann Besserung des Wetters*
>
> and forecast show:
> *The forecast is ['Anfangs noch Schauer', 'dann Besserung des Wetters']*
>

if the string has a comma in it, then put it in quotes:

    I = "Anfangs noch Schauer, dann Besserung des Wetters"

 

> second, i found no infos, how can i translate the days of a week: 
> *Mon -> Mo*
> *Sun -> So*
>

what do you see when you type 'locale' at a prompt?  you should see 
something like this:

LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

but you probably want de_DE instead of en_US.

LANG specifies what language should be used.  each of the LC variables 
specifies which country/region settings should be used to display money, 
time, etc.  LC_ALL applies to all types of localization.

the templates forecast_strip.inc, forecast_table.inc, forecast_iconic.inc, 
and forecast_compact.inc each use "%a" to format the day of week, like this:

$summary.event_ts.format('%a')

the event_ts is a ValueHelper that contains a timestamp, and the data/time 
formatting uses the locale to determine which language should be used.

so if you set language to de_DE, that should give you the days of the week 
in german.

to apply the language to *everything* in weewx, try this in the shell where 
you start weewx:

export LANG=de_DE

or, to get localization for *everything* as well as language, set both LANG 
and LC_ALL:

export LANG=de_DE
export LC_ALL=de_DE

to apply the locale *only* in the current template, add this near the top 
of the .tmpl file that includes the forecast template:

#import locale
locale.setlocale(locale.LC_ALL="de_DE")

m

-- 
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.

Reply via email to