5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-02 13:16:08 +00:00

las plantillas pueden informar el nombre del tipo de artículo

This commit is contained in:
f 2020-03-31 17:20:34 -03:00
parent cb738963bb
commit 21827da354
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
4 changed files with 8 additions and 3 deletions

View file

@ -124,6 +124,11 @@ class Site < ApplicationRecord
config.fetch('locales', I18n.available_locales.map(&:to_s))
end
# Similar a site.i18n en jekyll-locales
def i18n
data[I18n.locale.to_s]
end
# Devuelve el idioma por defecto del sitio, el primero de la lista.
def default_locale
locales.first

View file

@ -14,7 +14,7 @@
%h3= t('posts.new')
%ul
- @site.layouts.to_h.keys.each do |layout|
%li= link_to layout.to_s.humanize,
%li= link_to @site.i18n.dig('layouts', layout.to_s) || layout.to_s.humanize,
new_site_post_path(@site, layout: layout)
- if policy(@site).edit?

View file

@ -387,7 +387,7 @@ en:
date: 'date'
order: 'Order'
content: 'Text'
new: 'New post as'
new: 'Add:'
dropdown: 'Toggle dropdown'
categories: 'Everything'
index: 'Posts'

View file

@ -397,7 +397,7 @@ es:
content: 'Cuerpo del artículo'
categories: 'Todos'
dropdown: 'Desplegar el menú'
new: 'Crear artículo en:'
new: 'Agregar:'
index: 'Artículos'
edit: 'Editar'
open: 'Nota: Puedes agregar más opciones a medida que las escribes y presionas Entrar'