Skip to content
Snippets Groups Projects
Unverified Commit 1293ad1d authored by Paul Rosenzweig's avatar Paul Rosenzweig Committed by GitHub
Browse files

fallback to english if we don't have the browser locale (#13048)

parent 55312e4b
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ export default class Setup extends Component {
userDetails: PropTypes.object,
languageDetails: PropTypes.object,
setActiveStep: PropTypes.func.isRequired,
databaseDetails: PropTypes.object.isRequired,
databaseDetails: PropTypes.object,
};
completeWelcome() {
......@@ -45,7 +45,9 @@ export default class Setup extends Component {
// fall back to matching the prefix (e.g. just "zh" from "zh-tw")
locales.find(
([code]) => code.toLowerCase() === browserLocale.split("-")[0],
);
) ||
// if our locale list doesn't include the navigator language, pick English
locales.find(([code]) => code === "en");
if (defaultLanguage) {
const [code, name] = defaultLanguage;
this.setState({ defaultLanguage: { name, code } });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment