title: Laravel Localization for large websites
body: <p>Is there possibly a better way to store large amounts of text for localization in laravel? It would be easy if my entire page was just pure text, but several of my pages have complex layouts and I need to add multiple strings to wrap the text around content such as images/links/media. </p>
  
  <p>This is a pain if I ever need to italicize/bold or do any sort of HTML for the text as well as I need to break them into sections to be able to do that.</p>
  
  <p>An example of what I'm using:</p>
  
  <pre><code>return array(
      'exchange_rate' =&gt; array(
          'title' =&gt; 'Exchange Rate',
          'p1' =&gt; 'Disclaimer', 
          'p2' =&gt; 'Currency rate displayed is subject to change.',
          'p3' =&gt; 'View All Rates to Date'
      ),
  </code></pre>
  
  <p>The first array is the page, the second is the content of the page. I often have to go multiple arrays deeper for more complex layouts such as:</p>
  
  <pre><code>return array(
  'exchange_rate' =&gt; array(
      'title' =&gt; 'Exchange Rate',
      'p1' =&gt; 'Disclaimer', 
      'p2' =&gt; 'Currency rate displayed is subject to change.',
      'p3' =&gt; 'View All Rates to Date',
      'table1' =&gt; array(
          'title' =&gt; 'Currency Table',
          'row1' =&gt; array(
             'l1' =&gt; 'Current Rate'
          ),
          'row2' =&gt; array('etc')
      )
  );
  </code></pre>
  
  <p>Am I doing this right? Is there a better way to format my language files so I can work around the layouts in my views? I'm just curious how large websites manage localization.</p>
  
  <p>Any help is greatly appreciated, thanks!!</p>
  
  <p>EDIT: I'm also aware that you can add placeholders inside your localization arrays such as:</p>
  
  <pre><code>'title' =&gt; ':title'
  </code></pre>
  
  <p>But adding place-holders for all of my links, images, and media on one page could get messy. <s>Laravel also doesn't support HTML inside the language arrays so I can't just plop in content inside the language files.</s> - Yes it does</p>
  
  <p>As it stands now there seems to be two different ways to go here. </p>
  
  <ol>
  <li>Continue breaking them into small sections to format text differently.</li>
  <li>Paste the page text into one 'content' array per page, use Waavi to transfer them to the database, and then format them correctly using a WYSIWYG editor on the website itself to format the database entry. (Though this has issues as well because then you can't use blade templating as Lang::get() returns only safe text)</li>
  </ol>
  
  <p>EDIT (Feb 10th 2015):</p>
  
  <p>After lots searching, I've created a package as well that suits my needs. It completely removes the need for any text arrays in laravel. It will automatically add text to the database and translate it to your set locale. Plus, you don't need to manage and decipher dot-notated translation paths.</p>
  
  <p><a href="https://github.com/stevebauman/translation" rel="noreferrer">https://github.com/stevebauman/translation</a></p>