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

incorrect lang #410

Closed
tyrone98 opened this issue Dec 26, 2015 · 1 comment
Closed

incorrect lang #410

tyrone98 opened this issue Dec 26, 2015 · 1 comment
Labels
bug
Milestone

Comments

@tyrone98
Copy link

@tyrone98 tyrone98 commented Dec 26, 2015

I was using Simplified Chinese , but the content of the toolbar is Traditional Chinese .
In source code

       var userLanguage = navigator.language || navigator.userLanguage || 'en';

                var parts = userLanguage.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/);
                var lang = parts[1];
                var locale = parts[2];

                if (languages[lang + '-' + locale]) {
                    lang = lang + '-' + locale;
                } else if (!languages.indexOf(lang)) {
                    lang = 'en';
                }

languages variable is array , so languages[lang + '-' + locale ] always return null , replace to languages.indexOf( lang + '-' + locale )

Thanks

@ipeychev ipeychev added the bug label Dec 26, 2015
@ipeychev ipeychev added this to the 0.7.4 milestone Dec 26, 2015
@ipeychev
Copy link
Contributor

@ipeychev ipeychev commented Dec 26, 2015

Thanks for the reporting!

@ipeychev ipeychev closed this in ee7c66d Dec 26, 2015
ipeychev added a commit that referenced this issue Dec 26, 2015
Fixes #412
Fixes #411
Fixes #410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants