Weewx in spanish

807 views
Skip to first unread message

Luis Jose Herrero Lopez

unread,
Sep 4, 2013, 6:31:49 AM9/4/13
to weewx...@googlegroups.com
Greetings to all members of this group and sincere thanks to Tom Keffer, for their selfless work.

I just installed 2.4.0-1.norach.rpm Weewx on Suse Linux 12.3. I had some problems making weewx run as a daemon, and could not find the file to incorporate copied init.d, finally weewx-2.4.0.tar.gz package and then following the user manual and configuration, it seems that finally, operating properly.

Now I'm
trying to customize various configuration files (weewx.conf. Skin.conf and different *. tmpl) so that the resulting text of a report to the Spanish. Appreciate who had already done that send me the reference the mencionated files for reference. Another thing that does not work is that in the html generated in the /etc/weewx/ .... / big, the files are the same size as the parent directory ... / publichtml though I have configured the relevant files .conf with a size of 600x360. It will be a matter of further research.

Regards,

Luis

copi...@gmail.com

unread,
Sep 5, 2013, 5:48:11 AM9/5/13
to weewx...@googlegroups.com
Hi. look at http://meteo.benicassim.es/ this translated, I also am doing the translational to Spanish and do not know how to translate the weekdays.

Hola, si miras en
http://meteo.benicassim.es/ se encuentra traducida al español, yo estoy también traduciendo la pagina, pero no se como puedo traducir los días de la semana..

Luis Jose Herrero Lopez

unread,
Sep 5, 2013, 6:23:38 AM9/5/13
to weewx...@googlegroups.com
Hi,

Yes, I see the result. What I would like -if not much to ask- is to know the .conf files and .tmpl that have changed and what these changes to get that result.

Thanks, and best regards

Luis


----------------------------------

Hola,

Sí, ya veo el resultado. Lo que me gustaría -si no fuera mucho pedir- es conocer los ficheros .conf y .tmpl que se han modificado y cuales son esas modificaciones para obtener ese resultado.

Gracias, y un saludo

Luis

copi...@gmail.com

unread,
Sep 6, 2013, 12:48:13 AM9/6/13
to weewx...@googlegroups.com


El miércoles, 4 de septiembre de 2013 12:31:49 UTC+2, Luis Jose Herrero Lopez escribió:

copi...@gmail.com

unread,
Sep 6, 2013, 12:49:11 AM9/6/13
to weewx...@googlegroups.com
Hi, mainly I translated the skin.conf and *.tmpl


Hola, principalmente yo traduje  skin.conf y  *.tmpl


El miércoles, 4 de septiembre de 2013 12:31:49 UTC+2, Luis Jose Herrero Lopez escribió:

Miguel Angel

unread,
Sep 7, 2013, 8:39:31 PM9/7/13
to weewx...@googlegroups.com
Hi,

I think that is necessary to change the locale configuration for the server to obtain the translation for the weekdays. Also for months. I imagine that there are python functions which return these names, and that functions are based on that configuration. Maybe Tom Keffer can answer that question :)

By the way, my site is http://www.algarra.org/meteo   (http://www.algarra.org). Tom, feel free to include it in your index of sample stations :) (if you want, of course :D )

Greets
--

Hola,

Imagino que se ha de cambiar la configuración regional de la maquina que corre la aplicación para que los dias que salen en los informes salgan acordes a dicha configuración en español (lo mismo para los meses en los informes anuales). Esto es debido a que dichos nombres se generan mediante funciones en python que basan sus resultados en dicha configuración regional. Es posible que Tom pueda aclarar esto mucho mejor que yo :)

Por cierto, mi sitio está en http://www.algarra.org/meteo   (http://www.algarra.org).

Saludos

--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Luis José Herrero López

unread,
Sep 8, 2013, 9:50:24 AM9/8/13
to weewx...@googlegroups.com
Here are my tests in an attempt to customize reports Weewx Spanish:

1) Translate index.html.tmpl (and the rest of. mpl in the subdirectoy skins/Standard).
Result: is acceptable as long as no attempt is made to stress words (I see that the same happens in http://www.algarra.org/meteo/)

2 º) I have included in weewxd (usr / share / weewxd) the following:

import locale
locale.setlocale (locale.LC_ALL 'de_DE.utf8')

(as contained in a response in this same forum Tom Keffer to wysiwig)

Result: inconclusive. Reports continue not show accents in words. I do not know if this will have a solution.

3rd) as I see LC_ALL remains blank after executing the command locale, and I think this may have its importance, I tried also two paths:

a) include in / etc / csh.cshrc.local (instead advised by SUSE) the following:

export LC_ALL = es_ES.UTF8

b) include the same in .profile

result: inconclusive, the LC_ALL locale command returns me blank in both cases.

I'm still investigating,

Regards,

Luis

-------------------------------------

He aquí mis pruebas en el intento de personalizar en español los informes de Weewx:

1º)Traducir index.html.tmpl (y el resto de .tmpl).
Resultado: es aceptable mientras no se intente acentuar las palabras (veo que lo mismo ocurre en http://www.algarra.org/meteo/)

2º)He incluido en weewxd (usr/share/weewxd) lo siguiente:

import locale
locale.setlocale (locale.LC_ALL, 'es_ES.UTF8')

(tal y como figura en una respuesta en éste mismo foro de Tom Keffer a wysiwig)
Resultado: no concluyente. Los informes siguen si mostrar los acentos en las palabras. No sé si esto tendrá solución.

3º) como veo  que LC_ALL permanece en blanco tras ejecutar el comando locale, y creo que esto pudiera tener su trascendencia, he intentado también dos caminos:

a) incluir en /etc/csh.cshrc.local (lugar aconsejado por SUSE) lo siguiente:

export LC_ALL = es_ES.UTF8

b)incluir lo mismo en .profile

resultado: no concluyente; el comando locale me devuelve LC_ALL en blanco en ambos casos.

Sigo investigando


Saludos,

Luis


2013/9/8 Miguel Angel <mig...@saezsoro.com>

--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/_zdzxLmLZhE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Luis José Herrero López

unread,
Sep 8, 2013, 10:01:20 AM9/8/13
to weewx...@googlegroups.com

I wanted to say (things Google automatic translator):


Here are my
tests in an attempt to customize reports Weewx Spanish:

1) Translate index.html.tmpl (and the rest of. tmpl in the subdirectoy skins/Standard).

Result: is acceptable as long as no attempt is made to stress words (I see that the same happens in http://www.algarra.org/meteo/)

2 º) I have included in weewxd (usr / share / weewxd) the following:

import locale
locale.setlocale (locale.LC_ALL, 'es_ES.UTF8')


(as contained in a response in this same forum Tom Keffer to wysiwig)

Result: inconclusive. Reports continue not show accents in words. I do not know if this will have a solution.

3rd) as I see LC_ALL remains blank after executing the command locale, and I think this may have its importance, I tried also two paths:

a) include in / etc / csh.cshrc.local (instead advised by SUSE) the following:

export LC_ALL = es_ES.UTF8

b) include the same (export LC_ALL = es_ES.UTF8)  in .profile


result: inconclusive, the LC_ALL locale command returns me blank in both cases.

I'm still investigating,

Regards,

Luis


2013/9/4 Luis Jose Herrero Lopez <ljhe...@gmail.com>

--

copi...@gmail.com

unread,
Sep 8, 2013, 12:01:11 PM9/8/13
to weewx...@googlegroups.com
Hello, accents solve it with the html code for example to á ->" &aacute; ", the website is in development but you can see in: http://radioelf.homeip.net/weewx/

Hola, el tema de los acentos lo solucione usando el código html para ello , por ejemplo para la á " &aacute; ", la pagina se encuentra en desarrollo pero si queréis verla la dirección es: http://radioelf.homeip.net/weewx/

Luis José Herrero López

unread,
Sep 8, 2013, 12:45:08 PM9/8/13
to weewx...@googlegroups.com
Thanks for the information.

I understand where you enter the corresponding &-acute is in the *. Html.tmpl and there is no other way to achieve this.

I wonder where you entered your AEMET (I guess at the head of weewx.conf, but what exactly have you laid url?, I try and I fail)

Very cool page, even a prototype.

regards

--------------------------

Gracias por la información.

Entiendo que el lugar donde introducir el correspondiente &-acute es en los *.html.tmpl y que no hay otra manera de lograrlo.

Me gustaría saber donde habéis introducido la información de AEMET (supongo que en la cabecera de weewx.conf, pero ¿que url exactamente habéis puesto?, yo lo intento y no lo consigo)

Muy chula la página, aunque sea un prototipo.

Saludos


2013/9/8 <copi...@gmail.com>

Miguel Angel

unread,
Sep 8, 2013, 2:42:29 PM9/8/13
to weewx...@googlegroups.com
Finally, I'm using the skin from Nick Dajda's site (www.dajda.net). It's full translated to spanish (by me :p). 

Regards

---

Finalmente, estoy usando el skin de la web de Nick Dajda (www.dajda.net). Lo he traducido al español (excepto los nombres de dias, etc, que aparecen en las estadisticas)

Saludos






2013/9/8 Luis José Herrero López <ljhe...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

copi...@gmail.com

unread,
Sep 8, 2013, 4:08:01 PM9/8/13
to weewx...@googlegroups.com
The code AEMET,  place in index.html.tmpl , after code radar...


El código de AEMET lo coloco en index.html.tmpl, después del código de radar...

Thomas Keffer

unread,
Sep 8, 2013, 5:31:01 PM9/8/13
to weewx-user
It seems like you are making progress, but I wanted to make one thing clear:

Weewx relies entirely on the operating system for localization services such as the local time, local numbers formatting, and the days of the week. It does no localization within the Python code. It merely passes on what is returned by various services such as time.strftime(). 

So, you must set your operating system locale correctly. Weewx has no other way of knowing you are in English speaking Oregon, or Japanese speaking Tokyo!

Of course, anything put in the templates is passed on verbatim. So, you will need to translate the English templates to Spanish.

Hope this helps.

-tk


--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Tom Keffer
kef...@threefools.org
+1 541-386-8891 (h)
+1 541-490-9507 (c)
Skype: tkeffer

copi...@gmail.com

unread,
Sep 9, 2013, 9:12:19 AM9/9/13
to weewx...@googlegroups.com
A doubt, must include the following code?

import locale
locale.setlocale(locale.LC_ALL, '')

on files;
generator.py
station.py
restful.py
imagegenerator.py
almanac.py
weeutil.py
genplot.py


thanks again

El miércoles, 4 de septiembre de 2013 12:31:49 UTC+2, Luis Jose Herrero Lopez escribió:
Message has been deleted

Luis José Herrero López

unread,
Sep 9, 2013, 9:50:19 AM9/9/13
to weewx...@googlegroups.com
I've only been tested to include these two lines:

import locale
locale.setlocale (locale.LC_ALL, 'es_ES.UTF-8')

in / usr / share / weewx / weewxd which is linked to / usr / bin / weewxd

I have not tried including them in the files you mention

Regards,

Luis

--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/_zdzxLmLZhE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Thomas Keffer

unread,
Sep 9, 2013, 8:37:32 PM9/9/13
to weewx-user
Hello, Luis

It was my impression that setting the locale was done by Python on startup in the site specific scripts, but I'm obviously wrong about that!

If you need to set a global locale using locale.setlocale(), the best place to put the call is in bin/user/extensions.py. This module is imported on startup by the weewx engine, so it gets executed very early. Best yet, anything in the 'user' directory is not replaced when you upgrade, so you won't have to add it again after an upgrade.

Hope this helps.

-tk


--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Thomas Keffer

unread,
Sep 10, 2013, 12:21:23 PM9/10/13
to weewx-user
Luis, copilador, and Miguel,

I have been doing a little research on this and have a few questions. 

First, I propose changing the program weewxd so it starts with

import locale
locale.setlocale(locale.LC_ALL, '')

This will cause it to use whatever locale you have set with environment variable LANG. This will cause the program to use the local date and time conventions. For example, it will use 'martes', instead of 'Tuesday', in the templates. Is this acceptable?

However, it will not fix the formatting of floating point values. For this, I assume you want 

22,3 °C

not

22.3 °C

Is that correct? This will require the use of locale specific formatting, which will require some modest code changes.

Finally, are there any other areas, besides date, time, and floating point values, that are not being localized?

Thanks for your help!

-tk

Luis José Herrero López

unread,
Sep 10, 2013, 1:10:50 PM9/10/13
to weewx...@googlegroups.com
Hello,

Thanks Tom, for your interest.

I introduced (folowing your suggestions above) the two lines


import locale
locale.setlocale (locale.LC_ALL, 'es_ES.UTF-8')

both in / usr / bin / weewxd -> / usr / share / weewxd as extensions.py (which for me is in / usr / share / weewx / user)

After this and translate (and accentuate) all .tmpl (current, weekly, monthly and yearly) the result is acceptable, with the exception of the weekly report to describe correctly the day of the week (Lunes, Martes, etc. .) will prepend an 'on' I do not know from where.

also weekly report as proof shipping

regards,

Luis


2013/9/10 Thomas Keffer <tke...@gmail.com>
week.html

Thomas Keffer

unread,
Sep 10, 2013, 4:33:29 PM9/10/13
to weewx-user
Hi, Luis

I just uploaded an alpha version of 2.5.0, which includes the change

import locale
locale.setlocale(locale.LC_ALL, '')

This will cause weewx to use whatever locale you specify in environment variable LANG. Most Linux distributions automatically set this variable, so this should work transparently for most users.

This version will also follow local conventions for the decimal point. So, in Spain, "21,3 °C" will be printed, rather than "21.3 °C".

Finally, I've also included instructions on how to localize weewx in the Customizing Guide. These are also included below

Please give it a try. It will not modify your skins.


-tk

4. Customizing your locale

Weewx has been designed to make localization fairly straightforward. Here are the steps you will need to take in order to localize to a non-English language and/or locale.

4.1. Translate the templates

First, you will need to go through the templates and translate to your target language. Obvious text strings such as "Current Weather Conditions" will need to be translated.

4.2. Modify skin.conf to reflect local conventions

Next, you will need to go through skin.conf and modify options to follow local conventions. This includes dates and labels.

4.2.1. Dates

Date formats may need to be changed. For example, if you wish to follow the European convention Day/Month/Year, rather than the US convention of Month/Day/Year, then lines such as

bottom_label_format = %m/%d/%y

need to be changed to

bottom_label_format = %d/%m/%y

There are several other, similar, date formats.

4.2.2. Labels

There are several almanac labels that may need to be changed. These include:

hemisphere = N, S, E, W

and

moon_phases = New, Waxing crescent, First quarter, Waxing gibbous, Full, Waning gibbous, Last quarter, Waning crescent

You will also have to change the generic labels given to your weather observations:

         barometer      = Barometer
        dewpoint       = Dew Point
        heatindex      = Heat Index
        inHumidity     = Inside Humidity
        inTemp         = Inside Temperature
        outHumidity    = Outside Humidity
        outTemp        = Outside Temperature
        radiation      = Radiation
        rain           = Rain
        rainRate       = Rain Rate
        rxCheckPercent = ISS Signal Quality
        windDir        = Wind Direction
        windGust       = Gust Speed
        windGustDir    = Gust Direction
        windSpeed      = Wind Speed
        windchill      = Wind Chill
        windgustvec    = Gust Vector
        windvec        = Wind Vector
        extraTemp1     = Pond Temperature

4.3. Environment variable LANG

Finally, you will need to set the environment variable LANG to reflect your locale. For example, assuming you set

$ export LANG=es_ES.UTF-8

before running weewx, then the local Spanish names for days of the week and months of the year will be used. The decimal point for numbers will also be modified appropriately.

copi...@gmail.com

unread,
Sep 11, 2013, 1:22:13 AM9/11/13
to weewx...@googlegroups.com
Thank you very much Tom, also modify the line "week       = %H:%M to %A"  by "week       = %H:%M el %A"  of skin.conf


El miércoles, 4 de septiembre de 2013 12:31:49 UTC+2, Luis Jose Herrero Lopez escribió:

Luis José Herrero López

unread,
Sep 11, 2013, 2:29:50 AM9/11/13
to weewx...@googlegroups.com
Hi,

For generic etiquets have adopted

 # Generic labels, keyed by an observation type.
 
        barometer      = Presión relativa
        dewpoint       = Temperatura de condensación
        heatindex      = Indice de calor
        inHumidity     = Humedad relativa interior
        inTemp         = Temperatura interior
        outHumidity    = Humedad relativa exterior
        outTemp        = Temperatura exterior
        radiation      = Radiación
        rain           = Lluvia
        rainRate       = Indice de lluvia
        rxCheckPercent = Calidad de la señal ISS
        windDir        = Dirección del viento
        windGust       = Velocidad de ráfaga
        windGustDir    = Dirección de ráfaga
        windSpeed      = Velocidad del viento
        windchill      = Sensación térmica
        windgustvec    = Vector de ráfaga
        windvec        = Vector de viento


Although I see dewpoint is usually translated as Punto de rocío

Regarding the labels of the phases of the moon, although not generally used Spanish equivalents to waxing crescent, waxing gibous, etc. I have taken (Spanish Wikipedia):

moon_phases = Luna Nueva, Luna Nueva visible, Cuarto creciente, Luna Gibosa creciente, Luna llena, Luna Gibosa menguante, Cuarto menguante, Luna Vieja


Thanks, copilador, I know where was the 'on' amount left




2013/9/10 Thomas Keffer <tke...@gmail.com>

Thomas Keffer

unread,
Sep 11, 2013, 11:32:36 AM9/11/13
to weewx-user
Thanks all! I've incorporated these changes into the localization guide.

-tk
Reply all
Reply to author
Forward
0 new messages