Development News
Promet Source: No "Small" Drupal Support Contracts
Specbee: How to make a Multilingual Website using Drupal 9
It’s a fact. You can’t go global without localized focus. Yeah, that sounds like a paradox, but it makes sense from a user perspective. Many organizations are reaping the benefits of multilingual web experiences to connect with their customers across the world. And it’s almost a requirement these days. Not only do Multilingual websites enable you to reach new target audiences more effectively, but it adds credibility to your brand, offers familiarity to visitors and makes users more likely to turn into customers.
In a recent research conducted on a list of top 150 global brands across industries, Wikipedia, Google, Nestlé, Airbnb and Adobe emerged as the top 5 brands that scored the best in terms of multilingual support, localization and global user experience. If you’re looking at localizing your brand as you go global, Drupal is a great CMS to opt for because of its fantastic support for multilingual websites. In this article we will describe how Drupal 9's multilingual feature works and how content editors or content teams can utilize the feature.
Multilingual Support ModulesAs I mentioned previously, Drupal 9 makes it really easy to build multilingual sites. It offers 4 multilingual support modules that are already built in core. All you have to do is enable them. In your administrator view, go to Extend, select the 4 modules under Multilingual and click on Install.
- Configuration Translation Module - This one is not visible for the end users but especially useful for site builders. It translates configuration text like views names,
- Content Translation Module - Allows to translate content entities and types like blocks, comments, taxonomy terms, custom menu links, and more.
- Interface Translation Module - Helps translate user interface elements such as Home, Forms, Title, Body, Description, etc.
- Language Module - The real magic happens here. Here’s where you can choose from a whole range of languages (>100) and add it to your configuration.
You can then further configure these modules to have them enabled for all or for only a selected set of content types, entities, configurations or interface elements.
For more details on each of these modules, make sure you read this article.
Implementing the Multilingual FeatureOnce you have enabled these 4 modules, let’s dive right into configuring them.
Step 1: Add a Language (or multiple languages)In your Drupal 9 admin interface, navigate to Configuration -> Regional and language -> Languages. Once you’re on the Languages page, click on the + Add language button
I’ve chosen Spanish as my language and added it to the list of languages.
Once added, you can select it as your default language or have English as the default.
Adding a Language
Step 2: Update TranslationsNow click on the right part of the Edit button and you will get two options as a dropdown - Delete and Translate. When you select Translate, your Drupal site gets updated with all the interface and configuration translations for that language from localize.drupal.org. Here thousands of Drupal contributors help translate interface and configuration strings in regional languages.
Importing translations
Step 3: Language switcherYou can add a language switcher block to any region of your page so the user can switch between their preferred languages.
Adding a Language Switcher block
Step 4: Adding translations to content types and entitiesYou can have translations for all your content types and entities or you can select the ones as per your requirement.
For this, on your Admin screen go to Configuration -> Regional and language -> Content language and translation
I have selected custom language settings for Content, Redirect and URL alias. Under Content, I’m going to only have translations for my “Ad Page” content type (as shown below). All my fields under “Ad Page” content type are selected to be translated.
Now we’re all set to add translated content to the required content types.
Translating the ContentNow that you know how to enable and configure the multilingual modules in Drupal 9, let’s move on to learning how to actually translate the content. Let’s look at a super simple, 3 step process on how content teams can leverage this functionality to add their translated content. If you want to read about migrating multilingual content from CSV to Drupal, check out this article.
Step 1: Create a new page or Edit an existing oneSince I had opted to have translations for all my Ad page content types, I have created a test page under this content type. Now you will see that along with the usual View, Edit, Delete and Revisions tabs, I also have a new Translate tab.
Step 2: Select the LanguageOn clicking the Translate tab, you will be able to see all your languages listed (see below). Observe that the Spanish language that we added does not have a translation yet. Now click on Add to create a Spanish translation page.
Step 3: Add translated content to the respective fieldNotice how all your fields and elements of your admin interface have translated themselves to Spanish (see below). All you have to do is add your translated content as per requirement!
Step 4: Save and Review!We’re almost there! After adding in all your translated content, don’t forget to Guardar your translation! :)
And here’s what your Multilingual web page will now look like.
Spanish Version
You will notice the URL generated for the translated version (here Spanish) will contain a language prefix (here: es).
English Version
One of our recent Multilingual projects on Drupal 9 was for SEMI. SEMI is a global industry association that connects more than 1.3 million professionals and 2500 members worldwide through its programs, initiatives, market research and advocacy. SEMI members are responsible for innovation and advancements in electronics manufacturing and design supply chain. With 8 regional offices located around the world, having a multilingual setup was imperative for them to enable focus and customization. Read more about how we helped them build a cohesive multisite, multi language experience with Drupal 9.
https://www.semi.org/region-selector
Final ThoughtsDid you see how easy it was to build a multilingual website in Drupal 9? If you’re looking for Drupal development assistance in creating your next multi language website so you can reach a bigger target audience, feel free to talk to us.
Author: Shefali Shetty
Meet Shefali Shetty, Director of Marketing at Specbee. An enthusiast for Drupal, she enjoys exploring and writing about the powerhouse. While not working or actively contributing back to the Drupal project, you can find her watching YouTube videos trying to learn to play the Ukulele :)
Drupal 9 Drupal Development Drupal Planet Subscribe to our Newsletter Now Subscribe Leave this field blankLeave us a Comment
Recent Blogs Image How to make a Multilingual Website using Drupal 9 Image Creating custom design systems with Tailwind CSS and implementing it in Drupal Image Build marketing landing pages quickly and easily with Drupal 9 Want to extract the maximum out of Drupal? TALK TO US Featured Success StoriesUpgrading and consolidating multiple web properties to offer a coherent digital experience for Physicians Insurance
Upgrading the web presence of IEEE Information Theory Society, the most trusted voice for advanced technology
Great Southern Homes, one of the fastest growing home builders in the United States, sees greater results with Drupal 9
View all Case StudiesSpecbee: How to make a Multilingual Website using Drupal 9
It’s a fact. You can’t go global without localized focus. Yeah, that sounds like a paradox, but it makes sense from a user perspective. Many organizations are reaping the benefits of multilingual web experiences to connect with their customers across the world. And it’s almost a requirement these days. Not only do Multilingual websites enable you to reach new target audiences more effectively, but it adds credibility to your brand, offers familiarity to visitors and makes users more likely to turn into customers.
In a recent research conducted on a list of top 150 global brands across industries, Wikipedia, Google, Nestlé, Airbnb and Adobe emerged as the top 5 brands that scored the best in terms of multilingual support, localization and global user experience. If you’re looking at localizing your brand as you go global, Drupal is a great CMS to opt for because of its fantastic support for multilingual websites. In this article we will describe how Drupal 9's multilingual feature works and how content editors or content teams can utilize the feature.
Multilingual Support ModulesAs I mentioned previously, Drupal 9 makes it really easy to build multilingual sites. It offers 4 multilingual support modules that are already built in core. All you have to do is enable them. In your administrator view, go to Extend, select the 4 modules under Multilingual and click on Install.
- Configuration Translation Module - This one is not visible for the end users but especially useful for site builders. It translates configuration text like views names,
- Content Translation Module - Allows to translate content entities and types like blocks, comments, taxonomy terms, custom menu links, and more.
- Interface Translation Module - Helps translate user interface elements such as Home, Forms, Title, Body, Description, etc.
- Language Module - The real magic happens here. Here’s where you can choose from a whole range of languages (>100) and add it to your configuration.
You can then further configure these modules to have them enabled for all or for only a selected set of content types, entities, configurations or interface elements.
For more details on each of these modules, make sure you read this article.
Implementing the Multilingual FeatureOnce you have enabled these 4 modules, let’s dive right into configuring them.
Step 1: Add a Language (or multiple languages)In your Drupal 9 admin interface, navigate to Configuration -> Regional and language -> Languages. Once you’re on the Languages page, click on the + Add language button
I’ve chosen Spanish as my language and added it to the list of languages.
Once added, you can select it as your default language or have English as the default.
Adding a Language
Step 2: Update TranslationsNow click on the right part of the Edit button and you will get two options as a dropdown - Delete and Translate. When you select Translate, your Drupal site gets updated with all the interface and configuration translations for that language from localize.drupal.org. Here thousands of Drupal contributors help translate interface and configuration strings in regional languages.
Importing translations
Step 3: Language switcherYou can add a language switcher block to any region of your page so the user can switch between their preferred languages.
Adding a Language Switcher block
Step 4: Adding translations to content types and entitiesYou can have translations for all your content types and entities or you can select the ones as per your requirement.
For this, on your Admin screen go to Configuration -> Regional and language -> Content language and translation
I have selected custom language settings for Content, Redirect and URL alias. Under Content, I’m going to only have translations for my “Ad Page” content type (as shown below). All my fields under “Ad Page” content type are selected to be translated.
Now we’re all set to add translated content to the required content types.
Translating the ContentNow that you know how to enable and configure the multilingual modules in Drupal 9, let’s move on to learning how to actually translate the content. Let’s look at a super simple, 3 step process on how content teams can leverage this functionality to add their translated content. If you want to read about migrating multilingual content from CSV to Drupal, check out this article.
Step 1: Create a new page or Edit an existing oneSince I had opted to have translations for all my Ad page content types, I have created a test page under this content type. Now you will see that along with the usual View, Edit, Delete and Revisions tabs, I also have a new Translate tab.
Step 2: Select the LanguageOn clicking the Translate tab, you will be able to see all your languages listed (see below). Observe that the Spanish language that we added does not have a translation yet. Now click on Add to create a Spanish translation page.
Step 3: Add translated content to the respective fieldNotice how all your fields and elements of your admin interface have translated themselves to Spanish (see below). All you have to do is add your translated content as per requirement!
Step 4: Save and Review!We’re almost there! After adding in all your translated content, don’t forget to Guardar your translation! :)
And here’s what your Multilingual web page will now look like.
Spanish Version
You will notice the URL generated for the translated version (here Spanish) will contain a language prefix (here: es).
English Version
One of our recent Multilingual projects on Drupal 9 was for SEMI. SEMI is a global industry association that connects more than 1.3 million professionals and 2500 members worldwide through its programs, initiatives, market research and advocacy. SEMI members are responsible for innovation and advancements in electronics manufacturing and design supply chain. With 8 regional offices located around the world, having a multilingual setup was imperative for them to enable focus and customization. Read more about how we helped them build a cohesive multisite, multi language experience with Drupal 9.
https://www.semi.org/region-selector
Final ThoughtsDid you see how easy it was to build a multilingual website in Drupal 9? If you’re looking for Drupal development assistance in creating your next multi language website so you can reach a bigger target audience, feel free to talk to us.
Author: Shefali Shetty
Meet Shefali Shetty, Director of Marketing at Specbee. An enthusiast for Drupal, she enjoys exploring and writing about the powerhouse. While not working or actively contributing back to the Drupal project, you can find her watching YouTube videos trying to learn to play the Ukulele :)
Drupal 9 Drupal Development Drupal Planet Subscribe to our Newsletter Now Subscribe Leave this field blankLeave us a Comment
Recent Blogs Image How to make a Multilingual Website using Drupal 9 Image Creating custom design systems with Tailwind CSS and implementing it in Drupal Image Build marketing landing pages quickly and easily with Drupal 9 Want to extract the maximum out of Drupal? TALK TO US Featured Success StoriesUpgrading and consolidating multiple web properties to offer a coherent digital experience for Physicians Insurance
Upgrading the web presence of IEEE Information Theory Society, the most trusted voice for advanced technology
Great Southern Homes, one of the fastest growing home builders in the United States, sees greater results with Drupal 9
View all Case StudiesThe Drop Times: Top Drupal 9 Books to Read
The Drop Times: Top Drupal 9 Books to Read
Security public service announcements: Updated security policy for Drupal core Composer dependencies - PSA-2022-06-20
The drupal/core-recommended metapackage now allows patch-level updates for Composer dependencies. This means that site owners using drupal/core-recommended can now install most Composer dependency security updates themselves, without needing to wait for an upstream release of Drupal core that updates the affected package.
For example, in the future, a Guzzle vendor update like the recent Guzzle security release can be installed by running:
composer update guzzlehttp/guzzleThe change record on drupal/core-recommended and patch-level updates has more detailed information on how this change affects site dependency management.
Drupal security advisories and same-day releases for vendor updates will only be issued if Drupal core is known to be exploitableIt is the Drupal Security Team's policy to create new core releases and issue security advisories for third-party vendor libraries only if an exploit is possible in Drupal core. However, both the earlier version of the drupal/core-recommended metapackage and Drupal.org file archive downloads restrict sites to the exact Composer dependency versions used in Drupal core. Therefore, in practice, we have issued numerous security advisories (or same-day releases without security advisories) where only contributed or custom code might be vulnerable.
For Drupal 9.4.0 and higher, the Security Team plans to no longer issue these "just-in-case" security advisories for Composer dependency security updates. Instead, the dependency updates will be handled as public security hardenings, and will be included alongside other bugfixes in normal Drupal core patch releases. These security hardenings may be released within a few days as off-schedule bugfix releases if contributed projects are known to be vulnerable, or on the next scheduled monthly bugfix window for uncommon or theoretical vulnerabilities. (Keep in mind that Drupal core often already mitigates vulnerabilities present in its dependencies, so automated security scanners sometimes raise false positives when an upstream CVE is announced.)
Site owners are responsible for monitoring security announcements for third-party dependencies as well as for Drupal projects, and for installing dependency security updates when necessary.
Sites built using .tar.gz or .zip file downloads should convert to drupal/core-recommended for same-day dependency updatesDrupal 9.4 sites built with tarball or zip file archives will no longer receive the same level of security support for core dependencies. Going forward, if core is not known to be exploitable, the core file downloads' dependencies will be updated in normal bugfix releases within a few days (if contributed projects are known to be vulnerable) to a few weeks (if the vulnerability is uncommon or theoretical).
Sites built with tarball or zip files should convert to using drupal/core-recommended to apply security updates more promptly than the above timeframe.
Drupal 9.3 will receive prompt, best-effort updates until its end of lifeDrupal 9.3 receives security coverage until the release of Drupal 9.5.0 in December 2022, and will not include the above improvement to drupal/core-recommended. Therefore, we will still try to provide prompt releases of Drupal 9.3 for vendor security updates when it is possible for us to do so.
Since normal bugfixes are no longer backported to Drupal 9.3, there will already be few to no other changes between its future releases, so dependency updates may be released as normal bugfix releases (rather than security-only releases). Security advisories for Drupal 9.3 vendor updates may still be issued depending on the nature of the vulnerability.
Drupal 7 is not affected by this change and Drupal 7 core file downloads remain fully covered by the Drupal Security TeamDrupal 7 core includes only limited use of third-party dependencies (in particular, the jQuery and jQuery UI JavaScript packages). Therefore, Drupal 7 is not affected by this policy change. Note that Drupal 7 sites that use third-party libraries with Drupal 7 contributed modules must still monitor and apply updates for those third-party libraries.
For press contacts, please email security-press@drupal.org.
Talking Drupal: Talking Drupal #352 - D7 to D9 Migration
Today we are talking about D7 to D9 Migration with Mauricio Dinarte.
Topics- Why are you passionate about migration
- First thing to think about when migrating
- Timeline
- Factors
- Tips and tricks
- Helpful tools and migrations
- Tricky things to migrate
- Data structure inconsistencies
- Embedded media
- Data management
- Source sets
- CSV
- Json
- DB connection
- Understanddrupal.com
- Who is the audience
- Any new content
- Demo of Event Platform
- Understand Drupal
- Modules - spreadsheet of content model
- Media migration module
- Migrate project category
- Migrate ecosystem
- 31 Days of Migration
- Miller
- 0 to 20 Years
Mauricio Dinarte - understanddrupal.com - @dinarcon
HostsNic Laflin - www.nLighteneddevelopment.com @nicxvan John Picozzi - www.epam.com @johnpicozzi Donna Bungard - @dbungard
MOTWEvent Platform The Event Platform is actually a set of modules, each of which provides functionality designed to satisfy the needs of anyone creating a site for a Drupal Camp or similar event.
Talking Drupal: Talking Drupal #352 - D7 to D9 Migration
Today we are talking about D7 to D9 Migration with Mauricio Dinarte.
Topics- Why are you passionate about migration
- First thing to think about when migrating
- Timeline
- Factors
- Tips and tricks
- Helpful tools and migrations
- Tricky things to migrate
- Data structure inconsistencies
- Embedded media
- Data management
- Source sets
- CSV
- Json
- DB connection
- Understanddrupal.com
- Who is the audience
- Any new content
- Demo of Event Platform
- Understand Drupal
- Modules - spreadsheet of content model
- Media migration module
- Migrate project category
- Migrate ecosystem
- 31 Days of Migration
- Miller
- 0 to 20 Years
Mauricio Dinarte - understanddrupal.com - @dinarcon
HostsNic Laflin - www.nLighteneddevelopment.com @nicxvan John Picozzi - www.epam.com @johnpicozzi Donna Bungard - @dbungard
MOTWEvent Platform The Event Platform is actually a set of modules, each of which provides functionality designed to satisfy the needs of anyone creating a site for a Drupal Camp or similar event.
Mike Herchel's Blog: Pitfalls (and fixes) when lazy-loading images in Drupal
Mike Herchel's Blog: Pitfalls (and fixes) when lazy-loading images in Drupal
Peoples BLOG: Usage of PHPCS on Github via Pull Request for Drupal Applications
#! code: Drupal 9: Removing Base64 Encoded Files From Content
Occasionally, I have come across Drupal sites that have base64 encoded images embedded into content fields. This is the approach of taking the binary data contained in a file and converting it into a string of characters. The original binary data can then be re-created using this string and the data is understood by lots of different technologies (including web browsers).
Whilst this is technically possible, it massively balloons the size of the database and can often slow down page load times due to the database being slow to respond to the request. Instead of fetching a few kilobytes of data from the table the database is forced to fetch many megabytes of data, which can create a bottleneck for other requests.
When you download a file from the web your browser can make a decision on whether to fetch that file a second time. By injecting files into the content you are forcing your users to download very large pages every time they want to request a page. It isn't possible for the browser to make that decision any more and that can lead to more slowdown for the user.
If you can't tell, I really dislike this method of image storage. Whilst it is technically possible, it creates more problems than it solves and even sites with a couple of thousand nodes can have databases of many gigabytes in size due to this issue. It can also put unnecessary strain on the database due to the increased time taken to return data.
Let's say that when you embed an image into some copy on a Drupal site using the normal media or file embed features. You might see an image element that looks like this.
In certain situations it is possible to embed images directly into content. The image element would look something like this.
#! code: Drupal 9: Removing Base64 Encoded Files From Content
Occasionally, I have come across Drupal sites that have base64 encoded images embedded into content fields. This is the approach of taking the binary data contained in a file and converting it into a string of characters. The original binary data can then be re-created using this string and the data is understood by lots of different technologies (including web browsers).
Whilst this is technically possible, it massively balloons the size of the database and can often slow down page load times due to the database being slow to respond to the request. Instead of fetching a few kilobytes of data from the table the database is forced to fetch many megabytes of data, which can create a bottleneck for other requests.
When you download a file from the web your browser can make a decision on whether to fetch that file a second time. By injecting files into the content you are forcing your users to download very large pages every time they want to request a page. It isn't possible for the browser to make that decision any more and that can lead to more slowdown for the user.
If you can't tell, I really dislike this method of image storage. Whilst it is technically possible, it creates more problems than it solves and even sites with a couple of thousand nodes can have databases of many gigabytes in size due to this issue. It can also put unnecessary strain on the database due to the increased time taken to return data.
Let's say that when you embed an image into some copy on a Drupal site using the normal media or file embed features. You might see an image element that looks like this.
In certain situations it is possible to embed images directly into content. The image element would look something like this.
Post Status: Flooding the zone
Post Status: Today in WordCamp History
Post Status: Not Dead Yet! Just Mostly Dead?
Do The Woo Community: WooBits: WordCamp Europe Before, During and After
I had an amazing time at WordCamp Europe in Porto, Portugal. Here are some highlight around and during the event.
>> The post WooBits: WordCamp Europe Before, During and After appeared first on Do the Woo - a WooCommerce Builder Community .
Post Status: Richard Midson on WordPress and the Future of Podcasting — Post Status Draft 116
Agaric Collective: Drupal 9.4 installation with existing configuration fails because "unable to uninstall the MySQL module"!?
Here is how to deal with the surprising-to-impossible-seeming error "Unable to uninstall the MySQL module because: The module 'MySQL' is providing the database driver 'mysql'.."
Like, why is it trying to uninstall anything when you are installing? Well, it is because you are installing with existing configuration— and your configuration is out-of-date. This same problem will happen on configuration import on a Drupal website, too.
Really this error message is a strong reminder to always run database updates and then commit any resulting configuration changes after updating Drupal core or module code.
And so the solution is to roll back the code to Drupal 9.3, do your installation from configuration, and then run the database updates, export configuration, and commit the result.
For example:
git checkout composer install drush -y site:install drutopia --existing-config git checkout main composer install drush -y updb drush -y cex git commit -m "Apply configuration updates from Drupal 9.4 upgrade"The system update enable_provider_database_driver is the post-update hook that is doing the work here to "Enable the modules that are providing the listed database drivers." Pretty cool feature and a strong reminder to always, always run database updates and commit any configuration changes immediately after any code updates!