Needs work
Project:
Transliteration
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Jul 2010 at 01:33 UTC
Updated:
27 Dec 2018 at 02:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dbetschart commentedSame problem here with 5.x version..
Comment #2
roball commentedI think it's better to keep the version at the highest one having this problem.
Comment #3
smk-ka commentedAnyone up for a patch?
- Add a checkbox to the settings.
- Check its value when processing a filename.
Comment #4
imclean commentedThere seem to be a few of these issues. Patch in this issue: #973936: Filename transliteration: Space replaced by underscore rather than defined separator character
Comment #5
roball commentedI have marked the other node as duplicate of this one.
Comment #6
imclean commentedRepost from http://drupal.org/node/973936#comment-4668844
This patch provides some configuration options regarding spaces. It defaults to the current behaviour, with options to keep spaces, remove them altogether, or replace them with either an underscore or dash character.
Comment #7
imclean commentedPatch also applies to D7 version. This one's cleaned up slightly.
Comment #8
amateescu commentedThere was another issue that requested to have this setting for the '@' character, and probably more will come, so how about we deal with all of them in a single patch?
Comment #9
chianti commentedThank you for working on this. Could we keep brackets too?
I often name my downloadable documents in the format:
[name with spaces] [Version Number] (last updated date).pdf
Comment #10
amateescu commentedHave you tested the patch? There's an option for brackets too..
Comment #11
smitty commentedAny chance to get this into the next release?
Comment #12
brightboldBefore this patch, my white spaces were getting replaced with underscores when I wanted hyphens. With the patch, and with the preferred separator set to "-" and my Spaces set to "replace by separator," the space is removed but not replaced. Same result if I set it to "no action (do not replace)." Things other than spaces seem to be converted properly.
I had to apply much of the patch by hand, as it didn't apply cleanly (being almost a year old), so maybe I missed something? (Although I've double-checked and can't figure out what.) Could someone re-roll for the latest version?
Comment #13
johnvAttached patch is an update of #8. It is D7-only, as #8 is.
As reported in #12, 'space' handling wasn't working. That is added. The patch contained a '\s' (whitespace like space, tab, ..). I left that one in.
Comment #14
chris matthews commentedThe 6 year old patch in #13 does not apply to the latest 7.x-3.x dev snapshot and is probably too old to reroll, but I went ahead and tagged the issue accordingly.
Comment #15
dakruchko commentedI think we can use hook_transliteration_clean_filename_prepare_alter() in order to replace spaces with hyphens, and then it will be cleaned and sanitized as usual