Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

Rails3 #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions 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.

Expand Down Expand Up @@ -42,21 +42,26 @@ 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
=========

- 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.

Expand Down
2 changes: 1 addition & 1 deletion views/layouts/translate.rhtml
Expand Up @@ -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");

Expand Down
4 changes: 2 additions & 2 deletions views/translate/index.rhtml
Expand Up @@ -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 %>
Expand Down