Skip to content

LANGUAGE: Integration FR Weather #120

@mbl-35

Description

@mbl-35

Hello,
With LANGUAGE=fr env integrated (issue #107 ), the weather widget still display english informations...

In fact, lang is already in the openweathermap request parameter (API/Weather.php line 44).
https://api.openweathermap.org/data/2.5/weather?units=metric&lat=47.860879&lon=-1.801214&lang=fr&appid=my_key

Response is :

{"coord":{"lon":-1.8012,"lat":47.8609},"weather":[{"id":804,"main":"Clouds","description":"couvert","icon":"04d"}],"base":"stations","main":{"temp":12.77,"feels_like":12.43,"temp_min":12.77,"temp_max":14.03,"pressure":1020,"humidity":89,"sea_level":1020,"grnd_level":1014},"visibility":10000,"wind":{"speed":1.63,"deg":31,"gust":1.83},"clouds":{"all":100},"dt":1716536717,"sys":{"type":2,"id":2007485,"country":"FR","sunrise":1716524328,"sunset":1716580181},"timezone":7200,"id":2984191,"name":"Redon","cod":200}

You use the xpath /weather/0/main to display the weather widget. this is not a translated part.. but the xpath /weather/0/description is : "couvert" is the french word...

Same for lang=de: "main":"Clouds","description":"Bedeckt"
Could you select the appropriate xpath to display for the next tag ?

jumpapp/assets/js/src/classes/Weather.js line 58:
description: data.weather[0].main,
replaced by
description: data.weather[0].description.charAt(0).toUpperCase() + data.weather[0].description.slice(1),

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions