Hyvor Blogs comes with in-built multi-language support. This guide will help you to set up languages of your blog correctly.
Language settings: Console → Settings → Languages.
English (en
) is the primary language for newly created blogs. If you are blogging in a different language, it is important to change the language in Language settings to tell users, browsers, and crawlers the language of your blog.
In language settings, each language has a code, name, and a direction.
lang
attribute value. Some examples are
en
en-US
en-GB
fr
fr-FR
Hyvor Blogs comes with in-built support for multi-language blogs. Therefore, it is simple to set up a multi-language blog. Only thing you have to do is adding a new language in settings. Make sure you use a correct language code as explained above.
Let's say you there are two languages en
(default) and fr
in your blog. Now, /
will list all English posts. /fr
will list all French posts. All routes of your blog will be changed similarly.
In the post editor, you will see an option to create multiple language variants of a post.
Think of each variant as a separate post. Each post can have a different slug. For example, if you have a post with slug hello-world
in English, you can have a post with slug bonjour-monde
in French. The French post will be shown at /fr/bonjour-monde
.
Almost all data in Hyvor Blogs can be translated into languages in your blog. Here are some examples:
All themes in Hyvor Blogs are translatable. Here's how to translate your theme.
lang
folder.en.yaml
is the default language file.en.yaml
fr.yaml
for French. Then paste the contents.key: value
pairs.*
and {key}
are placeholders. Do not translate them."
) if you want to use special characters like :
, *
, etc.Example:
en.yaml
comments: Comments
posts_num_multi: "* Posts"
author: "by {name}"
fr.yaml
comments: Commentaires
posts_num_multi: "* Articles"
author: "par {name}"
Here are some under the hood works that Hyvor Blogs do to make sure search engine robots understand your multi-language pages.
HB adds the lang
attribute to the <html>
tag in all pages using the language code you set (this is why using the correct language codes are important).
<html lang="en">
In addition, HB will add hreflang
alternate tags. For example, if you have three languages (en
, fr
, es
), the en
index page (/
) will have these tags.
<link rel="alternate" href="https://yourblog.com/fr" hreflang="fr" />
<link rel="alternate" href="https://yourblog.com/es" hreflang="es" />
For posts, we will add these alternate tags only if we can find its translated posts.