New answers tagged

0

I wrote this little script that replaces all langcode fields with a new language code across all tables in your Drupal 9 (and possibly 8) installation. Place it in your Drupal root Change the $newlang and $oldlang variables. Optionally add more conditions Execute it: php myscript.php Be aware that this does not do any checking or confirmations so be sure ...


0

The Allowed Languages module makes it possible to set restrictions on which content a user can edit based on language. https://www.drupal.org/project/allowed_languages Once installed against each user profile you can check which languages the user can edit as shown below.


0

Requiring t() to translate the string in a specific language is perfectly fine. The function will return a translation, if the Locale module is installed and enabled, and that string is present in the site; it doesn't use a remote service to translate the string passed as first argument. Present in the site means: The translation has been added using the ...


0

Unchecking all "Hide non translatable fields on translation forms"-boxes in Content language-configuration page solved the problem.


1

This question have already been answered correctly, but if you need to translate a string with variables, here's how you do it. {{ 'Subscribe to @title'|t({'@title': title}) }}


0

To those like @liquidcms wondering how to do a multilingual path : you can make as many routes as languages, to the same controller. custom.route.lang_one: path: '/path/in/this/language' defaults: _controller: '\Drupal\my_module\Controller\MyController::method' requirements: _permission: 'access content' custom.route.lang_two: path: '/path/...


Top 50 recent answers are included