Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Transforms gettext to I18n API and generate SimpleBackend locale file
Ruby
branch: master

This branch is 10 commits ahead of japetheape:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
rdoc
tasks
test
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

GettextToI18n
=============

This plugin will convert your complete Rails project from Gettext calls to the new i18n api calls introduced in Rails 2.2.2. NB: This plugin is higly experimental, so before running, BACKUP YOUR CODE. It will touch your code and things always can go wrong!


Example
=======
	<%=_("Some string that will be translated, into %{lan}" % {:lan => 'english'}) %>

will be converted into:

	<%=t(:message_0, :lan => 'english', :scope => [:controller, :controller_name]) %>

it will then place a entry:
	
	"Some string that will be translated, into {{lan}}"
	
in the standard.yml locale file it generates.


About namespaces
========
By default the plugin walks all files in the app directory. It places the message id's into namespaces. The namespace are divided like this: 

	Controllers: translation[:txt][:controller][:controller_name]
	Views: translation[:txt][:view][:view_colleciton_name]
	-> etc.
	
	

Usage
=======
To convert all your views, controllers and models to the new format.

	rake gettext_to_i18n:transform


Installation
=======
./script/plugin install git://github.com/japetheape/gettext_to_i18n.git



-------------
Copyright (c) 2008 Jaap van der Meer, released under the MIT license
Something went wrong with that request. Please try again.