Git Product home page Git Product logo

greeter's Introduction

greeter

Greet visitors to your website in their heart language & using the time of day with this tiny JS script. ๐ŸŒŽ

Backstory

I wanted the ability to greet users to my apps and websites in their heart language, so that no matter where they are in the world they could feel welcomed. This script was created to be as light-weight and accessible as possible, so that it can run in less than a second in browsers around the world. It's a simple touch that will make your app or website feel personalized and welcoming!

It uses NavigatorLanguage.language properties (which are available in all major browsers) to learn about the user's language, and defaults to English if the language is indeterminable. If the time of day is also indeterminable, we default to a standard greeting in the user's language.

Examples

Hindi German Spanish

See it in action at my personal site, lukemoorman.com.

Usage

Include the script in your website, either using yarn or npm (coming soon!), or with a script tag. We recommend at the bottom of the page body, like:

 <script src="greeter.js"></script> 

Then, add a default greeting to your page, like "Hello!":

<p><span id="greeting">Hello!</span> Welcome to my website!</p>

The page will load, and change from the hard-coded default greeting, to the heart-language of the user.

Language Support

Greet fully supports 91 languages, with partial support for 8 languages! To see the full list, check out Supported Languages

How can I get involved?

I welcome PRs to support more languages (I'd love to include all language codes!), regionally-specific greetings, and spelling, grammatical and cultural improvements to the langauge.

Contributing

  • Please reach out to @kmoo. Thanks!

greeter's People

Contributors

kmoo avatar

Stargazers

Some developer avatar  avatar Theo Bearman avatar Matt Zimmermann avatar My Kim Bui avatar Alex MacArthur avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.