Search the Community
Showing results for tags 'Umlauts'.
-
If a user searches (frontend) for words with german umlauts like ä, ö, etc. no results are given back. Do you have any solution? Thanks.
-
Hello, I have a multilanguage page, running on PW 2.6.23. This is a conversion of a german Joomla site which already has active members. It is a requirement to have a specific format for user names which are generated from the Full Name of a user: "Test Üser" should become "Test_Ueser_1552", where 1552 is the user id. (note conversion of Umlaut Ü to Ue) I have changed and added Umlaut conversion in the InputfieldPageName settings to read: æ=ae å=a ä=ae Ä=ae ß=ss ö=oe Ö=oe ü=ue Ü=ue ... I have created a "member" template based on the user template, following instructions here. This is all working fine and I can create member users. My member template has a text field "fullname". Now I have written a small module to create my custom user name format from the fullname field: public function init() { $this->pages->addHookBefore('Pages::saveReady', $this, 'renameMember'); } protected function renameMember($event) { $page = $event->arguments[0]; if($page->template != 'member') return; $sanitizer = wire('sanitizer'); if($page->isChanged('fullname') && !empty($page->fullname)) { $name = $page->fullname; $newName = str_replace(" ", "_", $name) . "_" . $page->id; $newNameSave = $sanitizer->pageName($newName, "Sanitizer::translate"); $page->name = $newNameSave; $message = __("Benutzername wurde angepasst: ") . $newNameSave ; $this->message($message); } } But every time I try this, "Test Üser" becomes "test_ser_1552". The same goes for "Test üser". If I try "Test Güser", I get "test_g-ser_1552". So ü gets replaed by a dash -. When I create regular pages (e.g. basic-page template) the conversion of Ü and ü to ue for the page name is working just fine. Could there be a problem with using $sanitizer->pageName($newName, "Sanitizer::translate"); inside a module? Or is the username field treated differently from the page name field? Any solution would be much appreciated.
- 5 replies
-
- Umlauts
- not transcribed correctly
-
(and 1 more)
Tagged with: