How can I integrate multi-language feature in my Ghost blog?

I am trying to integrate multi-language feature in my existing Ghost blog but I don’t see anything working there. My blog works as a this URL format: domain.com/insight/. I already tried the procedure from this url: https://ghost.org/tutorials/multi-language-content/.

After doing the process as said in the tutorial when I open url eg. domain/insight/de/ then my home page content don’t show. Also when try to open post for de language(domain.com/insight/de/post-url) it redirects me to the main post url.

  • Ghost blog version 3.2.
  • I am using Casper theme.

I appreciate any help to make it work. Thanks in advance.

1 Like

The routes.yml procedure does not filter pages, even though it says so in the url :sweat_smile:

Ghost is also missing other multi-language features, such as linking between same content but different language, and multilang navigation.

I hacked these with javascript; in settings > code injection > ghost_head I have a sitemap which needs manual updating:

var sitemap = {
	index: {
		fi: "/",
		en: "/en/",
	},
	uneton: {
		fi: "/uneton/",
		en: "/en/uneton/",
	},
	…
}

…and then I hack the navigation.

If you want /en/ or /de/ in page url, you need full manual routes:

routes:
  /en/docs/:
    template: post
    data:
      post: page.docs_en

Good luck :stuck_out_tongue_winking_eye:

Thank you for the quick response.

So I will need to route everything manually? I have tag pages also, it will also need to route manually for different languages? I want to integrate 13 languages, do you think it will be possible?

Uh-oh, in theory it is possible (to manually route multiple languages), but in practise Ghost is not ready for this :pensive:

You could add everything as a post, then automatic routes work as documented. Or we’ll wait and hope it gets fixed to work with pages, too :relaxed:

Thanks friend, I am leaving that as it is for now.

Hey all :wave:. We’ve just spent some time updating our tutorial on using Ghost in different languages and in multiple languages. Any feedback you have is welcome :raised_hands:
https://ghost.org/tutorials/multi-language-content/

David,

how about saying some more on navigation in multi-language sites?

Thnx

Could you be more specific? Do you mean having translated navigational items in your site?

Yes, I would need to translate the navigational items, while retaining their equivalences … i.e. the translated Home acts like home.

Best way to manage that would be with custom templates and custom partials. You could create a nav-fr.hbs partial for example and list all your custom nav items in there.

1 Like

Thanks David,

I’ll play around with that. It requires the translations to be hardcoded, but it’s simple.

2 Likes

There’s a 3rd party service called Pressbase.io that has multiple language support out of the box.
It’s a 3rd party SaaS built on the open source Ghost 3 software.

Here is a workaround to achieve that :

  1. Create a template file hello_world.hbs
  2. Update the routes.yaml file as follow
/hello-world/:
    template: hello_world # referencing hello_world.hbs
    data: page.hello-world # You should create a page from admin that have slug : hello-world

/en/hello-world/:
    template: hello_world # referencing hello_world.hbs
    data: page.hello-word-en # You should create a page from admin that have slug : hello-world-en
  1. Write the code of the page in your hello_world.hbs and you can display the content of the page by using the {{#post}}{{/post}} block

:hugs: Voila! You have your multi-language pages with same slug