Skip to content

Commit

Permalink
Fixed language issue
Browse files Browse the repository at this point in the history
  • Loading branch information
FANMixco committed Sep 5, 2021
1 parent 1e0f28d commit c12a404
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 c12a404

Please sign in to comment.