#How to set language-specific conversation response in the `intent_script` WITHOUT using template?

1 messages · Page 1 of 1 (latest)

olive jetty
#

Note that this question is for Voice Assist conversation intent_script, and NOT for automations using trigger: conversation syntax.

How do I set a language-specific conversation response in the intent_script WITHOUT using a template-based language check in the intent_script?

I want to keep the language-agnostic logic / scripting in it's own file (see Figure 1).
I want to keep the language-specific intents (e.g. custom sentences) in their own file (see Figure 2).
I want to keep the language-specific responses in their own file (see Figure 3).
Using HA 2025.9.4 environment.

I want to avoid having to code something like this in the intent_script (see Figure 1):

      set_conversation_response: >
        {% if hass.config.language == 'es' %}
          Espanol respuesta
        {% else %}
          English response
        {% endif %}
#

configuration.yaml Intent Script Loading

intent_script: !include_dir_merge_named myconfigs/intent_scripts/

File System structure is:

<config>/
  custom_sentences/
    en/
      test_function1_intents_en.yaml
      test_function1_responses_en.yaml
    es/
      test_function1_intents_es.yaml
      test_function1_responses_es.yaml
  myconfigs/
    intent_scripts/
      test_function1_script.yaml