Questions? Hit me up: @Tayokoart
Last active
December 27, 2015 19:59
-
-
Save miguel-perez/7380875 to your computer and use it in GitHub Desktop.
Detect your user's language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lang = window.navigator.userLanguage || window.navigator.language; // Uses OS language setting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$lang = $_SERVER['HTTP_ACCEPT_LANGUAGE']; // Uses the browser's language setting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"></html> | |
<html lang="es"></html> | |
<html lang="ja"></html> | |
<html lang="ar" dir="rtl"></html> <!-- Set document direction as needed --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment