GithubHelp home page GithubHelp logo

dsandber / click-to-globalize Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jodosha/click-to-globalize

0.0 2.0 0.0 60 KB

Globalization made easy with interface in place translations

Home Page:

License: MIT License

click-to-globalize's Introduction

Click to Globalize

Click to Globalize is a Rails plugin, it allows to edit in place i18n labels.

If you have a previous i18n experience, you probably noticed that the
main problem of dedicated back-ends is the lack of the context where the
string will be placed in. It isn’t a trivial issue: you’ll never know if the
meaning of your string is harmonious with other labels and how your string will
be rendered, until the page load.

Now you can forget this issues, you can directly translate in place!!

Check for news and tutorials at the project home page.

Getting Started

  1. Install Click to Globalize:
    1. script/plugin install git://
    2. rake click:setup
  2. Add at the end of your layout the following code:
    1. <%= click_to_globalize -%>
  3. Put in your view:
    1. <%= t(:'hello_world') %>
  4. Start your server and click to globalize.


Click to Globalize is framework agnostic, it can talks with all the Rails
plugins who speak the i18n API, but please make sure
to use a persistent backend.
In fact, the default i18n backend shipped with Rails, rely on YAML files, this
means it doesn’t allow runtime translations modifications.

For this purpose, feel free to use my experimental globalize2 fork


  1. In place editing for each i18n string.
  2. Easy and painless plug-in/plug-out process.
  3. Unobtrusive Javascripts.
  4. Auto transformation from input text to textarea for long strings.

Advanced Features
You may wish to restrict the access to Click to Globalize features, if you don’t
everyone can edit your pages.
All you need to do is override the in_place_translations? method.

class ApplicationController < ActionController::Base def in_place_translations? current_user.admin? end end

NOTE: The old globalize? method has been deprecated.


script/plugin remove click-to-globalize

Old Rails applications

The current version of Click to Globalize targets Rails 2.3.x applications.
If your application uses former version, please check the following branches:

  1. for-2.0
  2. for-2.1

Common Issues

  1. Due to unobtrusive nature of the plugin, each page is parsed by javascript
    to find the right element and bind to it an Ajax.InPlaceEditor.
    Be sure your (X)HTML is wellformed.

NOTE: If you use the Rails scaffold system, Click to Globalize
doesn’t works. Cleanup the code before to use.

How To Contribute

  1. Check out the code and test it:
    1. git clone git://
    2. rake click
  2. Create a ticket to the Sushistar Lighthouse page
  3. Create a patch and add as attachment to the ticket.


Javascript tests are a custom implementation of the old Prototype test libs.

2007-2009 Luca Guidi, released under the MIT license

click-to-globalize's People


 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.