Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've found that the best overall strategy is to somewhat reproduce the file structure so that given any translation, I can immediately find where it was called from. This gives me some kind of context for making the translation.</p> <p>The majority of application translations are found in views, so my biggest top level namespace is usually <code>views</code>.</p> <p>I create sub namespaces for the controller name and the action name or partial being used ex :</p> <ul> <li><code>views.users.index.title</code></li> <li><code>views.articles._sidebar.header</code></li> </ul> <p>Both of these examples should make it obvious what part of my app we're translating and which file to look in to find it.</p> <p>You mention navigation and buttons, if they are to be generic, then they belong in the <code>views.application</code> namespace just as do their view counterparts :</p> <ul> <li><code>views.application._main_nav.links.about_us</code> - a link in our app's main navigation partial</li> <li><code>views.application.buttons.save</code></li> <li><code>views.application.buttons.create</code> - I have a bunch of these buttons ready to be used when needed</li> </ul> <p>Flash messages are generated from the controller, so their top level namespace is... <code>controllers</code>! :)</p> <p>We apply the same logic as we do to views :</p> <ul> <li><code>controllers.users.create.flash.success|alert|notice</code></li> </ul> <p>Again if you wanted to provide generic flash messages like "Operation successful", you would write something like this :</p> <ul> <li><code>controllers.application.create.flash.notice</code></li> </ul> <p>Finally, keys can be anything that is valid YAML, but please stick to using periods <code>.</code> as separators and underscores <code>_</code> between words as a matter of convention.</p> <p>The only thing left to sort out now, is getting rails' translations into its own namespace to clean up our top level :)</p>
    singulars
    1. This table or related slice is empty.
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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