johnfernow / personal-website

My personal website
https://johnfernow.com
0 stars 0 forks source link

Localize site #4

Closed johnfernow closed 4 years ago

johnfernow commented 5 years ago

GitHub Pages doesn't allow custom backend code which would be the ideal way to serve the site in different languages. However, jQuery Localize seems like it would do the trick, and fortunately even if the user has JavaScript disabled it will at least display the page in English, and I could have a no-script tag that informs the user that Spanish is available if they enable JavaScript.

johnfernow commented 4 years ago

Aside from using jQuery Localize, I need to find some way to store the language (in case the user has manually changed the language from the one detected by default). I'll likely have to use localStorage. The comments in this issue may be helpful.

johnfernow commented 4 years ago

A drop-down to change the language could probably be on the main navbar on the far right side.

johnfernow commented 4 years ago

This link provides a good example of how to save and load the language from localStorage.