2

I add a simple text as view header but it is not exists in translatable text in admin/config/regional/translate.

In Drupal 7 we could even translate unformulated views header and footer with the following steps:

  1. Go to admin/config/regional/i18n/strings
  2. Check "full HTML" in "Translatable text formats" section
  3. Go to admin/config/regional/translate/i18n_string
  4. Click on Refresh strings

Has this feature been removed form Drupal 8? (I don't think so.)
How can I translate view header and footer simple text?

3
2
  1. Enable "Configuration Translation" core module
  2. Go to your view edit and you will see a "Translate view" tab
  3. You'll find your language in the list there. Then click on "Edit" next to the language
  4. Expand panels and you will find your header text under the "Header" panel
1
  • 1
    5 years ago( when I asked the question) this option wasn't there ;). thank you for your answer. could be helpful for other guys. – Yuseferi Jan 6 at 14:12
1

If my previous answer doesn't work fine. Try with this solution.

  1. In view add new field "Custom text" (Click checkbox Exclude from display)
  2. In "Custom text" add code like this
    <div class="custom-title-and-subtitle">
    <h2>{% trans %}Contact us{% endtrans %}</h2>
    <p>{% trans %}Please contact us for UFME Inquiries only. For vocations and prayer requests, contact the Franciscans in your area.{% endtrans %}</p>
    </div>
  1. In view header add "Unfiltered text" field
  2. Click checkbox "Use replacement tokens from the first row"
  3. Add REPLACEMENT PATTERNS in my case {{ nothing }}
  4. Clear cache And after that you will be able find text in user interface translation "admin/config/regional/translate"

enter image description here

0

You need to use configuration for your language. Example enter image description here

-1

You can easy translate view header and footer text using the {% trans %} Twig tag in Drupal 8 Example:

{% trans %}
  Text for translate
{% endtrans %}

And after that you will be able find text in user interface translation "admin/config/regional/translate"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.