This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Tue May 20 02:47:33 -0700 2008 | |
| |
README | Mon Jul 21 02:01:59 -0700 2008 | |
| |
about.yml | Mon Jul 21 02:01:59 -0700 2008 | |
| |
init.rb | ||
| |
install.rb | Mon May 12 05:24:18 -0700 2008 | |
| |
lib/ | Tue Aug 05 03:54:02 -0700 2008 | |
| |
tasks/ | Thu Jul 17 08:55:37 -0700 2008 | |
| |
templates/ | Wed Jul 16 22:31:26 -0700 2008 | |
| |
test/ | Tue Aug 05 02:01:56 -0700 2008 | |
| |
uninstall.rb | Mon May 12 05:24:18 -0700 2008 |
README
= ClickToGlobalize
Click to Globalize is an extension for Globalize plugin, it allows to edit in
place globalized labels. With this plugin you don't have to create a
globalization back-end, but just edit your interface in place!!
If you have a previous globalization 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 globalize in place!!
Check for news and tutorials at the {project home page}[http://www.lucaguidi.com/pages/click-to-globalize].
= Getting Started
1. Install Globalize[http://www.globalize-rails.org/].
2. Install Click To Globalize:
$ ./script/plugin install git://github.com/jodosha/click-to-globalize.git
rake click:setup
3. Edit config/click.yml
4. Add at the end of your layout the following code:
<%= click_to_globalize -%>
5. Put in your view:
<%= 'hello_world'.t %>
6. Start your server and click to globalize.
= Prerequisites
* Globalize plugin: www.globalize-rails.org.
* RedCloth gem (optional) for textile formatting.
* BlueCloth gem (optional) for markdown formatting.
= Install
1. Install Globalize, if you don't already done.
2. Install Click To Globalize:
Rails 2.1.x
$ ./script/plugin install git://github.com/jodosha/click-to-globalize.git
Rails 2.0.x
$ ./script/plugin install http://dev.23labs.net/svn/rails/plugins/click_to_globalize/trunk
Rails 1.2.x
$ ./script/plugin install http://dev.23labs.net/svn/rails/plugins/click_to_globalize/branches/for-1.2.x
3. Run the setup task:
$ rake click:setup
4. Run the tests (optional):
$ rake click:test
5. Edit config/click.yml adding the locales you wish to use in your application.
locales:
english: en-US
italian: it-IT
6. You can configure the default locale in config/click.yml
default: :english
7. If you like to use wiki-formatting styles, you could use textile (RedCloth)
or markdown (BlueCloth). Edit config/click.yml
formatting: textile
8. Personalize the access to the globalization features, overriding #globalize:
class ApplicationController < ActionController::Base
def globalize?
current_user.admin?
end
end
NOTE: #globalize? is method to turn on/off all the Click to Globalize features.
9. Add at the end of your layout the following code:
<%= click_to_globalize -%>
= Uninstall
1. $ ./script/plugin remove click-to-globalize
= Features
* In place editing for each globalized string.
* Easy and painless plug-in/plug-out process.
* Unobtrusive Javascripts.
* Textile and Markdown support.
* Auto transformation from input text to textarea for long strings.
= Common Issues
* Since the Globalize plugin creates folders like 'for-1.2', be sure to rename
the folder to 'globalize'.
* 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.
* If you use a wiki-formatting style it could be advisable to use #h to avoid
security problems (i.e. XSS).
<%= textilize(h('some_text'.t)) %>
* The official Globalize repository is still *not compatible with Rails 2.1*, use the {heythisisnate's
fork}[http://github.com/heythisisnate/globalize/tree] instead.
= Contribute
* Check out the code and test it:
$ git clone git://github.com/jodosha/click-to-globalize.git
$ rake click
* Create a ticket to the {Sushistar Lighthouse page}[http://sushistar.lighthouseapp.com]
* Create a patch and add as attachment to the ticket.
= Credits
Javascript tests are based on Prototype[http://prototypejs.org] test libs.
Copyright (c) 2007-2008 Luca Guidi - http://lucaguidi.com, released under the MIT license







