bueltge / de-de Goto Github PK
View Code? Open in Web Editor NEWSpecial German permalink sanitize
Home Page: https://wordpress.org/plugins/de_de/
License: GNU General Public License v2.0
Special German permalink sanitize
Home Page: https://wordpress.org/plugins/de_de/
License: GNU General Public License v2.0
Site upgrade in progress
http://www.code-styling.de/deutsch/permalinks-mit-umlauten-ohne-o42-clean-umlauts
Diese Verbindung ist nicht sicher
http://wordpress-buch.bueltge.de/das-wordpress-buch/downloads/extra/
check constants:
DOING_AUTOSAVE
DOING_AJAX
Fügt man ein Bild per Drag & Drop in Gutenberg ein (nicht über das Media Model, sondern direkt in den Content), wird das Bild im Body per POST-Request an den REST API Endpoint /wp/v2/media gesendet.
Aktuell fügt deswegen dieses Plugin keinen Filter zu sanitize_file_name hinzu. Über die REST_REQUEST-Konstante, könnte man checken ob es sich um einen REST Request handelt. Allerdings wird die Konstate aktuell recht spät von WordPress initalisiert. Hier müsste man das Plugin erst bei rest_api_init ausführen, damit REST_REQUEST = true ist.
Außerdem gibt es ein weiteres Problem. Da der Upload im Body des Request erfolgt, wird der Filename aus dem Content-Disposition Header entnommen: https://github.com/WordPress/wordpress-develop/blob/4848b1e3aa956766d276d8f192ec398c01d6ace5/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php#L742
Deswegen wird der Title auch ohne Umlaute gespeichert.
Meine Idee wäre das Plugin zumindest bei init und rest_api_init zu laden weil aktuell wird aus allen Uploads die man per Drag & Drop in Gutenberg macht, keine Umlaute entfernt.
We can safely remove this function as the spellchecker is removed since 5 years:
https://core.trac.wordpress.org/ticket/23341#comment:9
https://github.com/bueltge/de_DE.php/blob/master/de_DE.php#L273-L293
http://core.trac.wordpress.org/browser/trunk/wp-includes/formatting.php#L793
ggf. ab 3.6 die Standard-Funktionen nutzen und unsere eigenen ignorieren.
Any idea why "fünfzehn" is changed to "fu?nfzehn" ?
Integration from https://github.com/voku/portable-ascii to solve the problem in different environments, no dependencies and pure PHP solution.
echo ASCII::to_ascii('�Düsseldorf�', 'de');
// Duesseldorf
Ist das hier noch aktuell?
function fb_mce_external_languages($initArray){
$initArray['spellchecker_languages'] = '+German=de, English=en';
return $initArray;
}
add_filter('tiny_mce_before_init', 'fb_mce_external_languages');
http://bueltge.de/wordpress-wysiwyg-editor-tinymce-erweitern-2/1100/
und sollte man das reinnehmen?
check for constant DOING_CRON
Last plugin customization was a long time ago and if you switch to PHP8.3, you get an error message.
The upload and the naming seems to work, I uploaded length.jpg and it was renamed to length.jpg.
In some cases, the WordPress backend did not load when PHP8.3 and the current plugin version were running.
Update to PHP8.3
Nothing special expected
WordPress-Version: 6.4.2
PHP-Version: 8.3.1
MySQL/MariaDB-Version: 5.7.42
Aktive Plugins:
Borlabs Cookie (3.0.0.13)
Broken Link Checker (2.2.4)
Honeypot for Contact Form 7 (2.1.1)
Contact Form 7 (5.8.6)
Credit Tracker (1.1.17)
Exclude Image Thumbnails From UpdraftPlus Backups (1.0.3)
Download Monitor (4.9.5)
Mehrere Dateien per Drag & Drop hochladen - Kontaktformular 7 (1.3.7.5)
Yoast Duplicate Post (4.5)
Envira Gallery (1.9.9.2)
FileBird Pro (6.0.4)
Avada Builder (3.11.3)
Avada Core (5.11.3)
Indeed My Team (3.0)
InfiniteWP - Client (1.12.5)
NinjaFirewall (WP Edition) (4.5.10)
NinjaScanner (3.1)
Redirector (3.0.1)
Slider Revolution (6.6.20)
UpdraftPlus – Sichern/Wiederherstellen (2.23.14.26)
Yoast SEO (21.8)
WP Mail Logging (1.12.0)
WP Mail SMTP (3.11.0)
Aktives Theme: Avada Child (Avada 7.11.3)
Deprecated: Function utf8_decode() is deprecated in .../plugins/de_de/de_DE.php on line 332
No response
I am using and contributing to the WP-Permalauts plugin (https://github.com/kaffee-mit-milch/wp-permalauts) and found the de_DE.php here and the Germanix-WordPress-Plugin.
Why not team up? What do you think?
When testing version 1.0.1 in various systems, I noticed that there seems to be a bug with the permalinks. I created a post with umlauts and got problems with umlauts. When I deactivated the plugin, the error was no longer present.
With the test file "The ugly duckling costs 1 €.jpg" the result looks like this: File name: "das-haessliche-entlein-kostet-1-e-scaled.jpg".
A post/page with the name "Das hässliche Entlein kostet 1 €.jpg" becomes "das-ha¤aliche-e...ein-kostet-1-eur".
Error can be reproduced 1:1 in various similar system setups.
I did not expect any intervention in the permalink structure of posts and pages. File names seem to work at first glance.
PHP 8.2 + 8.3
Avada 7.11.9
WordPress 6.5.4
No response
No response
neue Filter in WP 3.4 für wptexturize()
http://core.trac.wordpress.org/browser/trunk/wp-includes/formatting.php#L29
// Transform into regexp sub-expression used in _wptexturize_pushpop_element
// Must do this everytime in case plugins use these filters in a context sensitive manner
no_texturize_tags
no_texturize_shortcodes
Bsp. Anführungszeichen:
„ --> Win: Alt + 0132
“ --> Win: alt + 0147
siehe http://www.typografie.info/2/wiki.php?title=Anfuehrungszeichen
weitere Besonderheiten prüfen: http://www.typografie.info/2/wiki.php?title=Kategorie:Typografie
Hilfe für Web, sollte als Auswahl reichen:
http://webdesign.crissov.de/Typografie/Zitieren
:lang(de-de)>q {quotes: "„" "“" "‚" "‘"}
Bindestrich
http://webdesign.crissov.de/Typografie/Striche#U002D
Auslassungspunkte
…
Kurz gesagt, steht der Punkt nie, andere Satzzeichen schon, und ein Leerzeichen immer, es sei denn die Punkte ersetzen Buchstaben des vorhergehenden Wortes: F… dich selber, du …! Sonst …
/**
Hallo Frank,
ich verwende die Datei de_DE.php bereits seit einigen WordPress-Versionen erfolgreich. Vielen Dank an Heiko Rabe und an dich für diese pfiffige Lösung! Nach dem Update von WordPress 3.05 auf WordPress 3.1 funktionierte die Umwandlung der Umlaute allerdings erst wieder nach Aktualisierung von de_DE.php auf Version 0.7.1.
Was nach der Aktualisierung noch nicht wieder funktionierte, war die Umwandlung von Zeichen mit Accents (z. B. è und é). Wunschvorstellung war das Weglassen des Accent-Strichs, tatsächlich verschwand jedoch das komplette Zeichen.
Mein Test-String (im Titel eines Artikels) resultierte in folgender Titelform:
DE äöüß ÄÖÜ DE FRANZ èé FRANZ >>> de-aeoeuess-aeoeue-de-franz-franz
Ursache dieses Verhaltens ist eine (versehentliche?) Änderung des Quellcodes der WordPress-Funktion "sanitize_title_with_dashes" zwischen der Version 3.05 und 3.1 (diese Funktion wird in de_DE.php in Zeile 43 aufgerufen): In Version 3.05 findet sich in Zeile 823 der Datei "wp-includes/formatting.php" die Anweisung "$title = remove_accents($title);". In den Versionen 3.1 und 3.1.1 ist diese Anweisung verschwunden, siehe hierzu: http://core.trac.wordpress.org/changeset/15929
Die korrekte Behandlung von Accents kann wiederhergestellt werden, in dem der Aufruf von "remove_accents" in der Datei de_DE.php unmittelbar vor dem Aufruf von "sanitize_title_with_dashes" ergänzt wird. Der komplette Abschnitt sieht damit wie folgt aus:
$title = str_replace( $umlaut_chars['ecto'], $umlaut_chars['perma'], $title );
$title = str_replace( $umlaut_chars['in'], $umlaut_chars['perma'], $title );
$title = str_replace( $umlaut_chars['html'], $umlaut_chars['perma'], $title );
/*NEU */ $title = remove_accents($title); /* NEU */
$title = sanitize_title_with_dashes( $title );
$title = str_replace( '.', '-', $title );
Damit erhält man das gewünschte Ergebnis: de-aeoeuess-aeoeue-de-franz-ee-franz
Viele Grüße,
upscho
@bueltge and others:
I may be too stupid but I do not get it to work in dropin mode.
Siehe http://core.trac.wordpress.org/ticket/24789
Der Filter kann dann also weg.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.