Skip to content

lossius/multilingual-static-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-lingual static web site

This is a demo project for how to build a multi-lingual static website. All translations of a page are maintained in the same document, and the various language verisons are displayed or hidden depending on choice of locale. Language preference is stored in a cookie and remembered from one page to the next.

In this example the localeNo and localeEn classes are used for Norwegian and English text elements respectively. Similar classes can be constructed for other languages. In order to change languages or add support for more languages, the showLocale() method in scripts/locale.js will have to be modified. Currently it supports Norwegian (default) and English. This file also need to be adjusted for the domain name of your site in line 9 of scripts/locale.js.

Dependencies

This website depends on jQuery. If you use other frameworks such as Bootstrap, jQuery is already included there. Additionally it makes use of js-cookie.

Flag icons by Icon Drawer. Please check their terms before using them for your own site.

Demo

An online demo version of this web site can be found here.

About

Demo project of a static multilingual website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published