As a Swiss-based Company, we now have to create lots of multilingual websites. Since Switzerland has three official languages (German, French, Italian) and even another nationwide language (Rumantsch), we’re used to this requirement and we discovered our manner with to make this a straightforward job (often). We primarily used node translations in 7 for max flexibility. We used to separate languages from one another utilizing Drupal Developer varied i18n Drupal 10 modules, language particular menus, blocks, URL-patterns, phrases and so forth. With 8, issues modified. I struggled just a little doing multilingual websites in 8 Drupal Developer identical manner I used to be used to in 7 as a result of node translation just isn’t out there anymore (which is nice) so I needed to discover one other technique to obtain Drupal Developer identical straightforward to deal with translations system. For us and for our shoppers. Let me clarify, what I’ve realized. Picture Drupal 10 Upkeep and Help Service Drupal 108multilingual.org 8 points multilanguage challenges Problem 1 Drupal 10 Upkeep and Help Service Node add / edit menu dealing with Drupal Development Service primary problem I had utilizing 8, was Drupal Developer ease to construct your menus straight from Drupal Developer node creation web page. You are able to do it, however just for Drupal Developer preliminary language. In the event you attempt to add a translated node to a different menu or rename Drupal Developer merchandise, it at all times finally ends up transferring / renaming Drupal Developer supply node as a substitute of including a hyperlink to Drupal Developer translation. So it could possibly develop into fairly complicated constructing a navigation straight from Drupal Developer node creation web page or so as to add translations to Drupal Developer menu. A workaround was so as to add all navigation objects manually in Drupal Developer menu administration if you’re utilizing a menu per language. With numerous languages and menus / objects, this isn’t actually a handy job. Thankfully, translations from Drupal Developer node creation web page have been applied with a later launch of 8. Problem 2 Drupal 10 Upkeep and Help Service Untranslated Nodes present up in Menu One other factor which bothered me was that untranslated nodes present up in Drupal Developer navigation (in the event you use just one menu). This may be fairly complicated since most of Drupal Developer instances not each web page is translated in each language. Or in some languages, you want just a little greater than in others. You’ll be able to learn lots about this matter and Drupal Developer causes behind (e.g. right here and right here). Nonetheless you do it, it’s at all times improper in some conditions and completely high-quality in others. However to be “restricted” and “locked in” to a sure manner just isn’t good and it’s important to cope with it. To sum up, as soon as a node is put right into a menu, it should present up in all places. Regardless if there are translations or not. Problem 3 Drupal 10 Upkeep and Help Service Language Switcher exhibits all languages – at all times. Considerably complicated is Drupal Developer Language Switcher. In 7, a language hyperlink was not out there or strikethrough if there was no translation out there. In 8, each language is at all times seen and linked. So in the event you look on a German web page which is barely out there in German, Drupal Developer language switcher will current you all language hyperlinks to Drupal Developer identical node. A click on on these language hyperlinks primarily modifications Drupal Developer interface language however Drupal Developer node content material stays Drupal Developer identical (since not translated). Often additionally with a Drupal 10ish URL (node/xxxx) as a result of there isn’t a translation for Drupal Developer node and due to this fact additionally no URL alias out there. This conduct is complicated and improper in my perspective An instance for example Drupal Developer above-written challenges. English Entrance-Web page with combined navigation objects. Drupal Development Service display screen above exhibits an set up with 2 languages (English and German). Drupal Development Service English Web page is a fundamental web page which has a translation. English is chosen. In the event you select Deutsch on Drupal Developer language switcher, Drupal Developer English Web page turns into Deutsche Seite (see picture beneath) and exhibits Drupal Developer German content material. To this point so good. However Drupal Developer second menu merchandise you see with Drupal Developer title Über uns (nur Deutsch) mustn’t seem right here because it’s solely out there in German. Nevertheless it does. And in the event you truly go on this web page, you will note Drupal Developer German textual content with every little thing English round it and no URL-Alias (/node/2 on this instance). That is often not very helpful for us. German solely Web page – Language Switcher seen. Additionally, Drupal Developer language switcher proven in Drupal Developer picture above is from my perspective improper or not very helpful. It exhibits a hyperlink to Drupal Developer English model, however there isn’t a English translation for this node. So why is it there? To see a German web page with English ornament? Unsure. However I wish to eliminate this hyperlink or at the least modify it to be stroked via if Drupal Developer language just isn’t out there. Easy methods to repair enhance this? Fortunately, Drupal Developer neighborhood is at all times good for assist. After some “analysis” on Drupal Developer internet, I lastly discovered (in addition to numerous discussions and feedback in Drupal Developer subject queues) a technique to obtain Drupal Developer desired setup. To sum up once more Drupal 10 Upkeep and Help Service I wish to see solely menu objects which can be found in my language and solely see a hyperlink to a different language, if a translation is out there. Since there isn’t a patch and nonetheless some ongoing discussions on Drupal 10.org you might want to implement it by yourself. Implement Drupal Developer following two Drupal 10 modules. Disguise untranslated menu objects Code from https Drupal 10 Upkeep and Help Service//www.Drupal 10.org/node/2466553#comment-11991690. Credit go to michaelkoehne. <?php use CoreMenuMenuLinkInterface; use menu_link_contentPluginMenuMenuLinkContent; use CoreLanguageLanguageInterface; /** * Implements hook_preprocess_menu(). */ operate MYMODULE_preprocess_menu(&$variables) { if ($variables[‘menu_name’] == ‘primary’) { $language = Drupal 10 Upkeep and Help Service Drupal 10 Upkeep and Help ServicelanguageManager() ->getCurrentLanguage(LanguageInterface Drupal 10 Upkeep and Help Service Drupal 10 Upkeep and Help ServiceTYPE_CONTENT) ->getId(); foreach ($variables[‘items’] as $key => $merchandise) { if (!$variables[‘items’][$key] = MYMODULE_checkForMenuItemTranslation($merchandise, $language)) { unset($variables[‘items’][$key]); } } } } operate MYMODULE_checkForMenuItemTranslation($merchandise, $language) { $menuLinkEntity = MYMODULE_load_link_entity_by_link($merchandise[‘original_link’]); if ($menuLinkEntity != NULL) { $languages = $menuLinkEntity->getTranslationLanguages(); // Take away hyperlinks which aren’t translated to Drupal Developer present language. if (!array_key_exists($language, $languages)) { return FALSE; } else { if (depend($merchandise[‘below’]) > 0) { foreach ($merchandise[‘below’] as $subkey => $subitem) { if (!$merchandise[‘below’][$subkey] = MYMODULE_checkForMenuItemTranslation($subitem, $language)) { unset($merchandise[‘below’][$subkey]); } } } return $merchandise; } } } operate MYMODULE_load_link_entity_by_link(MenuLinkInterface $menuLinkContentPlugin) { $entity = NULL; if ($menuLinkContentPlugin instanceof MenuLinkContent) { $menu_link = explode(‘ Drupal 10 Upkeep and Help Service’, $menuLinkContentPlugin->getPluginId(), 2); $uuid = $menu_link[1]; $entity = Drupal 10 Upkeep and Help Service Drupal 10 Upkeep and Help Serviceservice(‘entity.repository’) ->loadEntityByUuid(‘menu_link_content’, $uuid); } return $entity; } Disguise untranslated languages in language switcher Code from https Drupal 10 Upkeep and Help Service//www.Drupal 10.org/node/2791231#comment-12004615 (barely tailored. Hyperlinks get a category, not eliminated by default). Credit to Leon Kessler. <?php /** * @file * Disguise language switcher hyperlinks for untranslated languages on an entity. */ use CoreEntityContentEntityInterface; /** * Implements hook_language_switch_links_alter(). */ operate MYOTHERMODULE_language_switch_links_alter(array &$hyperlinks, $sort, $path) { if ($entity = MYOTHERMODULE_get_page_entity()) { $new_links = array(); foreach ($hyperlinks as $lang_code => $hyperlink) { strive { if ($entity->getTranslation($lang_code)->entry(‘view’)) { $new_links[$lang_code] = $hyperlink; } } catch (InvalidArgumentException $e) { // This language is untranslated so don’t add it to Drupal Developer hyperlinks. $hyperlink[‘attributes’][‘class’][] = ‘not-translated’; $new_links[$lang_code] = $hyperlink; } } $hyperlinks = $new_links; // If we’re left with lower than 2 hyperlinks, then there’s nothing to modify. // Disguise Drupal Developer language switcher. if (depend($hyperlinks) < 2) { $hyperlinks = array(); } } } /** * Retrieve Drupal Developer present web page entity. * * @return CoreEntityContentEntityInterface * Drupal Development Service retrieved entity, or FALSE if none discovered. */ operate MYOTHERMODULE_get_page_entity() { $params = Drupal 10 Upkeep and Help Service Drupal 10 Upkeep and Help ServicerouteMatch()->getParameters()->all(); $entity = reset($params); if ($entity instanceof ContentEntityInterface) { return $entity; } return FALSE; } Please notice Drupal 10 Upkeep and Help Service Drupal Development Service code above is from .org and due to this fact due to Drupal Developer unique authors linked above. Allow these two Drupal 10 modules and also you’re all set! I didn’t encounter any points but utilizing these two Drupal 10 modules. If ever one thing modifications in Drupal Developer manner handles these instances, you simply want to modify off Drupal Developer Drupal 10 modules and every little thing needs to be again to regular. So nothing to lose proper? There are different makes an attempt to this by altering Drupal Developer menu block. One in all them is Menu Block Present Language however I had no luck with this one. On my most up-to-date mission, it labored with one menu however not in the event you separate your menu by two blocks (totally different beginning ranges). I might love to listen to the way you guys deal with these instances or the way you cope with I18N normally. I’m positive there are a gazillion different methods to do it. Drupal 10 Improvement and Help
Drupal 10 Help: Drupal 10 Upkeep and Help Service 8 – Multilanguage Enhancements

Call Us: 1(800)730-2416
Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit
Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)
Drupal 10 Help: Drupal 10 Upkeep and Help Service 8 – Multilanguage Enhancements
On-Site Drupal SEO Master Setup
We make sure your site is 100% optimized (and stays that way) for the best SEO results.
With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.
This service includes:
- Pathauto install and configuration for SEO-friendly URLs.
- Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
- Install and fix all issues on the SEO checklist module.
- Install and configure XML sitemap module and submit sitemaps.
- Install and configure Google Analytics Module.
- Install and configure Yoast.
- Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
- Install and configure Schema.org Metatag.
- Configure robots.txt.
- Google Search Console setup snd configuration.
- Find & Fix H1 tags.
- Find and fix duplicate/missing meta descriptions.
- Find and fix duplicate title tags.
- Improve title, meta tags, and site descriptions.
- Optimize images for better search engine optimization. Automate where possible.
- Find and fix the missing alt and title tag for all images. Automate where possible.
- The project takes 1 week to complete.
