When i18n is installed support localized taxonomy

nonsie - August 2, 2008 - 19:37
Project:Pathauto
Version:6.x-2.x-dev
Component:I18n stuff
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I have set up path alias as [termpath-raw]/[title-raw]. My vocabulary is set up set up with the following translation mode - Localize terms. Terms are common for all languages but their name and description may be localized.
I have translated terms however the url aliases always show up in English. Is this a bug or should I make a patch for it?

#1

greggles - August 2, 2008 - 21:34
Title:Pathauto and i18n taxonomy» When i18n is installed support localized taxonomy
Category:support request» feature request

This does seem like a feature request to me. I've re-stated it. Since I don't use i18n I won't be able to develop this patch but if it is minimally invasive on Pathauto then it seems reasonable to me to commit it.

#2

Freso - August 3, 2008 - 18:16
Version:6.x-1.1» 6.x-2.x-dev
Component:Documentation» i18n Stuff

A patch would be much appreciated.

#3

zmove - August 28, 2008 - 12:10
Component:i18n Stuff» I18n stuff

Subscribing, it strange to see multilanguage feature for nodes and not for taxonomy...

#4

farbridges - October 11, 2008 - 12:16

subscribe

#5

krabbe - March 19, 2009 - 22:24

subscribe

would be great to find a solution for that.

#6

greggles - March 19, 2009 - 23:29

If this is for the i18n module ( http://drupal.org/project/i18n ) then it should really be about adding tokens to that module to support the localized terms.

#7

hatznie - March 21, 2009 - 20:48

Subscribing

#8

HaraldB. - April 25, 2009 - 14:41

It is not an i18n issue, it is a pathauto issue to work with localized terms...

#9

greggles - April 26, 2009 - 02:05

localized terms

But which module provides localized terms?

#10

nonsie - April 26, 2009 - 03:40

i18n taxonomy

#11

Owen Barton - June 22, 2009 - 19:01
Status:active» needs review

Here is a patch that allows you to set per-language patterns for taxonomy, in the same way you can for content types. It's pretty straightforward, and I think should apply to both the 1.x and 2.x branches for Drupal 6. As you will see, this is much easier to implement in pathauto - implementing within i18n taxonomy would involve a large amount of code duplication.

Note - this works for "fully translated" vocabularies (which is the recommended approach) - i.e. I18N_TAXONOMY_TRANSLATE. Vocabularies per-language (i.e. I18N_TAXONOMY_LANGUAGE) should already work without this patch. This patch won't do anything for "Localized" vocabularies (i.e. I18N_TAXONOMY_LOCALIZE), but that is a pretty limited approach to start with and I am not sure is really supportable in pathauto.

AttachmentSize
290421.patch 3.25 KB

#12

greggles - June 22, 2009 - 21:56

Owen - that's a very interesting idea, but feels like a heavy solution to me and I don't like the idea that Pathauto is dependent on a seldomly used contributed module. Is it not possible to provide new tokens from the i18n_taxonomy module that would "do the right thing" ?

#13

Owen Barton - June 22, 2009 - 22:40

@greggles - pathauto is not dependent on i18n with this patch - if it is not installed it should work exactly as before. Also i18n module is not exactly seldom used - it is in the top 50 most popular projects, (more popular then path redirect, logintoboggan and ubercart, for example) - it is basically required if you want to build any (non-trivial) multilingual site.

I don't think i18n module providing tokens is a good solution - this might work if you only ever use the vocabulary name itself and catpath as the alias (and so could use a translated vocabulary name token) - but if you need to prefix the aliases with text to place them in some site section (as is the case most of the time in my experience) you need an interface to set this text prefix. This means admins would need to go to some i18n admin page to add and configure special tokens to translatable "vocabulary paths" (basically just tokens that convert to short translatable plain text strings), and then go to locale module and translate those strings, and then go to the pathauto page and add the tokens they previously configured.

This approach would extremely complex from an admin point of view and fragile from a technical point of view, in addition these tokens would be specific to aliases, so would not be useful for anything else. I think it is better for pathauto to provide a consistent interface - it already handles the language perfectly in the backend, we just need to change 2 lines of code so the term language is actually loaded and passed to pathauto_create_alias().

#14

greggles - June 22, 2009 - 23:52

I was a bit confused - I thought "i18n taxonomy" was separate from the main i18n module. I see now that it is a sub-module which makes it hard to know whether it truly is in the top 50 or not.

The fact that node translations are in core and taxonomy not puts us in a tricky position. I'll wait for Freso to weigh in on this because I am hesitant to add it, but don't do much work with i18n so better for a more knowledgable person to provide feedback.

One problem we had with the i18n node code is that there are a few bugs with it. I would be happier to accept this if you could also provide some simpletests to help us know that we don't break it in the future.

And thanks again for your hard work providing the patch and (maybe harder) explaining it to me ;)

#15

chaps2 - July 2, 2009 - 12:00

Here's a version of Owen's patch in #11 that works with localized vocabularies. Use with caution as I haven't tested it very thoroughly and it fudges the language property of each term object (which are language independent in localized vocabularies) to get around the lack of i18n support in the token module.

Patterns can be specified per language - use the [i18n-cat] and [i18n-cat-raw] tokens to get the translated term name provided by i18ntaxonomy.

AttachmentSize
290421-localized.patch 10.08 KB

#16

guix - September 22, 2009 - 14:19

Sub

#17

elgringopelon - October 31, 2009 - 02:44

+1

#18

greggles - October 31, 2009 - 16:57

I would be happier to accept this if you could also provide some simpletests to help us know that we don't break it in the future.

+1 is not helpful.

#19

vnb - November 1, 2009 - 14:09

Sub

#20

bastnic - November 3, 2009 - 11:09

sub

#21

eliosh - November 30, 2009 - 11:45

subscribe

#22

ddorian - November 30, 2009 - 11:48

subs are not helpfull too
will test this tomorrow evening

#23

DomoSapiens - November 30, 2009 - 11:55

I just applied the patch and it works great!

Subscribe!

 
 

Drupal is a registered trademark of Dries Buytaert.