Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi language: Pages translated only for some languages #104

Open
wdebusschere opened this issue Jul 12, 2024 · 14 comments
Open

Multi language: Pages translated only for some languages #104

wdebusschere opened this issue Jul 12, 2024 · 14 comments
Labels
type: enhancement ✨ Suggests an enhancement; improves the plugin
Milestone

Comments

@wdebusschere
Copy link

Main language: EN, Other languages: FR, NL => NL is
We have a multi language setup and we use an extra toggle field to set the page published or not.

What would be the best way to tune this to work for the plugin.
Example English page Projects, only exists in EN, not in the other language.. (content is not translated),
but the plugin will automatically create the rel="alternate" for each language and also in the sitemap.

@tobimori
Copy link
Owner

tobimori commented Jul 12, 2024

Return ['robotsIndex' => false] from the computed content: https://plugins.andkindness.com/seo/docs/advanced/computed if the language is unpublished.

@wdebusschere
Copy link
Author

wdebusschere commented Jul 15, 2024

@tobimori
We tried that, but it doesn't work because the $lang is always NULL.
public function metaDefaults(string $lang = null): array
dump the $lang it's always NULL..

@tobimori
Copy link
Owner

@wdebusschere
Copy link
Author

@tobimori can you elaborate?

@tobimori
Copy link
Owner

Try kirby()->languages()->current() instead

@wdebusschere
Copy link
Author

@tobimori no luck with this.. does this work for you?
I see in our other sites that in the custom models the language is never passed, used..

@tobimori
Copy link
Owner

tobimori commented Jul 15, 2024

Does kirby()->language()->code() work?

@wdebusschere
Copy link
Author

wdebusschere commented Jul 15, 2024

@tobimori

kirby()->language()->code() gives the active language code, but this is not enough
Example we create a templatePage.
English page Services has the boolean Published true
Dutch page Services has the boolean Published false.
The sitemap will onlyuse the default language of the templatePage
The same for the alternate urls, in english it gives them all (does not check for each language the template)

<link href="https://www.domain.be/cs/services" hreflang="cs" rel="alternate">
<link href="https://www.domain.be/en/services" hreflang="en" rel="alternate">
<link href="https://www.domain.be/nl/services" hreflang="nl" rel="alternate"> => Should not be here
<link href="https://www.domain.be/en/services" hreflang="x-default" rel="alternate">

In dutch
no alternate links..

@wdebusschere
Copy link
Author

@tobimori Any update on this?

@tobimori
Copy link
Owner

nope, let me re-open

@tobimori tobimori reopened this Jul 16, 2024
@tobimori tobimori added the type: enhancement ✨ Suggests an enhancement; improves the plugin label Jul 16, 2024
@wdebusschere
Copy link
Author

@tobimori Can you simulate it?

@tobimori
Copy link
Owner

It needs changes to the plugin and is currently not possible.

@wdebusschere
Copy link
Author

Any timing from your side?

@tobimori
Copy link
Owner

No time to work on this in the near future except if development is funded, too much client work right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement ✨ Suggests an enhancement; improves the plugin
Projects
None yet
Development

No branches or pull requests

2 participants