Closed (fixed)
Project:
Translation Management Tool
Version:
8.x-1.x-dev
Component:
Source: Entity
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Mar 2018 at 12:35 UTC
Updated:
30 May 2018 at 14:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
erik.johansson commentedSuper simple patch for my use case.
Comment #3
loparev commentedHi, @Erik.Johansson.
I've noticed this as well. But I think alias can be excluded from translation in another way: uncheck "URL alias" checkbox under needed content type at
/admin/config/regional/content-languagepage and it should be excluded from generated file. Do you have any issues with this approach?Comment #4
erik.johansson commentedHi @Loparev
In some special scenarios we want to translate the url alias so disabling translation for url alias wont work for us.
What we need is to simply disable the url alias from ending up in the exported file, something like was implemented for fields in this issue: https://www.drupal.org/project/tmgmt/issues/1543480
Comment #5
loparev commentedGot it.
Maybe this hook can help?
Comment #6
berdirI agree we need to handle this better.
I also closed another issue as duplicate.
This should be done by registering a custom field processor class for the path field in #2951520: Improve path field integration, hide language, hide path if generated.
I would recommend we check if it's a PathAutoItem class and that ->pathauto is TRUE and only then skip it. Then a manual alias could still be translated. In both ways, we should skip the langcode field, which is currently also added to the translation job.
Comment #7
berdirA bit too much test refactoring but this adds a path field processor that always hides the langcode and if pathauto is enabled and an alias is generated, does not expose that for translation either. And extensive test coverage.
Comment #8
berdirAlso opened #2972587: Improve handling of link fields for links fields.
Comment #10
berdirMade the new base class abstract.
Comment #12
berdirCommitted. There are still possible improvements, we could add a setting if you never want to have the path in the translatable data, I'd suggest creating a new issue for that.