Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Can I use multi-language features on a partially translated site?

Started by Peter Rankin 8 years ago · 3 replies · 751 views
8 years ago

Hi! I'm using Grav for a new site and it looks nice.

I have a question about the multilingual feature: Can I "hide" pages from showing up in collections if there is no translation for that page in the currently active language? For example, let's say the primary language is English, and I have a Spanish homepage that displays recent posts. Is it possible to hide links to English-only pages? I thought that the translations_fallback variable set to false would do that, but the English-only links still show up on the Spanish homepage. And if you click on one, even though the URL says es, it just renders the English version for that page.

Am I doing this incorrectly? Or does Grav's multi-lingual feature expect the entire site to be translated when using collections?

👍 1
8 years ago

I basically have the same question. On our site there are only the legal pages like terms of service etc. translated to english. But now the whole site gets it's englisch urls with /en/. Thats not good for SEO purposes.

Now if there is no .en.md file found, i would like to show an 404 for the englisch page or even better an 302 redirect to the default version. Is there any possibility to do that?

Thanks!

6 years ago

I got it to work the way you want it to by setting pages_fallback_only: true

6 years ago

You can also create an empty page in the language you want to hide and set

published: false

-- Harald

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 80 10 hours ago
General · by pamtbaau, 15 hours ago
1 51 15 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago