-
I want to have different palette titles for each language
|
Beta Was this translation helpful? Give feedback.
Answered by
dragomano
Feb 17, 2024
Replies: 1 comment
-
Solution: overrides/partials/palette.html <!-- Color palette toggle -->
<form class="md-header__option" data-md-component="palette">
{% for option in config.theme.palette %}
{% set scheme = option.scheme | d("default", true) %}
{% set primary = option.primary | d("indigo", true) %}
{% set accent = option.accent | d("indigo", true) %}
<input
class="md-option"
data-md-color-media="{{ option.media }}"
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
data-md-color-primary="{{ primary | replace(' ', '-') }}"
data-md-color-accent="{{ accent | replace(' ', '-') }}"
{% if option.toggle %}
aria-label="{{ option.toggle.name }}"
{% else %}
aria-hidden="true"
{% endif %}
type="radio"
name="__palette"
id="__palette_{{ loop.index0 }}"
/>
{% if option.toggle %}
{% if "light" in option.media %}
{% set paletteTitle = lang.t('toggle.dark') %}
{% elif "dark" in option.media %}
{% set paletteTitle = lang.t('toggle.auto') %}
{% else %}
{% set paletteTitle = lang.t('toggle.light') %}
{% endif %}
<label
class="md-header__button md-icon"
title="{{ paletteTitle }}"
for="__palette_{{ loop.index % loop.length }}"
hidden
>
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
</label>
{% endif %}
{% endfor %}
</form> Add these lines to en.html:
And translate them in your .html |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dragomano
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution:
overrides/partials/palette.html