bukinoshita / detect-browser-language Goto Github PK
View Code? Open in Web Editor NEWDetect browser language
License: MIT License
Detect browser language
License: MIT License
Breaks down on module export with Syntax error
module.exports = () =>
(navigator.languages && navigator.languages[0]) ||
navigator.language ||
navigator.userLanguage
I know it is trendy to just ditch everything that is older than 3 months, but unfortunately a lot of users are still on windows 7 using IE 11.
I don't understand why a language detection library has dependencies like
react-popup-betatable-testlist-tablereact-table-list-beta..
I would rather call it react browser language detection or remove the optional dependencies.
The code will not minify successfully upon running npm run build
. The following error is thrown:
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/detect-browser-language/index.js:3
Read more here: http://bit.ly/2tRViJ9
This is due to ES6 function definition being used in index.js
. Substituting with ES5 syntax makes the minification and build pass. I'll shortly create a pull request with working code.
I installed that dependency and when I search the page in Google, the page description appears in English when the page is in Spanish and the geolocation is in a Hispanic-speaking country. If the user does not have the browser set to Spanish, the page appears in English, which is fine. But it's not okay for Google bots. Any solutions?
It detects English though in my Mac OS I have Hungarian language set. Laguage is not set per browser in Mac Safari. Maybe this is the reason of the bug.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.