Piotr, hi.
Smth strange is happening in 2023.9.2 (may be happened earlier…)
This works:
Translated en: {{ "sun.sun" | ct_state_translated("en") }}
Translated ru: {{ "sun.sun" | ct_state_translated("ru") }}
but this does not:
Translated en: {{ ct_state_translated("sun.sun", "en") }}
Translated ru: {{ ct_state_translated("sun.sun", "ru") }}
Same for ct_translated:
Same for ct_state_attr_translated:
Also ct_all_translations - does not work:
For ct_eval - none of variants works:
Now the interesting part.
All this things work in Markdown:
**ct_state_translated**
State: {{ states("sun.sun") }}
Translated en: {{ ct_state_translated("sun.sun", "en") }}
Translated en: {{ "sun.sun" | ct_state_translated("en") }}
Translated ru: {{ ct_state_translated("sun.sun", "ru") }}
Translated ru: {{ "sun.sun" | ct_state_translated("ru") }}
**ct_state_attr_translated**
Attribute: {{ state_attr("automation.test", "mode") }}
Translated en: {{ ct_state_attr_translated("automation.test", "mode", "en") }}
Translated en: {{ "automation.test" | ct_state_attr_translated("mode", "en") }}
Translated ru: {{ ct_state_attr_translated("automation.test", "mode", "ru") }}
Translated u: {{ "automation.test" | ct_state_attr_translated("mode", "ru") }}
**ct_translated**
Translated en: {{ ct_translated("component.sun.entity_component._.state.below_horizon", "en") }}
Translated en: {{ "component.sun.entity_component._.state.below_horizon" | ct_translated("en") }}
Translated ru: {{ ct_translated("component.sun.entity_component._.state.below_horizon", "ru") }}
Translated ru: {{ "component.sun.entity_component._.state.below_horizon" | ct_translated("ru") }}
**ct_eval**
{% set template_text = "{{ states('sun.sun') }}" -%}
{{ ct_eval(template_text) }}
{{ template_text | ct_eval }}
I did not put a code with ct_all_translations - output is too large.
So, the plugin partly does not work in Dev tools → Template, but seems to work in Markdown.