title: Translating to Languages with Irregular Rules
body: <p>In order to make a PHP <a href="http://en.wikipedia.org/wiki/Web_content_management_system" rel="nofollow">content management system</a> <strong>extensible</strong>, language translations are crucial.  I was researching programming approaches for a translations system, and I thought that <a href="http://doc.qt.nokia.com/latest/linguist-manual.html" rel="nofollow">Qt Linguist</a> was a good example.</p>
  
  <p>This is an example usage from the Qt documentation:</p>
  
  <pre><code>int n = messages.count();
  showMessage(tr("%n message(s) saved", "", n));
  </code></pre>
  
  <p>Qt uses known language rules to determine whether "<code>message</code>" has an "<code>s</code>" appended in English.</p>
  
  <p>When I brought that example up with my development team, they discovered an issue that <strong>jeopardizes the extensibility effectiveness</strong> of modeling off of Qt's <code>tr()</code> function.</p>
  
  <p>This is a similar example, except that something is now seriously wrong.</p>
  
  <pre><code>int n = deadBacteria.count();
  showMessage(tr("%n bacterium(s) killed", "", n));
  </code></pre>
  
  <p>The plural of "<code>bacterium</code>" is "<code>bacteria</code>".  It is improper to append an "<code>s</code>".</p>
  
  <p>I don't have much experience with Qt Linguist, but I haven't seen how it handles irregular conjugations and forms.</p>
  
  <p>A more complicated phrase could be <code>"%n cactus(s) have grown."</code>.  The plural should be "<code>cactii</code>", and "<code>have</code>" needs to be conjugated to "<code>has</code>" if there is one cactus.</p>
  
  <p>You might think that the logical correction is to avoid these irregular words because they are not used in programming.  Well, this is not helpful in two ways:</p>
  
  <ol>
  <li>Perhaps there is a language that modifies nouns in an irregular way, even though the source string works in English, like <code>"%n message(s) saved"</code>.  In MyImaginaryLanguage, the proper way to form the translated string could be "<em>1Message saved</em>", "<em>M2essage saved</em>", "<em>Me3ssage saved</em>" for <code>%n</code> values <code>1</code>, <code>2</code>, and <code>3</code>, respectively, and it doesn't look like Qt Linguist has rules to handle this.</li>
  <li>To make a CMS extensible like I need mine to be, all types of web applications need to be factored in.  Somebody may build a <a href="http://en.wikipedia.org/wiki/Role-playing_game" rel="nofollow">role-playing game</a> that requires sentences to be constructed like "<em>5 cacti have grown.</em>"  Or maybe a security software wants to say, "<em>ClamAV found 2 viruses.</em>" as opposed to "<em>ClamAV found 2 virus(es).</em>"</li>
  </ol>
  
  <p>After searching online to see if other Qt developers have a solution to this problem and not finding any, I came to Stack Overflow.</p>
  
  <p>I want to know:</p>
  
  <ol>
  <li><strong>What extensible and effective programming technique should be used to translate strings with possible irregular rules?</strong></li>
  <li>What do Qt programmers and translators do if they encounter this irregularity issue?</li>
  </ol>