5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 23:06:21 +00:00

traducir o editar

This commit is contained in:
f 2018-02-26 17:32:33 -03:00
parent 84a6f632af
commit f3b6717b23
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
4 changed files with 40 additions and 10 deletions

View file

@ -10,7 +10,7 @@ class I18nController < ApplicationController
def edit
@site = find_site
@lang_from = params.fetch(:from, I18n.locale.to_s)
@lang_to = params.fetch(:to, I18n.available_locales.sample.to_s)
@lang_to = params.fetch(:to, @lang_from)
@options = I18n.available_locales.map do |lang|
[ t("i18n.#{lang.to_s}"), lang.to_s ]
end

View file

@ -1,14 +1,27 @@
= form_tag site_i18n_edit_path(@site), method: :get, class: 'form-inline' do
%h1
= t('i18n.translating.from')
= select_tag 'from',
options_for_select(@options, @lang_from),
class: 'form-control'
= t('i18n.translating.to')
= select_tag 'to',
options_for_select(@options, @lang_to),
class: 'form-control'
= submit_tag t('i18n.change'), class: 'btn btn-info', name: nil
- if @lang_from == @lang_to
= t('i18n.edit_same')
= select_tag 'from',
options_for_select(@options, @lang_from),
class: 'form-control'
= t('i18n.translate_into')
= select_tag 'to',
options_for_select(@options, @lang_to),
class: 'form-control'
= submit_tag t('i18n.translate'), class: 'btn btn-info', name: nil
- else
= t('i18n.translating.from')
= select_tag 'from',
options_for_select(@options, @lang_from),
class: 'form-control'
= t('i18n.translating.to')
= select_tag 'to',
options_for_select(@options, @lang_to),
class: 'form-control'
= submit_tag t('i18n.change'), class: 'btn btn-info', name: nil
= render 'layouts/help', help: t('help.i18n.index')
= form_tag site_i18n_path(@site), method: :post, class: 'form' do
= hidden_field 'i18n', 'lang_to', value: @lang_to
@ -16,3 +29,6 @@
= submit_tag t('i18n.save'), class: 'btn btn-success'
= render 'i18n/recursive', data: @site.data.dig(@lang_from), superkeys: []
.form-group
= submit_tag t('i18n.save'), class: 'btn btn-success'

View file

@ -6,6 +6,11 @@ en:
breadcrumbs: "What you see up here are the bread crumbs for this
site. When you enter a new section, you will see the previous ones
and also have a path for where you\'re standing."
i18n:
index: "Here you can edit your site's texts that don't belong to a
post, like its description, sections, buttons... If you change
languages up there in the title to be the same, you can edit them.
If they're different, you can translate from one into the other."
sites:
index: 'This is the list of sites you can edit.'
edit_translations: "You can edit texts from your site other than

View file

@ -6,6 +6,12 @@ es:
breadcrumbs: 'Lo que ves arriba son las migas de pan de este sitio.
Cuando ingreses a una sección, podrás volver a las secciones
anteriores y además tener una ruta de donde estás parada.'
i18n:
index: 'Aquí puedes editar todos los textos del sitio que no se
corresponden con artículos, como la descripción, secciones, textos
de botones... Si cambias los idiomas arriba para que coincidan,
puedes editar los textos en el mismo idioma. Si los idiomas no
coinciden, puedes traducirlos de uno a otro.'
sites:
index: 'Este es el listado de sitios que puedes editar.'
edit_translations: 'Puedes editar los textos que salen en tu sitio
@ -71,8 +77,11 @@ es:
i18n:
index: 'Traducciones'
edit: 'Editar textos y traducciones'
edit_same: 'Editar textos en'
save: 'Guardar'
translate_into: '. Traducir a'
change: 'Cambiar'
translate: 'Traducir'
translating:
from: 'Traduciendo desde'
to: 'a'