All Projects → bukinoshita → detect-browser-language

bukinoshita / detect-browser-language

Licence: MIT license
Detect browser language

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to detect-browser-language

Fluent
Fluent — planning, spec and documentation
Stars: ✭ 818 (+2237.14%)
Mutual labels:  internationalization, intl, translate
Goloc
A flexible tool for application localization using Google Sheets.
Stars: ✭ 42 (+20%)
Mutual labels:  internationalization, intl
iXn
Control your localization of apps
Stars: ✭ 20 (-42.86%)
Mutual labels:  internationalization, intl
Eslint Plugin I18n Json
Fully extendable eslint plugin for JSON i18n translation files.
Stars: ✭ 101 (+188.57%)
Mutual labels:  internationalization, intl
Js Lingui
🌍📖 A readable, automated, and optimized (5 kb) internationalization for JavaScript
Stars: ✭ 3,249 (+9182.86%)
Mutual labels:  internationalization, intl
Texterify
The localization management system.
Stars: ✭ 37 (+5.71%)
Mutual labels:  internationalization, translate
Aura.intl
Internationalization tools, particularly message translation.
Stars: ✭ 82 (+134.29%)
Mutual labels:  internationalization, intl
tr4n5l4te
Use Google Translate without an API key.
Stars: ✭ 32 (-8.57%)
Mutual labels:  internationalization, translate
Arbify
ARB files localization tool. Dedicated to Flutter and its intl package.
Stars: ✭ 168 (+380%)
Mutual labels:  internationalization, intl
Formatjs
The monorepo home to all of the FormatJS related libraries, most notably react-intl.
Stars: ✭ 12,869 (+36668.57%)
Mutual labels:  internationalization, intl
React Translated
A dead simple way to add complex translations (i18n) in a React (DOM/Native) project 🌎🌍🌏
Stars: ✭ 176 (+402.86%)
Mutual labels:  internationalization, translate
Eo Locale
🌏Internationalize js apps 👔Elegant lightweight library based on Internationalization API
Stars: ✭ 290 (+728.57%)
Mutual labels:  internationalization, intl
react-translator-component
React language translation module for developing a multilingual project.
Stars: ✭ 13 (-62.86%)
Mutual labels:  internationalization, translate
intl-format
A wrapper library for PHP to format and internationalize values in messages like sprintf
Stars: ✭ 12 (-65.71%)
Mutual labels:  internationalization, intl
Flutter translate
Flutter Translate is a fully featured localization / internationalization (i18n) library for Flutter.
Stars: ✭ 245 (+600%)
Mutual labels:  internationalization, translate
React Intl Hooks
React hooks for internationalization without the hassle ⚛️🌍
Stars: ✭ 64 (+82.86%)
Mutual labels:  internationalization, translate
v-intl
Add i18n to your awesome Vue 3 app 🔉
Stars: ✭ 13 (-62.86%)
Mutual labels:  internationalization, intl
vue-translated
Internationalization (i18n) and localization (l10n) library for Vue.js v2.
Stars: ✭ 19 (-45.71%)
Mutual labels:  internationalization, translate
Jquery.ime
jQuery based input methods library
Stars: ✭ 145 (+314.29%)
Mutual labels:  internationalization, intl
Laravel Intl
🚫 [ABANDONED] Easy to use internationalization/localization functions for Laravel 5
Stars: ✭ 185 (+428.57%)
Mutual labels:  internationalization, intl

detect-browser-language

Detect browser language

Install

$ yarn add detect-browser-language

Browser support

  • Chrome
  • Firefox
  • IE
  • Edge
  • Opera
  • Safari

Usage

// without SSR (server-side rendering) — React example
import React from 'react'
import detectBrowserLanguage from 'detect-browser-language'

export default () =>
  <h1>{detectBrowserLanguage()}</h1>
// with SSR (server-side rendering) — React example
import React, { Component } from 'react'

export default class Page Component {
  componentDidMount() {
    const detectBrowserLanguage = require('detect-browser-language')
    this.setState({ userLanguage: detectBrowserLanguage() })
  }

  render() {
    const { userLanguage } = this.state

    return <h1>{userLanguage}</h1>
  }
}

PS: Works with other libraries as well.

Why

If you have a website that has intl implemented use this library to get user preferred language instead trying to guess the language based on their geolocation. I might be in France but that does't mean I speak/read french.

License

MIT © Bu Kinoshita

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].