insights

Translating GitHub Pages

When you create a blog or a website for your open source project, you might ask yourself how do I make a static website multilingual? How do I translate it?


Websites can be dynamic or static. Dynamic websites are usually built using a CMS, which involves a database and server-side languages. On the other side, static websites are simply built using HTML, CSS, and JavaScript. That means that server-side languages such as PHP, Ruby, or Python are not used or supported. If you are developing a personal website for blogging, portfolio, or simply for the documentation of a project, chances are that you don’t need a dynamic website. 

Why GitHub Pages 

Static websites can be built by writing the static files yourself or by using a static site generator such as Jekyll. Furthermore, there are static site hosting service solutions that take away the technical hassles of having to host the website on your server.

GitHub Pages is one of the most popular static site hosting service solutions and offered by GitHub.  GitHub Pages is a solution that takes the static files directly from your repository hosted on GitHub and publishes them onto a website on a subdomain or custom domain of your choice. GitHub Pages can be used to host a personal website, a blog, a website for your open source project, or a project documentation site straight from a repository on GitHub.com. 

Here are some advantages of using GitHub Pages and what makes it so popular:

  • Free - Everyone with a GitHub account can create a website for free straight from their repository hosted on GitHub.
  • Easy - GitHub Pages is very easy to set up and it’s well documented by GitHub.
  • Secure - The risk of security vulnerabilities is minimal on static websites such as GitHub pages because there is no need to use a database to store data.
  • Fast - The absence of a database and server-scripting languages makes a static website, not just more secure, but also faster and easier to load.
  • Subdomain & custom domain support - GitHub pages allow you to serve your website on a subdomain or custom domain of your choice. To learn more about configuring a subdomain or custom domain, please visit the official GitHub documentation.
  • Automatic deployment - GitHub will automatically reflect all the changes and edits of the files on your repository and will automatically deploy the changes for you in a matter of seconds.
  • Powered by Jekyll - When using GitHub pages, you have the freedom of creating your static files or using a static generator to do the job for you. GitHub Pages uses Jekyll by default as a static site generator. Jekyll is written in Ruby, it supports Markdown and has built-in support for GitHub Pages.

Making GitHub Pages multilingual

When you create a blog or a website for your open source project, you might ask yourself how do I make a static website multilingual? How do I translate it?

Translating static pages sounds tricky, but there are options available for achieving it.

Jekyll plugins 

Jekyll is a static site generator that supports a plugins system. That means that every developer can write custom code and make it available for people to install it. There are multiple plugins available for translating Jekyll websites.

This approach has downsides and having to install extra code is not the only one.

  1. Outdated plugins: Often the developed plugins are unmaintained, not compatible, or not tested against the current version of Jekyll or GitHub Pages.
  2. Manual work required: Plugins often require technical work, manual tweaking the site layout, or having to manually translate all the strings.
  3. Not everyone uses Jekyll to build static pages.

The Dilingual approach

Dilingual is compatible with all static pages, not just websites hosted on GitHub Pages or powered by Jekyll. The upsides of using Dilingual to translate your static website, including GitHub Pages are:

  1. Automatic translation of the content in your static pages.
  2. No need for extra plugins or code tweaks.
  3. The changes made to your website are automatically detected and reflected in seconds.
  4. No duplicated code
  5. Subdomains and custom domains are supported. GitHub Pages supports using subdomains or custom domains for your website. So does Dilingual for your translated website. Learn more about how to configure custom domains for your translated website by visiting the Dilingual documentation.

If you are interested to learn more about Dilingual features and why it might just be the best approach for translating static websites, please click here.

 

Similar posts

Get notified for updates

Subscribe to our newsletter to stay up to date on the latest industry insights and news.