Hello, in some project i need same alias for all language, without translate entity to other language. I think it exists sense.

That i meen, create button to generate source language alias for all language.
Have two language EN and RU
Taxonomy exemple > term name HTC
How it work know
path En > /en/htc
path RU > /ru/taxonomy/term/1
I need translate taxonomy just for create alias? I think is not good for some reason.
but i need
path En > /en/htc
path RU > /ru/htc

????

CommentFileSizeAuthor
#16 2863230-16.patch1004 byteshchonov
#9 uniq_alias-2863230-9.patch628 bytesdimr

Comments

Regnoy created an issue. See original summary.

cmsminds’s picture

Hello Regnoy,
For your issue, it may be resolved by Pathauto i18n.

pavelculacov’s picture

Thanks, we it not integrate in main module?

sohinicp’s picture

Hi Regnoy,
Just install i18n module which includes submodule i18n_path module. It helps to translate taxonomy term.
After installing i18n, only 2 steps you have to follow:
1.When you are creating vocabulary just select "Localize. Terms are common for all languages, but their name and description may be localized." as multilingual options.
2. Then change the pattern for your vocabulary path as "[term:name]".

Then you get the path of taxonomy term as required :
path En > /en/htc
path RU > /ru/htc

Please try.

dimr’s picture

I have the same issue but with normal content types, I am using [node:source:title] to generate the URL alias, and in general works, but in my case the default language is German.
Having a title as "Bärte und Als"
because there are some "Umlaut" as ä,ü,ö
then in the German URL alias, I get something like

"baerte-und-als"
but in the English I get
"barte-und-als"

From my point of view is as pathauto is using different encoding to generate the Url, and if it is taking the German Title to make the URL, even if the English alias, it should use the same encoding or just use the same alias as in the German content, I guess.

dimr’s picture

Status: Active » Needs review

Thanks to @michaellenahan I have fixed my problem unchecking the checkbox
"Transliterate prior to creating alias" in the pathauto config page "/admin/config/search/path/settings" and now it works!
Now I get "bärte-und-als" in both languages.

dimr’s picture

Issue tags: +Vienna2017
Chris Charlton’s picture

Seems like this issue can be marked 'Works as Designed'.

dimr’s picture

StatusFileSize
new628 bytes

The option of unchecking the transliteration was at the end no a solution for our customers.

In German there are umlauts (ü,ö,ä) and in the URL should be transliterated to (ue,oe,ae), what means that we need to enable the transliteration option.

Using the patch 96 from the issue in core https://www.drupal.org/project/drupal/issues/2689459 I got the same URL in German and in English, the problem was that when saving the content in the English version was getting the English schema to generate the URL for both content, EN and DE version and when editing the content in the German version was getting the German Schema.

Applying this patch both content, English and German versions has the same URL using the Default Language Schema, German in my case.
What makes both URLs be the same, saving what every version language of the content and using transliteration for pathauto.

Status: Needs review » Needs work

The last submitted patch, 9: uniq_alias-2863230-9.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Chris Charlton’s picture

Actually, I need this to: the ability to enable Transliterate on certain patterns only, not a global setting for all patterns.

drupalfan2’s picture

I need this patch #9 or a similar patch for one content type.

It is a multilingual page (3 languages). Some content is translated (by admins). User generated content is not translated.

For this reason and for some other reasons this content type has no default language, this content type is language-neutral.

The language for entities of this content type is undefined ("und").
So the line in the patch
$langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
helps to still get the correct tansliteration for german Umlaute ("ö" -> "oe", "ä" -> "ae", "ü" -> "ue") even if the entity language is undefined.

We should extend this patch for general use (whenever language is undefined or similar ...) and apply the adjusted patch to pathauto module

drupalfan2’s picture

I found out that this patch #9 causes a lot of problems!!

Aliases for other languages than "de" are not created anymore. This is why the language is fixed to "de" through this line:
$langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();

I will never use this patch or similar solutions!!!

My solution is much better. In my costum module I wrote this code:

function hook_transliteration_overrides_alter(&$overrides, $langcode) {
  // Provide special overrides for German for a custom site.
  if ($langcode == 'de-AT' || $langcode == 'de-CH' || $langcode == 'und') {
    $overrides[0xc4] = 'Ae';
    $overrides[0xD6] = 'Oe';
    $overrides[0xDC] = 'Ue';
    $overrides[0xE4] = 'ae';
    $overrides[0xF6] = 'oe';
    $overrides[0xFC] = 'ue';
  }
}

This works and causes no other problems.

fvd’s picture

Where is the setting made? #13

I'm new to drupal, in the web/sites/default/settings.php
has it been tried without success?

drupalfan2’s picture

As I wrote: In my costum module!

In most Drupal projects it is useful to write and use a custom module to make adjustments.

hchonov’s picture

Status: Needs work » Needs review
StatusFileSize
new1004 bytes

Our use case is like this that we have a content type that is not translatable, but the site has multiple languages enabled without language detection enabled and it is possible to create content in that content type for different languages. However since pathauto automatically creates the aliases with the language of the entity if we would create content in a non-default site language then we cannot visit the url of the page. I think that we need an approach similar to #2689459: If you don't want to translate your URL alias, the original URL alias won't work with your translations that will set the language to undefined in case the entity is not translatable. The only issue I can think of is though what should happen if the content type is made translatable at a later point, so this needs to be defined and tested how the aliases old and new will behave.

geek-merlin’s picture

@hchonov: Nice to meet you again here. We face a similar problem and your approach pointed me in the right direction.

Made an overview #3482672: Overview of Pathauto language problems and approaches with some more pointers and what core does ("und if entity OR path field is untranslatable"). HTH!

mably’s picture

Closing as a duplicate of #2689459.

Looks like the only solution if you want to have a unique (untranslated) path for content with multiple translations.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

hchonov’s picture

Status: Closed (duplicate) » Needs review

@mably we need both #2689459: If you don't want to translate your URL alias, the original URL alias won't work with your translations and the changes made in here, so the issue still applies for the problem and we need more changes than the core ones.

mably’s picture

Status: Needs review » Needs work

@hchonov can you provide an MR please?