Skip to content

Incorrect value of navigator.language property in the editor and fullscreen mode #1772

Open
@piecesofuk

Description

@piecesofuk

Nature of issue?

  • Found a bug

Details about the bug:

I'm using the Chrome browser on a Chromebook Version 88.0.4324.186 (Official Build) (64-bit)

I wanted to test an api call that passed my browser's language and test it with other languages. I'm getting the language code from the navigator.language property. The default value of navigator.language is "en-GB". I installed a Chrome Locale Switcher extension to change this value. Whenever I switch locales I reload the sketch. When I tested my code I noticed that whatever language I changed the locale to, for example "fr", "en-GB" was always being passed to the api. I console logged the value in the p5 console and it showed "en-GB". However, if I open the Chrome dev tools and display the value of navigator.language it is shown as "fr". When I run the sketch in "present" mode, via the share option, the value of navigator.language is correctly returned as "fr". The incorrect value is also returned in "full" mode.

A simple snippet of code would be
console.log(navigator.language);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions