Morphos – morphological solution in PHP for English and Russian

If you ever had to deal with morphology in English, you probably found one or two libraries to help you out.  But if you had to do that for Russian, than I’m sure you are missing a few hairs, and the ones that you still have are grayer than they used to be.  I’ve got some good news for you though, now there is Morphos (GitHub repository).

Morphos is a morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline First/Middle/Last names/nouns and generate cardinal numerals.

Just look at this beauty!

var_dump($dec->getForms($user_name, $dec->detectGender($user_name)));
/* Will produce something like
  array(6) {
    ["nominativus"]=>
    string(8) "Иван"
    ["genetivus"]=>
    string(10) "Ивана"
    ["dativus"]=>
    string(10) "Ивану"
    ["accusative"]=>
    string(10) "Ивана"
    ["ablativus"]=>
    string(12) "Иваном"
    ["praepositionalis"]=>
    string(15) "об Иване"
  }
*/

Just this alone can make user interfaces and emails so much better.  But there is more to it than that.

CakePHP 3 and the need for breadcrumbs

I’ve been catching up with the CakePHP roadmap.  One of the tickets for the next release (CakePHP 3.3.10, scheduled for tomorrow), is this ticket, relating to the breadcrumbs navigation.

When building applications with CakePHP, you have a couple of easy ways to generate breadcrumbs for the easier user navigation.  One, is to use HTML Helper, which provides a quick and simple way.  The other, is to use a feature rich Breadcrumbs Helper, available since CakePHP version 3.3.6 (but not mentioned in the release notes).

Digging further down into templates, and best practices for user navigation, and different ways of styling breadcrumbs (Smashing Magazine, Hongkiat, UI Patterns), I thought – wouldn’t it be nice to have breadcrumbs navigation built into a human brain?

I mean, how many times did you catch yourself in some dark corner of the Internet, trying to figure out how did you get there?  If only humans had breadcrumbs navigation built into our brains, that would be so easy to trace back the steps.  Browser history can, of course, help, but with so many open tabs and several things happening in parallel, a flat list of tabs is not much help.

WordPress : Preferred Languages Research

Pascal Birchler of the WordPress blogs some interesting research he did in the area of handling preferred language and how different systems – ranging from browsers, wikis, and social networks to all kinds of content management systems – approach and solve the problem.

drupal-language-hierarchy-module

Drupal

Drupal 8 has a rather powerful user interface text language detection mechanism. There is a per session, per user and per browser option in the detection settings. However, users can only choose one language, so they cannot say (in core at least) that they want German primarily and Spanish if German is not available. But the language selected by the user is part of the larger fallback system, so it may fall back further down to other options.

The Language fallback module allows defining one fallback for a language, while the Language Hierarchy module provides a GUI to change the language fallback system. It allows setting up language hierarchies where translations of a site’s content, settings and interface can fall back to parent language translations, without ever falling back to English. This module might be the most interesting one for our research.

Apart from the research itself, I think this is an interesting example of how complex some seemingly simple features are.

10 Things I Learned About UX By Being Drunk

theuserisdrunk.com

OK, this is pure gold.  First of all, this is probably the greatest title ever. “10 Things I Learned About UX By Being Drunk“.  Secondly, this post links to The User Is Drunk website, which is a brilliant idea and … a business, apparently.  Thirdly, it reiterates once again over the things that couldn’t be recommended strong enough:

  1. Don’t say too much
  2. Tell me who your site is for
  3. Solve the need, and tell me what it is
  4. Don’t copy paste
  5. Hide anything non-essential
  6. Make sure every link on your homepage works
  7. Not every site needs to be flashy
  8. Time on site is not the only metric
  9. Use web standards
  10. Stand out

Excellent stuff!

Grouped tags and categories

Just a quick update on something that I wanted to do for quite a while now – I’ve joined the display of tags and categories.  They are still separated in the back-end for me to manage the posts easier.  I just figured out that for site visitors there’s no practical difference, and thus using two user interface elements where one can do the job is not ideal.  The code snippet that helped me do that was borrowed (and slightly modified) from this Codex page.  The only two change that I did were:

  • Skip the General category (or All, as it’s labeled in this case), since all posts belong to it anyway.
  • Skip post format taxonomy (as those are already encoded with post styling – colors and titles).

I’ve also thrown a copyright into the footer and a small welcome box to the sidebar, but those are just cosmetics.