ceritium / lost-in-translation
- Source
- Commits
- Network (-1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
df2018f
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
README.rdoc | ||
| |
Rakefile | ||
| |
lib/ | ||
| |
lost-in-translation.gemspec | ||
| |
test/ |
LostInTranslation
Description
LostInTranslation es una pequeña gema que nos puede ayudar a mantener al día las traducciones en nuestras aplicaciones que tiren la API I18n de RAILS y que tengan como backend los ficheros yaml.
Installation
sudo gem install lost-in-translation
Uso
Su uso es muy sencillo, con solo dos comandos lineas ya puedes recorrer todo el directorio app de tu aplicación y añadir los traducción que anden sueltas al fichero _en.yaml_.
require 'lost_in_translation'
i18n = LostInTranslation.new
i18n.save_translations
También tienes otros métodos disponibles para configurar el idioma o el archivo de destino.
i18n = LostInTranslation.new
# Pone el español como el idioma de destino
i18n.locale = 'es'
# Si por ejemplo queremos almacenar las traducciónes en otro archivo, en este case será prueba_es.yaml
i18n.file = 'prueba_es'
i18n.save
TODO
- Tests
- Añadir a varios idiomas a la vez
- Traducir
Fedback
Se agradece todo el feedback posible, desde errores, casos de uso o posibles mejoras.
Blog: ceritium.net/476/programacion/rails/lost-in-translation
Correo: ceritium@gmail.com
Fork Me!
Agradecimientos
Al plugin Translate del que pillo algunos métodos. github.com/newsdesk/translate/tree/master
License
Copyright © 2009 José Galisteo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

