Skip to content
This repository was archived by the owner on May 18, 2025. It is now read-only.

Bellisario/lang.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lang.js

Note

This project was one of my first on GitHub and was an important part to learn more about JS, GitHub and opensource in general.

Looking at this years after with tons more experience, I know no one (me included) would ever want to use something like this.
I won't delete the repo 'cause it's part of my self-taught dev path, instead I'm going to archive it.

lang.js is a simple library that help you with multilanguage sites.

View user language

Use this to view the main user language

navigator.lang
// Console returns your favourite language

Check user language

Use this to check if the input language is the main language

navigator.islang("en")
// Console returns true if user use english

Callback function if user use a specific language

Use this for callback functions that require a specific user language

navigator.iflang("en", callback)
// For example, if user use english and callback returns true, the console returns true, too.

Watch out

This library is useful only if you want to know user language, not user nationality: for example, you can't know if a user is American or British, you can only know if they speak English.

Test lang.js

If you want test this library, click here.

About

lang.js is a simple library that help you with mutilanguage sites.

Topics

Resources

Stars

Watchers

Forks

Sponsor this project