We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13094
    • 58 Posts
    hi everybody,

    does anybody knows a fix -- or a forum link i didn’t find yet -- to solve the issue that automatic alias generation keeps umlauts like ä, ü, ö and so on?

    since evo 1.0.3 I’ve to fix every generated alias manually, cause the replacement like ä -> ae didn’t work anymore.

    thanks for feedback,
    rolf
      • 25663 MODX Staff
      • 12,272 Posts
      There are multiple transliteration settings now. You can change the setting in Elements > Manage Elements > Plugins tab > Transalias plugin > Configuration tab.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 13094
        • 58 Posts
        thanks Ryan.

        pheeew.... to be honest: that didn’t work for me.

        at first, I never would search it there. that is not the usability I get used to with MODx. sorry. grin

        then: it didn’t work. I tried all the settings, added special settings and documents with special german umlauts related table, tested different encodings, with or without utf-8, entity en-/decoding and so on... nothing.
        either it kills that special char, or it delivers an unchanged char or -- even worse -- a wrong character replacement.

        I think the problem may be somewhere in the character encoding when passing the title string to transalias plugin.
        utf-8 chars won’t be matched in the table, even if it is an utf-8 encoded document.
        I’m not sure if there have to be done some utf8_encoding/utf8_decoding first, to find the special replacement for the strtr function. I didn’t find a soluion, yet.

        is there a documentation or something for transalias to check if I missed (again) something in the plugin functionality or utf-8 handling of MODx?

        cheers,
        rolf

          • 3749
          • 24,544 Posts
          Are you sure that everything in the DB is utf-8 (DB, collation, tables, and individual fields)?

          If not, there’s a conversion utility at the site in my sig.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 13094
            • 58 Posts
            hi Bob,

            thank you for your reply and your script.
            also I changed the DB to utf-8 before I altered it with your script to be VERY sure ;-)
            but the transalias results are the same. I’ll check the different translitaration files again for some more tweaks...

            oh, BTW, I felt free to alter your script to change only the modx-tables in my DB.
            // therefore I added a var at the beginning:
            $prefix = 'modx_'; // '' will take all tables
            
            //  and added lateron
            $sql_tables = "SHOW TABLES" . (($prefix != '') ? " LIKE '" . $prefix . "%'" : '');
            
            // and accordingly.
            $field = "Tables_in_".$dbName . (($prefix != '') ? ' (' . $prefix . '%)' : '');


            thank you again!
              • 13094
              • 58 Posts
              now, possibly pushed by Bobs utf-8 conversions, I found a solution for german alias generation:

              I douplicated the common.php in assets/plugins/transalias/transliterations/ to german.php and added/overwrite the special german characters I’d like to replace properly at the end of the document:

              /** german overwrite **/
              'ä'=>'ae', 'ö'=>'oe', 'ü'=>'ue', 'ß'=>'ss',
              'Ä'=>'ae', 'Ö'=>'oe', 'Ü'=>'ue'
              
              maybe you want to change the first signs user friendly, too:
              '&'=>'und','%'=>'prozent'


              TransAlias configuration settings are now change to:
              &table_name=Trans table;list;common,russian,german,utf8,utf8lowercase;german &char_restrict=Restrict alias to;list;lowercase alphanumeric,alphanumeric,legal characters;legal characters &remove_periods=Remove Periods;list;Yes,No;Yes &word_separator=Word Separator;list;dash,underscore,none;dash &override_tv=Override TV name;string;


              hope that helps. it works on latin DBs, too...

              cheers,
              rolf


              UPDATE - one more thing:

              be careful if you’re using ressources with a content type like text/css and the alias should name the document e.g. domain.tld/design.css
              the "remove periods" option will kill your design immidiately after saving...

                • 18027
                • 4 Posts
                I have to say that finding this post was a relief because one of the more recent changes I have noticed (in using Evolution over previous versions) is that alias names suddenly were forced to be lowercase. I did not realize that this new plug-in TransAlias was doing that, though in retrospect I should have been able to guess. We have many sites for clients in ModX where they advertise a URL and if it does not match exactly, there is hell to pay, especially in instances where the URL becomes broken to people trying to visit what was advertised. What happened was that we upgraded a client and did not realize that this was in place. They had been used to using uppercase and so advertising plans farther ahead using a URL with caps, and when they go to create their page, it won’t work. I think that future releases should have the setting ’utf8’ rather than ’utf8lowercase’ by default to avoid issues for people moving to newer versions. I also had custom snippets with auto-insert code for pages by looking for chunks that are named with the alias in them. so a page with alias named ’ContactUs’ might look for a chunk to include name ’ContactUs_Script’ but when the client edits the page and saves, the alias changes from ’ContactUs’ to ’contactus’ and the page is then broken. It has been a headache. Has anyone else had these issues? Or is it just that I don’t frequent this site enough and this was covered before?