
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
Rename all files and directories, including sub directories, removing or replacing special characters.
The new name is compatible with MS-DOS FAT16 and URL (RFC 1738)
All characters different from A–Z, 0–9 and $-_!'() are renamed
For exemple :
* Fichier d'écriture *.txt
Will be renamed in :
-_Fichier_d_ecriture_-.txt
You can edit rm_special_char.py to change the new characters.
To install, simply put rm_special_char.py and rm_special_char.desktop in ~/.kde/share/apps/konqueror/servicemenus
Don't hesitate giving feedbacks or improvements.
13 years ago
1.1 RELEASE
======================================
BUGS FIXES :
001 ==> Include all ASCII characters
1.2 RELEASE
======================================
NEW FEATURES :
001 ==> Choose if you want to rename to lower cases or not
BUGS FIXES :
001 ==> Remove all non ASCII characters
002 ==> Translation table updated for german characters
1.3 RELEASE
======================================
BUGS FIXES :
001 ==> Now it also renames the first directory (the one you make the action on, not only files and sub-directories contained in it)
13 years ago
1.1 RELEASE
======================================
BUGS FIXES :
001 ==> Include all ASCII characters
1.2 RELEASE
======================================
NEW FEATURES :
001 ==> Choose if you want to rename to lower cases or not
BUGS FIXES :
001 ==> Remove all non ASCII characters
002 ==> Translation table updated for german characters
1.3 RELEASE
======================================
BUGS FIXES :
001 ==> Now it also renames the first directory (the one you make the action on, not only files and sub-directories contained in it)
danux
11 years ago
[Desktop Entry]
Version=1.3
Type=Service
ServiceTypes=KonqPopupMenu/Plugin,inode/directory
Actions=Remove_special_characters;Remove_special_characters_lower
X-KDE-Submenu=Recursively remove special characters
X-KDE-Submenu[fr]=Supprimer les caractères spéciaux récursivement
X-KDE-Submenu[es]=Remover caracteres especiales
[Desktop Action Remove_special_characters]
Name=keeping UPPER cases
Name[fr]=en gardant les MAJUSCULES
Name[es]=conservando las MAYÚSCULAS
Icon=background
Exec=~/bin/rm_special_char.py %u %n && kdialog --title "Special characters successfully removed" --passivepopup "" 5; echo
Exec[fr]=~/bin/rm_special_char.py %u %n && kdialog --title "Les caractères spéciaux ont été supprimés avec succès" --passivepopup "" 5; echo
Exec[es]=~/bin/rm_special_char.py %u %n && kdialog --title "Se han removido los caracteres especiales, manteniendo las mayúsculas" --passivepopup "" 5; echo
[Desktop Action Remove_special_characters_lower]
Name=renaming in lower cases
Name[fr]=en renommant en minuscules
Name[es]=renombrar y pasar a minúsculas
Icon=background
Exec=~/bin/rm_special_char.py %u %n -lower && kdialog --title "Special characters successfully removed" --passivepopup "" 5; echo
Exec[fr]=~/bin/rm_special_char.py %u %n -lower && kdialog --title "Les caractères spéciaux ont été supprimés avec succès" --passivepopup "" 5; echo
Exec[es]=~/bin/rm_special_char.py %u %n -lower && kdialog --title "Se han removido los caracteres especiales, cambiando todo a minúsculas" --passivepopup "" 5; echo
By the way I also added Spanish translation.
¡¡Atention KDE4 users!!
You have to put your .desktop file to: ~/.kde4/share/kde4/services/ServiceMenus
You have to put the .py file to:
~/bin (local bin folder)
or specify the correct location in the path of the .desktop file.
If you have some path problems (like me) you can try to change ~/ to /home/yourname/
Hope this helps someone.
Report
cewanf
13 years ago
Would it be possible to have this menu for single files as well, and not just directories?
BR
Report
app3al
13 years ago
Report
poliicallycorrect
13 years ago
Report
Topazz
13 years ago
Report
daphreak
13 years ago
Report
panzi
13 years ago
Is it checking for collisions? And I would suggest to convert characters like é to e and ä to ae etc. ;)
And what about lower/upper case? FAT ignores the case but linux filesystems don't (cp /extfs/foo /extfs/FOO /fat will raise a error).
Report
whiskybar
13 years ago
http://www.nongnu.org/unac/
Report
Topazz
13 years ago
Yes, if a file become the same name as an other one, it ads as many "-" characters it needs at the beginning of the name.
(Since today 20H40, before it was at the end)
> I would suggest to convert characters like é to e and ä to ae
Look at the translation code in rm_special_char.py
You will see that é becomes e as you say, but ä becomes a.
If you think it's better to rename ä to ae, I can modify the source code, but in that case post me a list of all the characters you think it's better to change (looking in rm_special_char.py)
> And what about lower/upper case?
I though at this problem, and for the moment upper case aren't renamed in lower case.
But you're right, I will change that.
In the next version all upper cases will be rename in lower cases.
Check for version 1.2 tomorrow.
Thanks for your suggestions, Topazz.
Report
panzi
13 years ago
ä -> ae
Ä -> Ae
ü -> ue
Ü -> Ue
ö -> oe
Ö -> Oe
ß -> ss or sz or just s ("sharp s")
These letters are uses in german.
Report
Topazz
13 years ago
Would you have the german translation of :
Recursively remove special characters
and :
Recursively create M3U playlists
?
Thanks in advance
Report
Topazz
13 years ago
For this version, I would need also the german translation of :
keeping UPPER cases
renaming in lower cases
Thanks
Report
quax
13 years ago
[de]=Sonderzeichen rekursiv entfernen
"Special characters successfully removed for \"%n\""
[de]="Sonderzeichen von \"%n\"erfolgreich entfernt"
keeping UPPER cases
[de]=Grossbuchstaben erhalten
renaming in lower cases
[de]=In Kleinbuchstaben umwandeln
Report