Skip to content

Not defined language and units #207

@baublys

Description

@baublys

Here the following is written:

lang = [language] optional
Return summary properties in the desired language. (Note that units in the summary will be set according to the units parameter, so be sure to set both parameters appropriately.)
units = [units] optional
Return weather conditions in the requested units. [units] should be one of the following:
auto: automatically select units based on geographic location

I added in app.js to the getForecastFromNetwork function "?Lang=ru&units=auto":

function getForecastFromNetwork(coords) {
  return fetch(`/forecast/${coords}?lang=ru&units=auto`)
    .then(response => {
      return response.json();
    })
    .catch(() => {
      return null;
    });
}

Errors appeared in app.js:

'luxon' is not defined
Снимок экрана (4447)

Error in index.html:

The attribute name of [viewBox] must be in a lowercase.

<div id="weather-template" class="weather-card" hidden>
        <div class="card-spinner">
 HERE>> <svg viewBox="0 0 32 32" width="32" height="32"> <<HERE
            <circle cx="16" cy="16" r="14" fill="none"></circle>
          </svg>
</div>

Снимок экрана (4448)

General view: still Fahrenheit and miles/hour instead of Celsius and meters/second.
Снимок экрана (4444)

I would be grateful for a hint on how to change the code so that the language and units of measurement are correctly determined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions