Note that there are some explanatory texts on larger screens.

plurals
  1. PORails internationalization (i18n): Everything translating except layouts/application.html.erb
    primarykey
    data
    text
    <p>I keep getting "translation missing: en.layouts.application.title" for title or any item I try to translate within app/views/layouts/application.html.erb file.</p> <p><strong>config/locales/en.yml</strong></p> <pre><code>en: layouts: application: title: "My Catalog" home: "Home" store: "Store" faq: "FAQ" contact: "Contact" about: "About" </code></pre> <p><strong>app/views/layouts/application.html.erb</strong></p> <pre><code>&lt;div id="banner"&gt; &lt;% t('.title') %&gt; &lt;/div&gt; &lt;div id="nav_menu" class="sidebar_menu"&gt; &lt;a href="/"&gt;&lt;%= t('.home') %&gt;&lt;/a&gt; &lt;a href="/store"&gt;&lt;%= t('.store') %&gt;&lt;/a&gt; &lt;a href="/faq"&gt;&lt;%= t('.faq') %&gt;&lt;/a&gt; &lt;a href="/contact"&gt;&lt;%= t('.contact') %&gt;&lt;/a&gt; &lt;a href="/about"&gt;&lt;%= t('.about') %&gt;&lt;/a&gt; &lt;/div&gt; </code></pre> <p>All the translations in the views are working but anything in the layout says its missing. I am using en.yml, fr.yml, and es.yml and it's the same issue with each (fr.layouts.application.title and es.layouts.application.title, respectively)</p> <p>If I move the lines out of the layouts: application: nest and into the root hierarchy of the .yml file (removing the period from the t method of course) then everything translates. As soon as I move them back under layouts: application: I get translation missing again.</p> <p>What could be wrong? I am using Rails 3.2.7</p> <p>EDIT 1: Just tried using &lt;% t('layouts.application.title') %> but still says translation missing.</p> <p>EDIT 2: Work-around found if I copy or rename application.html.erb to a different name (and change *.yml files accordingly).<br> If I start a <strong>new project</strong> translations work just fine within application.html.erb. However in the <strong><em>current project</em></strong>: as long as I'm using application.html.erb (even with minimal test content) I still get translation missing.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload