Needs work
Project:
Transliteration
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 Oct 2012 at 14:55 UTC
Updated:
1 Oct 2019 at 15:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
peacog commentedI had the same problem, although in my case English is the default language. When English is the current language, ü transliterates to u. To get ue I have to switch language so that German is the current language.
Comment #2
calliandra commentedI had the same problem.
In my case, I had the site's default language set to German, but had my user settings set to English.
This must have triggered the "English-flavor" transliteration of Umlauts, because when I changed that to German as well, transliteration began working as expected, i.e. using the German transliteration set.
HTH
Comment #3
watchdog commentedI had both the standard and the admin's user language set to German, but it still did not work correctly (i.e. "ü"->"u"). I figured out that you have to use the german version of the admin page ("/de/admin/config/search/path/update_bulk") for doing the bulk update in order to make it work correctly.
Comment #4
yannickooI don't have a German language, it's english only. It should be possible to change the language for Pathauto only with hook_pathauto_pattern_alter. You could change the
languageto 'de' there.Comment #5
oschuetze commentedWith "transliteration" and "pathauto" running, there is only a simple replacement, e.g. "ü" -> "u". But I need a replacement like "ü" -> "ue".
@yannickoo: How can I change the language? I've added
to hook_pathauto_pattern_alter and cleaned all caches - but nothing happend. Any other Idea?
Comment #6
yannickooOkay, you are right that doesn't work. Anyways I could find out how to get "ae" instead of "a" for an "ä". The clue is that you have to edit the entity in german then Transliteration searches for the proper replacements.
I don't know how we could fix that exactly because the one way would make use of the entity language so if your entity is german you want proper replacements ("ae" instead of "a" etc.). This is not so easy because the functions are called in following order:
pathauto_create_alias($module, $op, $source, $data, $type = NULL, $language = LANGUAGE_NONE)pathauto_clean_token_values(&$replacements, $data = array(), $options = array())pathauto_cleanstring($string)(no language is passed)transliteration_get($output)(at this place the entity language could be passed)_transliteration_process($text, $unknown = '?', $source_langcode = NULL)I think the easiest way to would be changing the replacement pattern in the
<a href="http://drupalcode.org/project/transliteration.git/blob/refs/heads/7.x-3.x:/data/x00.php">x00.php</a>file so that it doesn't matter which language you are using. Replace "ä" with "ae" is common.What do you think?
Comment #7
yannickooComment #8
amateescu commentedWe cannot hardcode language specific variants like that, that's the whole point of having the mechanism to support language overrides per language..
Comment #9
dokumori commentedI'm working on a German site under a multisite setup, which also holds the same version of the site in other languages. While the German website's default language needs to be set to British English, transliteration of umlauts still needs to work.
In order to set the site's 'preferred' language arbitrarily, I've defined a constant 'TRANSLIT_SITE_LANG' in settings.php of the German site, then applied this patch to the module's .inc file. The patch allows you to separate a site's default language and a language code for transliteration.
Not sure if the maintainer wants to apply this patch to the module, but posting anyway as some people may find it useful.
Comment #10
ronino commentedIt seems like taxonomy terms don't have a language by default and there is no i18n support for terms in core (see #290421: pathauto patch to provide localized and entity translated taxonomy through i18n). However you can trick transliteration into using your site's default language for all terms by implementing a language callback for taxonomy terms like so:
Comment #11
chris matthews commentedThe latest patch in #9 is corrupt at line 19.
Comment #12
johnnny83 commentedI also have this issue in Drupal 8. Any news on it?
Comment #13
splash112 commentedSame for drupal 6...
Somebody edits a node in English and the German translation path gets updated (without notice). The somebody updates the node on the German site and the paths get corrected to the right version. Even with proper redirecting a big nightmare for SEO.
Comment #14
splash112 commentedWeird, found the bug. For those ancient history buffs.
Pathauto.inc 6.x / 2.1 line 199
Change:
function pathauto_cleanstring($string) {
to
function pathauto_cleanstring($string, $options = array()) {
Weird because the $options variable was defined in the docs, but just omitted.
Comment #15
ciss commentedUnhiding patches in #7 and #9.