Browser language not (always) identified correctly

0 favourites
  • 4 posts
From the Asset Store
This Girls Game allows young fashionistas to develop their taste and skills as a fashion designer.
  • Hello folks,

    I'm working on a mobile game and my attention went on an unexpected behavior.

    I'm developing using a Windows 10 machine that is configured in English and when I need to test on a device I export the project as an HTML5 and save it on an HTTPS web server in the local network.

    I've added the page to the home screen to facilitate access.

    So the behavior is:

    - The mobile device (a Samsung Galaxy S7 device that is set in Italian, Android 8.0.0, Chrome 99.0.4844.73) is occasionally shown the browser language as en-US instead of it.

    I initially pointed my finger at an error in my game but when I tried to develop a new empty project to just check the language I've got the same issue.

    I started to make some troubleshooting on the Samsung S7 and I tried this:

    1) added English (United States) language as additional default language (the Italian was set as a secondary language)

    2) test again the browser language

    The result was "en-US"

    then:

    1) switch back to Italian as the primary default language

    2) test again the browser language

    The result was "en-US" (This is wrong!)

    I've also tried to clean the Chrome cache (the Chrome App cache) with no success.

    Even restarting the device the language was always recognized as en-US instead of it or it-IT

    I've then tried to clean the cache of the page that has been added to the home page (this link is seen as an app in the list of the available applications) and... it worked!

    So... it appears that the language is cached in the home link I've created.

    Is that expected? Is the browser language something that should be cached?

    thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Unfortunately cleaning the browser cache does not solve always the issue.

    I didn't find a relation.

    I'm using version R286 by the way.

    Anybody else has had the same issue?

    Any thoughts?

    tx

  • Do you mean using the Browser.Language expression?

    This just directly returns whatever the browser thinks the language is (via navigator.language). So if it's wrong, it's the browser that's providing the wrong value, not Construct.

  • Yes using the Browser.Language expression.

    Please note that the mobile device is loading an HTML5 app. I didn't try from an APK to see the behavior.

    Ashley do you think is a Chrome bug ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)