internetsistemas / guides

A guide for programming gracefully.
25 stars 13 forks source link

Improve Locales section #29

Closed brunoocasali closed 8 years ago

brunoocasali commented 9 years ago

If we change a little our default's we can improve a lot the implementation of the localization standards:

# from this:
pt-BR:
  views:
    admin:
      users:
         index:
           title: Usuários
         new:
            title: Novo Usuário
            form:
              legend:
                remuneration: Remuneração

         edit:
           title: Editar Usuário

# to this:
pt-BR:
  admin:
    users:
      index:
        title: Usuários

      new:
        title: Novo Usuário

      edit:
        title: Editar Usuário

      form:
        legend:
          remuneration: Remuneração
# app/views/admin/users/new.html.slim
​
# and our implementation will be:
.content.new-user
  .header
    .row
      .large-12.columns
        h3.title = t '.title'
​
# instead of:
.content.new-user
  .header
    .row
      .large-12.columns
        h3.title = t 'views.admin.users.new.title'
felipefontoura commented 8 years ago

@brunoocasali I used it in a personal project and it really useful and turn locales simple! For your propose is approved!

felipefontoura commented 8 years ago

@brunoocasali could you please create a PR with this suggestion? Thanks!

felipefontoura commented 8 years ago

Merged