Closed Andygol closed 1 year ago
It appears that I've managed to change the theme color by adding a hyphen in front of primary: red
. However, I'm still encountering issues with the localization for extra.consent
.
- locale: uk
# link: /uk/
name: Українська
build: true
theme:
palette:
- primary: red
+ - primary: red
extra:
consent:
title: Репʼяшки
description: >
Ми використовуємо файли cookie, щоб розпізнавати ваші повторні…
It appears that only extra.alternate
is being processed, while other items placed within the extra
section are not. Could you please consider handling sub-items of extra
in the same manner as sub-items of the theme
section?
@Andygol let's separate the two problems here.
The plugin docs specify something important:
Any option you override here MUST be set (even to its default) on its main mkdocs.yml section before being overriden on one or more languages.
The main mkdocs.yml palette config sets a list like this:
palette:
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
primary: default
scheme: default
toggle:
icon: material/weather-sunny
name: Switch to dark mode
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
primary: blue grey
scheme: slate
toggle:
icon: material/weather-night
name: Switch to light mode
while you try to override a DICT
theme:
palette:
primary: orange
How is the plugin supposed to know what you're trying to override here? the light or dark version of the original list?
The right way is to copy/paste the original part of the config and keep only what you want to change, it could look like this
- locale: uk
link: /uk/
name: Українська
build: true
theme:
palette:
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
primary: orange
scheme: default
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
primary: blue grey
scheme: slate
If you do that it works as intended, the light UK version is orange :)
Indeed you found a bug! The proposed and tested fix is here: https://github.com/ultrabug/mkdocs-static-i18n/pull/273
Thanks
Fix available in version 1.1.1
I encountered the inability to apply localization to get the appropriate messages for the selected language.
I tried to reproduce the "Overriding MkDocs options per language" example, but didn't get the expected result.
Here is my code on which I tested - mkdocs-static-i18n.zip.
I've tried adding a localization for the cookie settings dialog, but no luck.
I'm still not sure if this is some problem with the plugin itself, or if I did something wrong in
mkdocs.yml
.Any help would be greatly appreciated.
PS Here is the
mkdocs serve
log