Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I use Pathauto, Transliteration and i18n.
Conversion of German umlauts works great (see ↓) for node patterns (I use the 'Default path pattern', not the language specific ones). "Übung" becomes "uebung". Great.
But for taxonomy patterns, this does not work. "Übung" becomes "ubung". I tried both tokens, [term:name]
and [term:i18n-name]
.
It seems that Pathauto (or Transliteration?) does not know that the term name is in German. Although I set the vocabulary to the translation mode 'Translate' (means that each term has a language set).
Comments
Comment #1
no2e CreditAttribution: no2e commentedCorrection: same problem with nodes, too.
I figured out:
/admin/content
) or 'Bulk Update' (at/admin/config/search/path/update_bulk
).Example
[node:title]
for 'Default path pattern for Story'./uebung
Notice that "ü" became "ue", which is correct.
[node:title]
for 'Default path pattern for Story'./ubung
Notice that "ü" became "u", which is not correct (the "e" is missing).
Even when I manually save the node (= the alias is created correctly) and after that use the unpublish action at
/admin/content
, it creates a new alias with the same error!Comment #2
no2e CreditAttribution: no2e commentedI think this might be a bug.
Comment #2.0
no2e CreditAttribution: no2e commentedwhitespace removed
Comment #3
no2e CreditAttribution: no2e commentedI figured out something else:
I have an English node titled "ü" and a translated German node titled "ü".
Now, whenever I save one of those nodes, the alias of both nodes gets updated.
When I save the German node, it creates these aliases:
example.com/de/ue
(for the German node) → correctexample.com/en/ue
(for the English node) → wrongWhen I save the English node, it creates these aliases:
example.com/de/u
(for the German node) → wrongexample.com/en/u
(for the English node) → correctSo, the problem seems to be: Pathauto uses the Transliteration rules for the language of the saved nodes for all translations.
When I deactivate the i18n submodule 'Synchronize translations', the saving of a node doesn't update the alias of the translations. But it seems that bulk-updating still uses the wrong Transliteration (but didn't test this further, because I need this module).
Comment #4
Dave ReidI'm guessing this is a bug stemming from i18n because neither Pathauto nor core update any translations when a node is edited. They only update the node that was edited.
Comment #5
Dave ReidComment #6
MaxF CreditAttribution: MaxF commentedHi, I really like pathauto and its use of transliteration on my German D7 website.
1) When I (re-)generate aliases with my DrupalAdmin account (user language: English), I'm getting English transliteration, because user language preference has priority over the website's default.
2) When I switch my DrupalAdmin's language to German, I get the expect results like all other users (all German).
I think, this is the behavior expected by design of the transliteration module and language ordering.
Though, it is inconvenient for me and maybe #2 and #3 are experiencing the same?
I'd like to suggest an option '[x] Prefer site's default language for transliteration on aliases' or another priority list for paths than for contents.
Comment #7
Dave ReidSee #973908: pathauto_cleanstring() lacks language context
Comment #8
mojzis CreditAttribution: mojzis commentedI would like to confirm the behavior similar to #1, without installing i18n. A node with a title with a czech letter with an accent doesnt get the accent removed with bulk update, it gets removed when editing the node. So I think it really looks like a problem in bulk update.
Comment #9
Freso CreditAttribution: Freso commented@ Dave:
Your comment #4 is correct for the new issue that was mentioned in comment #3, however, it is not true for the issue laid out in the original post. If you read that again, you'll see that it's only dealing with the active node, and not translations there of. (Which, indeed, is most likely an issue with "Synchronize translations".)
@ MaxF:
Please create new issues for new issues instead of taking over others issues. Also, when/if you make your issue, double check the language of the created nodes. Most likely you're creating English nodes when your user language is English and German nodes when your user language is German. The transliteration should use (or it should be, rather) the language of the node, not of whatever the site or the current user is using.
@ no2e:
It does indeed sound weird. What language is your user using when bulk updating? What is the site's default language? What happens when you change either of those?
(Also, as mentioned above, your issue in comment #3 is not related to this issue. That's "Synchronize translations" doing some weird thing, as evidenced by the problem disappearing by disabling that module.)
And re-reading the original post, I don't actually know if we use the language of taxonomy terms from I18n if they're available. Most likely not, as it's not in core. I'm not even sure if that in itself should be in Pathauto, or if Pathauto should just provide the hooks to let I18n change the behaviour itself. (If we do not already have those hooks. It's been a while since I messed around in the code. Dave's changed a lot of things. :))
Comment #10
Freso CreditAttribution: Freso commentedI just committed #973908: pathauto_cleanstring() lacks language context. Can those of you with the issue, mojzis and no2e, try and see if it's still happening in the latest development snapshot (7.x-1.x-dev)?
Comment #11
xdade CreditAttribution: xdade commentedHello everyone,
I'm trying for days a solution to my problem, and I'm pretty desperate; I have noticed that many people have also, but have not found a solution.
This issue seems to be related to my problem that occurs ONLY for the bulk update (and ONLY for the taxonomy's terms) whereas it WORKS FINE when simple updating a term.
My pattern: [term:i18n-name] or [term:name] (the result does not change)
after a bulk update I get only one alias:
/my-term-en
whereas I should get an alias for each language that I set:
/my-term-en
/my-term-de
/my-term-it
etc..
but if I update the translation of a term, and check "Generate automatic URL alias", the alias is correctly created.
Does anybody know if today there exists a solution?
It may be a problem related to the "per-field translation" (which I'm using as an alternative to "content translation")?
thanks
Comment #12
Dave ReidPlease test the 7.x-1.x-dev release as indicated in #10. Let's mark this as a duplicate of that issue as well.
Comment #12.0
Dave Reidlinked #1