Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For example, when entering name for new content type in Russian, the Machine name generates only '_'
The correct behavior would be to do transliteration of the name before generating machine name
This can be solved adding js script with transliteration function - for example http://plugins.jquery.com/project/syncTranslit
and change function Drupal.behaviors.machineReadableValue
in system.js to use the transliteration.
Comment | File | Size | Author |
---|---|---|---|
#2 | transliterate-646466.patch | 2.89 KB | xslim |
#1 | system-transliterate-646466.patch | 2.89 KB | xslim |
Comments
Comment #1
xslim CreditAttribution: xslim commentedSo one of solution I've made is creating function
String.prototype.transliterate
and updating
You can see patch in attachment.
Patch transliteration is only for russian and ukrainian language.
Comment #2
xslim CreditAttribution: xslim commentedComment #3
xslim CreditAttribution: xslim commentedComment #4
xslim CreditAttribution: xslim commentedduplicate by this #576180: Make the machine-name generation pluggeable?
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commented#2: transliterate-646466.patch queued for re-testing.
Comment #7
jvsoutoThe Portuguese (Brazil) have the same problem, also any other language that has accents or special characters.
á, â, à, é, í, ó, ü, ú... is converted to _
Comment #8
pounardThe transliteration module exists, such feature should be in core it would solve this problem definitely. I just created the "_v_nement" content type (Événement) and I'm really angry right now because I cannot change it back anymore.
Comment #9
klonosThat issue forces me to always create content types with their English name first then translate the content type's name. This might not seem so bad but it causes the following mess if your site's default language is not English:
- Create the content type with English name (so that its machine name is correct). Because the site's default language is not English, the created content type has an English name but its language is not English.
- So, on to translating the content type... Click add translation for the English translation of the content type and hit save (no need to translate anything - it's all in English anyways).
- Now that you have the actual English content type with its English machine name, back to changing/translating the source language of the content type.
What a mess of a workflow! :/
Comment #10
xjmSee also: #1065626: Machine name not editable if every character is replaced..
Comment #11
klonosThe D7 patch in #1065626-33: Machine name not editable if every character is replaced. solves this for me: still no machine name is created when the name field of a content type is in non-Latin characters, but now I can hit the 'edit' link/button and add a machine name as I please. I'd prefer it if there was some transliterated auto-generated name that I could edit if not to my liking, but still this is far better then the workflow I used to follow.
PS: how is this issue different from #1065626: Machine name not editable if every character is replaced. again? ...or #567832: Transliteration in core perhaps?
Comment #12
xjmApparently someone requeued the patch for testing randomly when it was previously closed as a duplicate, which set the issue back to NW.