Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting language Indonesian causes error #22192

Closed
npfitz opened this issue Apr 28, 2022 · 4 comments · Fixed by #22226
Closed

Selecting language Indonesian causes error #22192

npfitz opened this issue Apr 28, 2022 · 4 comments · Fixed by #22226
Assignees
Labels
.Backend Customization/i18n .Frontend Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Milestone

Comments

@npfitz
Copy link
Contributor

npfitz commented Apr 28, 2022

Setting a users language to Indonesian throws an error that the user cannot recover from

Logs
Can be seen in the gif below, but it appears that Moment is attempting to load the locale in. The locale for Indonesian that we use is id.

To Reproduce
Steps to reproduce the behavior:
On a Fresh install of metabase

  1. Complete initial setup screen. Select english as your language
  2. Go to account settings
  3. Select Indonesian as the language
  4. Click update

Expected behavior
Page to be refreshed and displayed in Indonesian

Screenshots
chrome_HMnzAeRFuz

Information about your Metabase Installation:

{
  "browser-info": {
    "language": "en-US",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.14.1+1-Ubuntu-0ubuntu1.20.04",
    "java.vendor": "Ubuntu",
    "java.vendor.url": "https://ubuntu.com/",
    "java.version": "11.0.14.1",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.14.1+1-Ubuntu-0ubuntu1.20.04",
    "os.name": "Linux",
    "os.version": "5.10.16.3-microsoft-standard-WSL2",
    "user.language": "en",
    "user.timezone": "America/Halifax"
  },
  "metabase-info": {
    "databases": [
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "h2",
    "application-database-details": {
      "database": {
        "name": "H2",
        "version": "1.4.197 (2018-03-18)"
      },
      "jdbc-driver": {
        "name": "H2 JDBC Driver",
        "version": "1.4.197 (2018-03-18)"
      }
    },
    "run-mode": "dev",
    "version": {
      "date": "2022-04-27",
      "src_hash": "8878eded49230b44f9d94c8d7d86a32ab910ce4d",
      "tag": "v0.43.1-SNAPSHOT",
      "branch": "revision-history-not-updating-after-revert",
      "hash": "614127d"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Severity
Seems to put us in an irrecoverable state. Potential P1

Additional context
@flamber @diegmonti
We have confirmed that we call PUT /api/user/:id with the correct locale, but it appears to be set incorrectly in window.MetabaseLocalization. The terminal console will display Locale 'in' not found, which suggests that maybe something is happening here

@ranquild
Copy link
Contributor

Refreshing the page won't help, the user is completely locked out.

@flamber flamber added Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness and removed .Needs Triage labels Apr 28, 2022
@flamber flamber added this to the 0.43 milestone Apr 28, 2022
@nemanjaglumac nemanjaglumac added this to Backlog in Cypress Testing via automation Apr 28, 2022
@npfitz
Copy link
Contributor Author

npfitz commented Apr 28, 2022

I've got a small change locally that will default the language to English (assuming this acceptable behavior) , and I'm working on putting an E2E test together now

@mazameli @nemanjaglumac

@adam-james-v
Copy link
Contributor

We’ve tracked things down to this:
In java 17:

metabase.util.i18n> (map locale ["id" "in"])
(#locale "id" #locale "id")

But in java 11:

metabase.util.i18n> (map locale ["id" "in"])
(#locale "in" #locale "in")

Because of this difference, everything works fine in Java 17 land -> the id.edn file can be found and translations to Indonesian work.
But, in Java 11 land, id.edn exists, but the system is looking for in.edn, which does not exist.

@adam-james-v
Copy link
Contributor

adam-james-v commented Apr 28, 2022

Edit: this was meant to be put in my PR... sorry

This was referenced Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Backend Customization/i18n .Frontend Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Projects
None yet
6 participants