Translate Inbuilt slider for homepage

Created on 13 March 2024, 8 months ago
Updated 14 March 2024, 8 months ago

Problem/Motivation

I would like to use this theme in a multilingual site. Is there a way to translate the Inbuilt slider for homepage?

I tryed updating the template-parts/slider.html.twig file using this

{% trans %}{{ slider_code | striptags('<ol>,<ul>,<li>,<p>,<a>,<img>,<video>,<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<em>,<strong>,<br>,<i>,<button>,<mark>,<hr>') | raw }}{% endtrans %}

or this

{{ slider_code | striptags('<ol>,<ul>,<li>,<p>,<a>,<img>,<video>,<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<em>,<strong>,<br>,<i>,<button>,<mark>,<hr>') | t | raw }}

then I ran Drupal's translation synchronization process but the slider_code does not appear in the "User interface translation" .

Thanks in advance

💬 Support request
Status

Active

Version

10.0

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ikaros123
  • Ok after some trying I was able to do it using the "t" tag on the twig template and I also modyfied the theme-settings.php.

    $form['slider']['slider_code'] = [
        '#type'          => 'textarea',
        '#title'         => t('Slider Code'),
        '#default_value' => t(theme_get_setting('slider_code')),
        '#description'   => t('Please refer to this <a href="https://drupar.com/node/912/" target="_blank">documentation page</a> for slider code tutorial.'),
      ];

    Now the slider_code appears in the "User interface translation" .

Production build 0.71.5 2024