Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Rails3 #11

Open
wants to merge 1 commit into from

3 participants

@ccoenen

just a quick fix for rails 3 support. I was just testing the plugin, and i think it's a great help.

@dimir

Thanks man. One problem with Rails 3.0 though. How to setup routes since there is no "map" command?

@kivanio

you can just add map in block:


Roadtracker::Application.routes.draw do |map|
Translate::Routes.translation_ui(map) if RAILS_ENV != "production"

it does not make normal rails3 routes stop work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 23, 2010
  1. basic fixes for rails 3 - so far it's working

    Claudius Coenen authored
This page is out of date. Refresh to see the latest.
View
11 README
@@ -1,7 +1,7 @@
Translate
=========
-This plugin provides a web interface for translating Rails I18n texts (requires Rails 2.2 or higher) 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.
+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.
@@ -42,14 +42,18 @@ Obtain the source with:
To mount the plugin, add the following to your config/routes.rb file:
-Translate::Routes.translation_ui(map) if RAILS_ENV != "production"
+ 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 2.2 or higher
+- Rails 3 or higher
- The ya2yaml gem if you want your YAML files written in UTF8 encoding.
Authors
@@ -57,6 +61,7 @@ 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.
View
2  views/layouts/translate.rhtml
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title><%= h(@page_title) %></title>
- <%= translate_javascript_includes %>
+ <%= translate_javascript_includes.html_safe %>
<script type="text/javascript">
google.load("language", "1");
View
4 views/translate/index.rhtml
@@ -8,10 +8,10 @@
<legend>Search filter</legend>
<div id="show-sort">
<p>
- <label>Show:</label> <%= simple_filter(show_filters) %>
+ <label>Show:</label> <%= simple_filter(show_filters).html_safe %>
</p>
<p>
- <label>Sort by:</label> <%= simple_filter(["key", "text"], 'sort_by') %>
+ <label>Sort by:</label> <%= simple_filter(["key", "text"], 'sort_by').html_safe %>
</p>
</div>
<% form_tag(params, :method => :get) do %>
Something went wrong with that request. Please try again.