Closed icebilly closed 1 year ago
Hi @icebilly
My first impression here is that this plugin can't be expected to support the translation of every theme/plugin out there but since we're talking about mkdocs-material specifically and that I know that Martin cares, I'd like to kindly ask him his take on this.
@squidfunk Hello, do you have plans or don't you think that this kind of translations should fall into mkdocs-material's own localization support please?
The cookie consent is already fully localizable.
The title
and description
(= body) of the cookie consent can be set via mkdocs.yml
:
extra:
consent:
title: Cookie consent
description: >-
We use cookies to recognize your repeated visits and preferences, as well
as to measure the effectiveness of our documentation and whether users
find what they're searching for. With your consent, you're helping us to
make our documentation better.
The cookies
themselves can also be changed/translated:
extra:
consent:
cookies:
analytics: Custom name
The buttons are localized via our regular translation system, e.g. for French:
...
"consent.accept": "Accepter",
"consent.manage": "Paramétrer vos choix",
"consent.reject": "Refuser",
...
All parts of Material for MkDocs are localizable. I'm not sure how the localization approach that is implemented in this plugin must be adjusted, but if you build separate sites and link them with the language selector, everything works out-of-the-box (without using this plugin). I understand that this plugin offers some niceties that make localization simpler, but I haven't used it, so I can't really say what would be necessary to add support here.
Thanks for confirming about the support for localization.
This plugin does build the same site for each configured language using a single mkdocs.yml file. It does already set the lang option of mkdocs-material so indeed the buttons get localized for each site version without problem, I just tested it.
I guess @icebilly wants a way to be able to translate the actual title
and description
of the cookie consent of material within a single mkdocs.yml file.
If I understand the documentation and your comment correctly, this is thus not feasible from a mkdocs-material perspective right?
No, this is nothing we plan to integrate.
yes, the title and the description are what we want to translate, currently we use separated projects for different languages, so we can translate them in different projects, since we are now try to use mkdocs-static-i18n to enhance our mkdocs projects management, it's better to have them translated in one project. Anyway, it's depend on your plans.
@icebilly hi, I would like to point out that the upcoming 1.0.0 version of this plugin will allow you to override any part of the mkdocs.yml config per language as described in #216
If you are interested to give it a try, I'd appreciate some feedbacks on the mentioned PR
Thanks!
I'm happy to announce release v1.0.0 of the mkdocs-static-i18n
plugin!
Please check it out since you can now override every part of the mkdocs.yml :) This is thus now possible!
hi, we use materia for mkdocs, use google analytics as well, it seems the mkdocs-static-i18n plugin not support translation these content yet.