Skip to content

Commit

Permalink
Merge pull request linuxmint#323 from Odyseus/0dyseus@PopupTranslator
Browse files Browse the repository at this point in the history
Popup Translator (0dyseus@PopupTranslator) update
  • Loading branch information
brownsr committed Apr 17, 2017
2 parents 4b81103 + 9814143 commit 25fc01b
Show file tree
Hide file tree
Showing 4 changed files with 421 additions and 16 deletions.
66 changes: 65 additions & 1 deletion 0dyseus@PopupTranslator/HELP.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,76 @@ html
title Popup Translator applet help
link(rel='shortcut icon', type='image/x-icon', href='./icon.png')
meta(name='viewport', content='width=device-width, initial-scale=1')

script(type='text/javascript')
include ../../docs/lib/js/localizations-handler.js

style(type='text/css')
include ../../docs/lib/css/bootstrap-for-standalone.min.css
include ../../docs/lib/css/tweaks.css

style(type='text/css').
.localization-chooser {
padding: 1em !important;
width: 100% !important;
}

.localization-chooser input.btn {
font-weight: bold !important;
margin: 5px !important;
height: 100% !important;
display: inline-block !important;
}

body
noscript
style(type='text/css').
#autohide_navbar {
display: none !important;
}
#noscript-navbar {
display: inline-block !important;
}
#noscript-navbar > li {
float: left !important;
margin: 2px !important;
padding: 2px !important;
top: 0 !important;
display: inline-block !important;
}
#noscript-navbar li > ul {
margin: 1px !important;
padding: 1px !important;
}
#noscript-navbar li {
list-style: none !important;
list-style-type: none !important;
}

.alert.alert-warning
p: strong Oh snap! This page needs JavaScript enabled to display correctly.
p: strong This page uses JavaScript only to switch between the available languages.
p: strong There are no tracking services of any kind and never will be (at least, not from my side).

div#mainarea
.localization-chooser(align="middle")
input(type='button', class='btn btn-success btn-sm localization-switch' value='English' data-id='english' data-title='Popup Translator applet help' onclick='self.toggleLocalizationVisibility(this);')
input(type='button', class='btn btn-default btn-sm localization-switch' value='Español' data-id='spanish' data-title='Ayuda para el applet Traductor emergente' onclick='self.toggleLocalizationVisibility(this);')
//- Example:
//- input(type='button', class='btn btn-default btn-sm localization-switch' value='language-endonym' data-id='language-name' data-title='page-title' onclick='self.toggleLocalizationVisibility(this);')
//- language-endonym = Language name in the language tongue in capital case (if apply).
//- language-name = Language name in English and in lower case.
//- page-title = The translated page title.
.container.boxed
#english.localization-content
include:markdown-it(html) docs/HELP.md
#spanish.localization-content.hidden
include:markdown-it(html) docs/HELP-es.md
//- Example:
//- #language-name.localization-content.hidden
//- include:markdown-it(html) docs/HELP-language-code.md
//- language-name = Language name in English and in lower case. The same used on the input.
//- language-code = The code of the language used on the translated file.
include:markdown-it(html) HELP.md
script(type='text/javascript').
toggleLocalizationVisibility(null);
91 changes: 91 additions & 0 deletions 0dyseus@PopupTranslator/docs/HELP-es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

# Ayuda para el applet Traductor Emergente

### ¡IMPORTANTE!
Jamás borrar ninguno de los archivos encontrados dentro de la carpeta de este xlet. Podría romper la funcionalidad del xlet.

***

<h2 style="color:red;">Reportes de fallos, peticiones de características y contribuciones</h2>
<span style="color:red;">
Si cualquiera tiene fallos que reportar, peticiones de características y contribuciones, deben realizarlas <a href="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/Odyseus/CinnamonTools">en la página de GitHub de este xlet</a>.
</span>

***

### Dependencias

**Si una o más de estas dependencias faltan en su sistema, no podrá utilizar este applet.**

- Comando **xsel**: XSel es un programa de la consola para obtener y asignar los contenidos de una selección en X.
- Distribuciones basadas en Debian y Archlinux: El paquete es llamado **xsel**.
- Comando **xdg-open**: Abre una URI en la aplicación preferida por el usuario que puede manejar la URI o tipo de archivo respectivo.
- Distribuciones basadas en Debian y Archlinux: Este comando es instalado por el paquete llamado **xdg-utils**. Instalado por defecto en todas las versiones modernas de Linux Mint.
- **Python 3**: Debería estar ya instalado en todas las distribuciones Linux.
- **requests**, módulo Python 3: Requests permite enviar peticiones HTTP/1.1. Se pueden agregar encabezados, datos de formulario, archivos multi-parte y parámetros con simples diccionarios Python, y acceder a los datos recibidos de la misma manera.
- Distribuciones basadas en Debian: Este comando es instalado por el paquete llamado **python3-requests**. Instalado por defecto en todas las versiones modernas de Linux Mint.
- Distribuciones basadas en Archlinux: El paquete es llamado **python-requests**.

**Luego de instalar cualquiera de las dependencias faltantes, Cinnamon necesita ser reiniciado**

**Nota:** Yo no utilizo ningún otro tipo de distribución Linux (basada en Gentoo, basada en Slackware, etc.). Si cualquiera de los paquetes/módulos previamente nombrados son llamados de forma diferente, por favor, háganmelo saber y los especificaré en este archivo de ayuda.

***

### Uso del applet

Existen 4 *mecanismos de traducción* diferentes (**Clic izquierdo**, **Clic medio**, **Atajo de teclado #1** y **Atajo de teclado #2**). Cada mecanismo de traducción puede ser configurado con sus propios servicios de traducción, par de lenguajes y atajos de teclado.

- **Primer mecanismo de traducción (Clic izquierdo):** Traduce cualquier texto seleccionado desde cualquier aplicación en el sistema. Un atajo de teclado puede ser asignado para realizar esta tarea.
- **Primer mecanismo de traducción (<kbd>Ctrl</kbd> + Clic izquierdo):** Igual que **Clic izquierdo**, pero el historial de traducciones será ignorado. Un atajo de teclado puede ser asignado para realizar esta tarea.
- **Segundo mecanismo de traducción (Clic medio):** Igual que **Clic izquierdo**.
- **Segundo mecanismo de traducción (<kbd>Ctrl</kbd> + Clic medio):** Igual que **<kbd>Ctrl</kbd> + Clic izquierdo**.
- **Tercer mecanismo de traducción (Atajo de teclado #1):** Dos atajos de teclado pueden ser configurados para realizar una traducción y una traducción forzada.
- **Tercer mecanismo de traducción (Atajo de teclado #2):** Dos atajos de teclado pueden ser configurados para realizar una traducción y una traducción forzada.

Todas las traducciones son guardadas en el historial de traducciones. Si una cadena de texto ya fue traducida en el pasado, el menú emergente mostrará esa cadena de texto guardada sin hacer uso del servicio de traducción del proveedor.

***

### Sobre el historial de traducción

He creado el mecanismo del historial de traducciones mayormente para evitar el abuso de los servicios de traducción.

- Si el servicio de Google Translate is *abusado*, Google puede que bloquee temporalmente su IP. O lo que es peor, ellos podrían cambiar el mecanismo de traducción usado haciendo este applet inútil y obligándome a actualizar su código.
- Si el servicio de Yandex Translate is *abusado*, usted está *desperdiciando* la cuota de sus llaves de la API y estas serán bloqueadas (temporalmente o permanentemente).

En el menú contextual de este applet existe un ítem que permite abrir la carpeta donde el historial de traducciones está guardado. Desde allí, el archivo de historial puede ser respaldado o incluso borrado.

**¡NUNCA editar el archivo de historial manualmente!**

**Si el archivo de historial es borrado/renombrado/movido, Cinnamon necesita ser reiniciado.**

***

### ¿Cómo obtener llaves de API para Yandex translator?

- Visitar uno de los enlaces siguientes y registrar una cuenta de Yandex (o usar uno de los servicios sociales disponibles).
- **Inglés:** https://tech.yandex.com/keys/get/?service=trnsl
- **Ruso:** https://tech.yandex.ru/keys/get/?service=trnsl
- Una vez creada exitosamente la cuenta de Yandex, El enlace proveído anteriormente puede ser visitado varias veces para obtener varias llaves de API. **¡NO ABUSAR!**
- Una vez que se tengan varias llaves de API, ellas pueden ser agregadas a la ventana de configuración de Traductor Emergente (una llave de API por linea).

#### Notas importantes sobre llaves de API Yandex

- Las llaves de API son guardadas en una preferencia. Mantener las llaves de API respaldadas en el caso de que la preferencias de Traductor Emergente sean reiniciadas.
- **¡NUNCA hacer públicas las llaves de API!** El propósito de tomarse la molestia de obtener nuestras propias llaves de API es que el único que *consuma sus límites* es uno y nadie más.
- Con cada llave de API de Yandex Translator uno puede traducir **HASTA** 1.000.000 (1 millón) de caracteres por día **PERO NO MÁS** de 10.000.000 (10 millones) por mes.

***

### Localización de applets/desklets/extensiones (también conocidos como xlets)

- Si este xlet se instaló desde Configuración de Cinnamon, todas las localizaciones de este xlet se instalaron automáticamente.
- Si este xlet se instaló manualmente y no a través de Configuración de Cinnamon, las localizaciones se pueden instalar ejecutando el archivo llamado **localizations.sh** desde una terminal abierta dentro de la carpeta del xlet.
- Si este xlet no está disponible en su idioma, la localización puede ser creada siguiendo [estas instrucciones](https://github.com/Odyseus/CinnamonTools/wiki/Xlet-localization) y luego enviarme el archivo .po.
- Si se posee una cuenta de GitHub:
- Puede enviar una "pull request" con el nuevo archivo de localización.
- Si no se desea clonar el repositorio, simplemente crear un [Gist](https://gist.github.com/) y enviarme el enlace.
- Si no se posee o no se quiere una cuenta de GitHub:
- Se puede enviar un [Pastebin](https://pastebin.com/) (o servicio similar) a mi [cuenta en el for de Linux Mint](https://forums.linuxmint.com/memberlist.php?mode=viewprofile&u=164858).
- Si el texto fuente (en Inglés) y/o mi traducción al Español contiene errores o inconsistencias, no dude en informarlos.
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@

<!--
Notes to translators:
- Do not modify this file directly. Create a copy of it with a different name that contains the language code and always use the .md extension for the file. Example: HELP-es.md file will contain the content of the HELP.md file translated into Spanish.
- This file is written in [markdown](https://guides.github.com/features/mastering-markdown/) and some "touches" of HTML.
- Familiarize yourself with markdown and HTML languages before attempting to translate the content of this file.
- These notes doesn't need to be translated and can be deleted from the translated file.
-->

# Help for Popup Translator applet

### IMPORTANT!!!
Never delete any of the files found inside this applet folder. It might break this applet functionality.
Never delete any of the files found inside this xlet folder. It might break this xlet functionality.

***

Expand Down Expand Up @@ -78,14 +86,14 @@ In the context menu of this applet is an item that can open the folder were the

***

### Applet localization
### Applets/Desklets/Extensions (a.k.a. xlets) localization

- If this applet was installed from Cinnamon Settings, all of this applet's localizations were automatically installed.
- If this applet was installed manually and not trough Cinnamon Settings, localizations can be installed by executing the script called **localizations.sh** from a terminal opened inside the applet's folder.
- If this applet has no locale available for your language, you could create it by following [these instructions](https://github.com/Odyseus/CinnamonTools/wiki/Xlet-localization) and send the .po file to me.
- If this xlet was installed from Cinnamon Settings, all of this xlet's localizations were automatically installed.
- If this xlet was installed manually and not trough Cinnamon Settings, localizations can be installed by executing the script called **localizations.sh** from a terminal opened inside the xlet's folder.
- If this xlet has no locale available for your language, you could create it by following [these instructions](https://github.com/Odyseus/CinnamonTools/wiki/Xlet-localization) and send the .po file to me.
- If you have a GitHub account:
- You could send a pull request with the new locale file.
- If you don't want to clone the repository, just create a Gist and send me the link.
- If you don't want to clone the repository, just create a [Gist](https://gist.github.com/) and send me the link.
- If you don't have/want a GitHub account:
- You can send me a [Pastebin](https://pastebin.com/) (or similar service) to my [Mint Forums account](https://forums.linuxmint.com/memberlist.php?mode=viewprofile&u=164858).
- If the source text (in English) and/or my translation to Spanish has errors/inconsistencies, feel free to report them.
Loading

0 comments on commit 25fc01b

Please sign in to comment.