Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

New answers tagged

1 vote

How does importing a contrib module's translations work?

After much debugging I solved this issue by comparing Drupal's behavior with a completely fresh installation. Of course "drush locale-update" is supposed to get translations for contrib ...
user avatar
0 votes
Accepted

using 2 language switchers in the same node

Drupal supports having one language for the content (controlled by a language switcher block) and a separate language for the site UI. You can set this up like this: Add a language switcher block for ...
user avatar
1 vote

Language-dependent logo

A better answer for the above would be to actually use the language code already provided ( Drupal > 8.2 ) in Twig: Drupal 8.2-8.7.5: <img src="{{ base_path ~ directory }}/logos/logo-{{ ...
user avatar
0 votes

Set a <front> page for different languages?

If you want to allow user input, it's not an easy task. I would do the following: Create a custom form (not a configuration form), using the Form API, that allows the user to input the path to the ...
user avatar
  • 14.5k
1 vote

Translate untranslated strings

Here is a custom function I use in update hooks, to translate some missing translations, just in case you want to do this programmatically: function translateString($source_string, $translated_string, ...
user avatar

Top 50 recent answers are included