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 enhancement #203

Open
NicoPy opened this issue Apr 13, 2020 · 2 comments
Open

Multi-language enhancement #203

NicoPy opened this issue Apr 13, 2020 · 2 comments

Comments

@NicoPy
Copy link
Contributor

NicoPy commented Apr 13, 2020

To enhance multi-language support :

  • Add global translation buttons as described in i18n_subsites plugin documentation.
  • Add a PAGE_HIDE_TRANSLATION option like the ARTICLE_HIDE_TRANSLATION and use it in page.html template.
  • Modify CSS accordingly.

This allows to switch language from any page, even those that are neither articles nor pages.

@alexandrevicenzi
Copy link
Owner

Feel free to send a PR. i18n was never a major thing in this theme, only i10n.

@JulienPalard
Copy link

JulienPalard commented Jan 25, 2023

I'm not fan of those global translation buttons as documented by i18n_subsites: they always lead to the homepage, which is surprising, as a user I expect them to give me the same page but translated.

I would not be happy with "global translation buttons" leading to the same URL on the translated subsite, as not every pages and articles may exist in the translations, those button may lead to unexisting pages.

What I think would work great is to add translation buttons on just a few more templates, and for consistency display them like on articles and pages.

Typically the index template could benefit from those buttons as it's translated, maybe some other like archive, authors, categories and tags may be interesting too.

Something simple like this should do the work:

{% if lang_siteurls %}
  <div class="translations">
    {% for lang, url in lang_siteurls.items() %}
      <a href="{{ url }}/">{{ lang }}</a>
    {% endfor %}
  </div>
{% endif %}

But it requires touching the style.less at least to make the button appear on the right (for consistency with the article style).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants