0

What is the best way to translate the title in search template file

I use a commercial theme. In :

page--search.html.twig

I can modify the tytle by replacing :

 <h1>{{ title }}</h1>

by

<h1>Recherche</h1>

It works but it is obviously not the best way.

Since search result page is not a node, where is this title ?

I’ve searched in blocks, content, module and I can't find this title.

  • Have you turned on translation and installed the French language? – Alfred Armstrong May 17 '17 at 11:01
  • @AlfredArmstrong No, i didn’t. It might be the solution ? – Sébastien Gicquel May 17 '17 at 11:56
  • @AlfredArmstrong Activate the language module and add a second language was the solution. I will vote for you if you post an answer. – Sébastien Gicquel May 17 '17 at 12:31
1

Drupal 8 has extensive multi-lingual support and French is one of the supported languages.

As administrator, turn on the language module at Administration -> Extend

Then go to Administration -> Configuration -> Regional and Language -> Languages, click on Add Language and select French. If you want it to be the default language set it as the default and Save Configuration. (This can cause issues if the site is already live!)

The User Interface Translation module (also in core) can be used to import additional translations and to allow you to translate strings manually as needed.

|improve this answer|||||

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.