Skip to content

Commit

Permalink
Merge pull request #48 from FANMixco/bugs
Browse files Browse the repository at this point in the history
Fixed language issue
  • Loading branch information
FANMixco authored Sep 5, 2021
2 parents 6095955 + c12a404 commit 2156cf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions js/lib/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ let lngObject;
function load() {
let translate = new Translate();
lang = navigator.language || navigator.userLanguage;

if (lang.includes('-'))
lang = lang.split('-')[0];

if (!langs.includes(lang))
lang = "en";
translate.init(lang);
Expand Down
2 changes: 1 addition & 1 deletion js/lib/translate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2156cf6

Please sign in to comment.