I am trying to set up a bilingual (english/spanish) website where the URLs are driven by a taxonomy. For demonstration purposes and testing I created a very simple version locally with minimal modules, content, and simple taxonomy terms as follows:

Animals
-Birds
-Dogs
-Cats
Colors
-Red
-Blue
-Green

I set up pathauto to alias taxonomy terms as follows:

animals
animals/birds
animals/cats
...
colors
colors/red
colors/blue

Nodes tagged with these terms are aliased as follows:
animals/general-article-about-animals (this node is tagged only with the animal parent term)
animals/birds/specific-article-about-birds (this node is tagged with only the bird child term)

This works fine for English. However, when I translate the taxonomy terms as follows:

Animales
-Pajaros
-Perros
-Gatos
Colores
-Rojo
-Verde
-Azul

The paths are set as follows:
animales
animals/pajaros (note 'animals' is not translated to 'animales')
animals/perros
...
colores
colors/rojo ('colors' is not translated to 'colores')
colors/verde

The parent taxonomy term path is translated, but the parent in the child's path is not translated - this is how I would like it to display:

animales/pajaros
animales/perros
...
colores/rojo
colores/verde

Also, for nodes tagged with these terms, none of the terms are translated in the paths:

animals/general-article-about-animals in spanish is aliased as animals/artículo-general-sobre-animales
animals/birds/specific-article-about-birds in spanish is aliased as animals/birds/artículo-específico-sobre-aves

I tested this on the most basic of installs I could do for my use case, running the following:

Drupal 7.56
Title 7.x-1.0-alpha9
Entity Translation 7.x-1.0-beta6
Entity API 7.x-1.8
Entity Tokens 7.x-1.9
Pathauto 7.x-1.3
Token 7.x-1.7

Is this something that Entity Translation can do? Here is a screenshot of how I set up my patterns:

alias patterns

as well as the basic configs I did via Entity Translation:

entity translation configs

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kbrinner created an issue. See original summary.

kbrinner’s picture

Minutes after I posted this I came across https://www.drupal.org/node/1114016 which has a section "Using both i18n Taxonomy translation and Entity Translation to translate your taxonomy and generate multilingual URL aliases". Will test out their solution to see if it resolves my issue.

joseph.olstad’s picture

You are not using the right title token.

Provided that your title field is correctly configured / upgraded using the title module then you can use the field title token in the path pattern instead of the regular title token

joseph.olstad’s picture

Also you might want to try using the latest dev versions of those modules as lots of maintainers seem to slack on tagged releases, often many bugs fixed in dev branch that rarely get tagged releases as often as they should

joseph.olstad’s picture

joseph.olstad’s picture

Status: Active » Needs review
stefanos.petrakis@gmail.com’s picture

Status: Needs review » Postponed (maintainer needs more info)

Hey @kbrinner,

How did you do so far with exploring the alternative you mentioned (#2) ?

I just tested your use-case and got the translated parent/top-level term name as part of the URL (as expected):

http://et.drupal/animals/article-about-animals-2
http://et.drupal/de/tiere/article-about-animals-2

http://et.drupal/animals/birds/article-about-animals
http://et.drupal/de/tiere/v%C3%B6gel/article-about-animals

The versions I used are the same as yours, (with the exception of Entity Tokens which is probably a typo since 7.x-1.9 doesn't exist yet):

  • Drupal 7.56
  • Title 7.x-1.0-alpha9
  • Entity Translation 7.x-1.0-beta6
  • Entity API 7.x-1.8
  • Entity Tokens 7.x-1.8
  • Pathauto 7.x-1.3
  • Token 7.x-1.7
kbrinner’s picture

FileSize
65.83 KB
15.16 KB
27.63 KB

Thanks for the comments - I'll respond to them one by one first:

Comment 3 - incorrect title token

I updated the title tokens to use the title field:
update title fields

Comment 5 - patched Entity Translation

Did this.

Then cleared cache, deleted all aliases at admin/config/search/path/delete_bulk and then regenerated all aliases via admin/config/search/path/update_bulk

Now my English paths are:
/animals (taxo term)
/animals/bird (child taxo term)
animals/bird/info-about-birds (node)

and the corresponding Spanish paths are:
/es/taxonomy/term/1 (taxo term)
/es/taxonomy/term/8 (child taxo term)
/es/animals/bird/información-sobre-los-pajaros (node)

I confirmed (since it's been a couple of weeks) that I am using the Title Field for the nodes, and that translation is enabled:
title field enabled
enabled translation

Will do some more testing and post back again shortly.

joseph.olstad’s picture

kbrinner , please make sure to update your entity_translation , beta7 was released a couple days ago and has many fixes.

you might want to try these versions

    Drupal 7.56
    Title 7.x-1.0-alpha9

Entity Translation 7.x-1.0-beta7

    Entity API 7.x-1.8
    Entity Tokens 7.x-1.8
    Pathauto 7.x-1.3
    Token 7.x-1.7