I want to switch language in my Drupal 8. My language detection is URL. But I don't want users to be able to override the language switch by typing in the address bar.

For example www.mysite.com/ (default English) and when I type www.mysite.com/ja (Japanese) and then it switches to Japanese. But I want only to switch language by clicking the language switcher. What would be a starting point to implement this?

  • 1
    You'd need to Ajaxify your complete site. Or just decouple it from the very beginning. Use Drupal as API and some JS framework (React, vuejs, etc.) as your front-end. – leymannx Aug 22 at 6:28
  • I dont know with my boss , he just want to switch only by click the link, – renier john Sediego Aug 22 at 7:39
  • i think its hard to de couple ,specially im working with CMS – renier john Sediego Aug 22 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.