Giter Club home page Giter Club logo

translate's Introduction

Translate
=========

This plugin provides a web interface for translating Rails I18n texts (requires Rails 3 or higher, for rails 2.2 use the newsdesk-original) from one locale to another. The plugin has been tested only with the simple I18n backend that ships with Rails. I18n texts are read from and written to YAML files under config/locales.

To translate to a new locale you need to add a YAML file for that locale that contains the locale as the top key and at least one translation.

Please note that there are certain I18n keys that map to Array objects rather than strings and those are currently not dealt with by the translation UI. This means that Rails built in keys such as date.day_names need to be translated manually directly in the YAML file.

To get the translation UI to write the YAML files in UTF8 you need to install the ya2yaml gem.

The translation UI finds all I18n keys by extracting them from I18n lookups in your application source code. In addition it adds all :en and default locale keys from the I18n backend.

- Updated: Each string in the UI now has an "Auto Translate" link which will send the original text to Google Translate and will input the returned translation into the form field for further clean up and review prior to saving.


Rake Tasks
=========

In addition to the web UI this plugin adds the following rake tasks:

translate:lost_in_translation
translate:untranslated
translate:missing
translate:remove_obsolete_keys
translate:merge_keys
translate:google
translate:changed
translate:merge_keys
translate:google

The lost_in_translation task shows you any I18n keys in your code that are do not have translations in the YAML file for your default locale, i.e. config/locales/sv.yml.

The missing task shows you any I18n keys in your code that do not have translations in the YAML file for your default locale, i.e. config/locales/sv.yml.

The merge_keys task is supposed to be used in conjunction with Sven Fuch's Rails I18n TextMate bundle (http://github.com/svenfuchs/rails-i18n/tree/master). Texts and keys extracted with the TextMate bundle end up in the temporary file log/translations.yml. When you run the merge_keys rake task the keys are moved over to the corresponding I18n locale file, i.e. config/locales/sv.yml. The merge_keys task also checks for overwrites of existing keys by warning you that one of your extracted keys already exists with a different translation.

The google task is used for auto translating from one locale to another using Google Translate.

Installation
=========
Obtain the source with:

./script/plugin install git://github.com/newsdesk/translate.git 

To mount the plugin, add the following to your config/routes.rb file:

  scope '/translate' do
    match '/translate_list', :to => 'translate#index'
    match '/translate', :to => 'translate#translate'
    match '/translate_reload', :to => 'translate#reload', :as => 'translate_reload'
  end

Now visit /translate in your web browser to start translating.

Dependencies
=========

- Rails 3 or higher
- The ya2yaml gem if you want your YAML files written in UTF8 encoding.

Authors
=========

- Peter Marklund (programming)
- Joakim Westerlund (web design)
- Claudius Coenen (rails 3 adaption)

Many thanks to http://newsdesk.se for sponsoring the development of this plugin.

Copyright (c) 2009 Peter Marklund, released under the MIT license

translate's People

Contributors

elia avatar kek avatar kosmas58 avatar milann avatar moskyt avatar ozataman avatar timnilson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.