9

I'm able to translate views titles and menus thanks to config_translation core module. I would like to have path aliases translated as well but it seems to lack this feature. Any other way to do it?

5 Answers 5

12

On my multilingual Drupal 8 sites, I go to /admin/config/search/path/add for adding URL alias, which asks you to select a language for this alias.

Is this what you were looking for?

5
  • I was thinking about a configuration kind of solution, aliases are content that I need to reinsert on every site change
    – Angus
    Nov 12, 2016 at 10:25
  • 3
    The path that you enter isn't an alias, it is the actual route path, those can not be translated. You need to create aliases in different languages, that's the only way. You could "deploy" it with hook_install and update functions.
    – Berdir
    Nov 12, 2016 at 11:21
  • If you are using path prefix for languages, e.g. you want to use /de/ansicht for the english /view, don't add /de to the path when creating a new alias, even though it's the path you want. You just add /ansicht.
    – Tim
    Sep 24, 2017 at 7:02
  • Does the path-alias work with contextual filters? For me it's not working, instead I get a 404 error.
    – LarS
    Apr 25, 2021 at 17:59
  • See [How do I translate view's page path alias that has a dynamic path? ](drupal.stackexchange.com/questions/260158/…)
    – LarS
    Apr 25, 2021 at 18:13
2

I was looking exactly for that and finally I contrib with the fixed path alias module, just create the alias for the views page as mentioned before and set it as fixed to be exported into config. The alias will be re-created on the fly when required if not found.

1
  • This should be considered also as a valid answer since adds the capability to export aliases which is a requirement by the OP
    – d70rr3s
    Dec 11, 2019 at 12:43
1

You can manage your translated aliases with the Pathauto module, which will automatically create a translated URL Alias from the translated node Title. The URL alias will be constructed from a pre-configured Pathauto "Pattern" and will be automatically managed and updated.

2
  • 1
    While this works for a lot of content, I do not believe this works for Views paths.
    – firfin
    Feb 29, 2020 at 14:30
  • Please try drupal.org/project/tvp and see if it helps. I have built this module for similar use case. Apr 4, 2022 at 5:30
1

I had same issue and I have done this way:

first create view page with alias, for example "alias-test" view page alias

then go to admin/config/search/path and click "add alias"

choose language you want to translate, in my case I choose "PT"

on "existing system path" write your path "alias-test" and in "path alias" added alias translation "teste-alias" path translation

This works with language swticher, if you have more than 2 languages you have to repeat this process to all languages you want to translate

3
1

Please try https://www.drupal.org/project/tvp and see if it helps. I have built this module for similar use case.

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Apr 4, 2022 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.