i18n_gui 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README ADDED
@@ -0,0 +1,2 @@
1
+ To use this gem you need to install redis and launch a server with "redis-server"
2
+ You can access to the gui at www.your-site.com/translations
@@ -0,0 +1,10 @@
1
+ class TranslationsController < ApplicationController
2
+ def index
3
+ @translations = TRANSLATION_STORE
4
+ end
5
+
6
+ def create
7
+ I18n.backend.store_translations(params[:locale], {params[:key] => params[:value]}, :escape => false)
8
+ redirect_to translations_url, :notice => "Added translation"
9
+ end
10
+ end
@@ -0,0 +1,21 @@
1
+ <h1>Translations</h1>
2
+
3
+ <ul>
4
+ <% @translations.keys.each do |key| %>
5
+ <li><%= key %>: <%= @translations[key] %></li>
6
+ <% end %>
7
+ </ul>
8
+
9
+ <h2>Add Translation</h2>
10
+
11
+ <%= form_tag translations_path do %>
12
+ <p>
13
+ <%= label_tag :locale %><br/>
14
+ <%= text_field_tag :key %>
15
+ </p>
16
+ <p>
17
+ <%= label_tag :value %> <br/>
18
+ <%= text_field_tag :value %>
19
+ </p>
20
+ <p><%= submit_tag "Submit" %></p>
21
+ <% end %>
@@ -0,0 +1,2 @@
1
+ TRANSLATION_STORE = Redis.new
2
+ I18n.backend = I18n::Backend::Chain.new(I18n::Backend::KeyValue.new(TRANSLATION_STORE), I18n.backend)
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do |map|
2
+ resources :translations
3
+ end
@@ -0,0 +1,8 @@
1
+ require "i18n_gui"
2
+ require "rails"
3
+
4
+ module I18nGui
5
+ class Engine < Rails::Engine
6
+ engine_name :i18n_gui
7
+ end
8
+ end
data/lib/i18n_gui.rb ADDED
@@ -0,0 +1 @@
1
+ require 'i18n_gui/engine' if defined?(Rails) && Rails::VERSION::MAJOR == 3
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: i18n_gui
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.3
6
+ platform: ruby
7
+ authors:
8
+ - Louis Wrobel
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-05-19 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: redis
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ description:
27
+ email:
28
+ executables: []
29
+
30
+ extensions: []
31
+
32
+ extra_rdoc_files:
33
+ - README
34
+ files:
35
+ - app/controllers/translations_controller.rb
36
+ - app/views/translations/index.html.erb
37
+ - config/initializers/i18n_backend.rb
38
+ - config/routes.rb
39
+ - lib/i18n_gui.rb
40
+ - lib/i18n_gui/engine.rb
41
+ - README
42
+ homepage:
43
+ licenses: []
44
+
45
+ post_install_message:
46
+ rdoc_options: []
47
+
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "0"
62
+ requirements: []
63
+
64
+ rubyforge_project:
65
+ rubygems_version: 1.8.2
66
+ signing_key:
67
+ specification_version: 3
68
+ summary: Graphic interface for i18n
69
+ test_files: []
70
+