Add remote translation button

- Create partial to render remote translation button. This button will
  send remote_translations as json to remote translations controller.
- Add locales
- Add styles

Co-Authored-By: alessandro <agileontheweb@gmail.com>
This commit is contained in:
taitus
2019-01-25 16:12:59 +01:00
committed by voodoorai2000
parent 6ad294e71f
commit cbd7ab7179
4 changed files with 35 additions and 0 deletions

View File

@@ -474,6 +474,26 @@ header {
}
}
.remote-translations-button {
.callout {
margin: 0;
padding: rem-calc(6);
[type="submit"] {
background: none;
border: 0;
cursor: pointer;
font-weight: bold;
color: $brand;
&:hover {
text-decoration: underline;
}
}
}
}
.external-links {
float: none;
padding: rem-calc(6) 0;

View File

@@ -0,0 +1,11 @@
<div class="remote-translations-button callout primary text-center">
<% if display_remote_translation_button?(remote_translations) %>
<%= form_tag remote_translations_path do %>
<%= hidden_field_tag :remote_translations, remote_translations.to_json %>
<%= t("remote_translations.text") %>
<%= submit_tag t("remote_translations.button") %>
<% end %>
<% else %>
<%= t("remote_translations.all_remote_translations_enqueued_text") %>
<% end %>
</div>

View File

@@ -1034,5 +1034,7 @@ en:
borda: Borda votation
dowdall: Dowdall votation
remote_translations:
text: The content of this page is not available in your language
create:
enqueue_remote_translation: Translations have been correctly requested.
button: Translate page

View File

@@ -1031,5 +1031,7 @@ es:
borda: Votación con recuento Borda
dowdall: Votación con recuento Dowdall
remote_translations:
text: El contenido de esta página no está disponible en tu idioma
create:
enqueue_remote_translation: Se han solicitado correctamente las traducciones.
button: Traducir página