title: How to automatically insert new translation into database in Yii 2
body: <p>I just started using Yii 2 and already running into some issues I can't figure out myself.</p>
  
  <p>I set up the translator, to use my DB instead of files like this ( and two tables <code>message</code> and <code>source_message</code>):</p>
  
  <pre><code>'i18n' =&gt; [
      'translations' =&gt; [
          'app*' =&gt; [
              'class' =&gt; 'yii\i18n\DbMessageSource',
              //'basePath' =&gt; '@app/messages',
              //'sourceLanguage' =&gt; 'en',
          ],
      ],
  ],
  </code></pre>
  
  <p>I even set the translator parameter to <code>true</code>:</p>
  
  <pre><code>public $forceTranslation = true;
  </code></pre>
  
  <p>Now I create the text to translate like this:</p>
  
  <pre><code>&lt;?=Yii::t('app', 'Congratulations!');?&gt;
  </code></pre>
  
  <p>When I check the debug info, I see, that there has been only one query:</p>
  
  <pre><code>SELECT
      "t1"."message" AS "message",
      "t2"."translation" AS "translation"
  FROM
      "source_message" "t1",
      "message" "t2"
  WHERE
      t1.id = t2.id AND
      t1.category = 'app' AND
      t2.language = 'en'
  </code></pre>
  
  <p>This doesn’t return anything, since there are no translations present. Now, what I can't figure out, how to <em>make</em> the system auto-create a new translation, for the missing translations.</p>
  
  <p><strong>Is such a feature already built in or do I need to create one my self?</strong> Because I couldn't find anything on the internet.</p>
  
  <p>And, if there is not, <strong>what is the right way to do so?</strong></p>