i18n_backend_database3 0.0.1.alpha
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +1 -0
- data/i18n_backend_database3.gemspec +29 -0
- data/lib/config/routes.rb +5 -0
- data/lib/generators/migration_generator.rb +5 -0
- data/lib/generators/templates/create_i18n_tables.rb +25 -0
- data/lib/i18n_backend_database3.rb +5 -0
- data/lib/i18n_backend_database3/engine.rb +13 -0
- data/lib/i18n_backend_database3/version.rb +3 -0
- metadata +113 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "i18n_backend_database3/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "i18n_backend_database3"
|
7
|
+
s.version = I18nBackendDatabase3::VERSION
|
8
|
+
s.authors = ["Bernie Telles"]
|
9
|
+
s.email = ["btelles@gmail.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{Database Backend for Rails I18n}
|
12
|
+
s.description = %q{This is a port of dylanz's rails plugin by the same name, over to a Rails 3 compatible gem. It:
|
13
|
+
|
14
|
+
Stores your translations in the database, rather than yaml files.
|
15
|
+
As you tag items with i18n.t() throughout your code base, all untranslated items are marked and added to the database.
|
16
|
+
An admin panel is provided so translators can quickly translate untranslated text.
|
17
|
+
All lookups occur in a cache store of your choice prior to hitting the database.}
|
18
|
+
|
19
|
+
s.rubyforge_project = "i18n_backend_database3"
|
20
|
+
|
21
|
+
s.files = `git ls-files`.split("\n")
|
22
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
23
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
24
|
+
s.require_paths = ["lib"]
|
25
|
+
|
26
|
+
s.add_dependency 'rails', '~> 3.0.0'
|
27
|
+
|
28
|
+
s.add_development_dependency 'rspec'
|
29
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class CreateI18nTables < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :locales do |t|
|
4
|
+
t.string :code
|
5
|
+
t.string :name
|
6
|
+
end
|
7
|
+
add_index :locales, :code
|
8
|
+
|
9
|
+
create_table :translations do |t|
|
10
|
+
t.string :key
|
11
|
+
t.text :raw_key
|
12
|
+
t.text :value
|
13
|
+
t.integer :pluralization_index, :default => 1
|
14
|
+
t.integer :locale_id
|
15
|
+
end
|
16
|
+
add_index :translations, [:locale_id, :key, :pluralization_index]
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.down
|
21
|
+
drop_table :locales
|
22
|
+
drop_table :translations
|
23
|
+
drop_table :asset_translations
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module I18nBackendDatabase3
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
paths.app.controllers << "lib/app/controllers"
|
4
|
+
paths.app.helpers << "lib/app/helpers"
|
5
|
+
paths.app.models << "lib/app/models"
|
6
|
+
paths.app.views << "lib/app/views"
|
7
|
+
paths.config.routes = "lib/config/routes.rb"
|
8
|
+
|
9
|
+
initializer "static assets" do |app|
|
10
|
+
app.middleware.use ::ActionDispatch::Static, "#{root}/public"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: i18n_backend_database3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 296151482
|
5
|
+
prerelease: 6
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
- alpha
|
11
|
+
version: 0.0.1.alpha
|
12
|
+
platform: ruby
|
13
|
+
authors:
|
14
|
+
- Bernie Telles
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2011-07-19 00:00:00 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rails
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 3.0.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rspec
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
version: "0"
|
49
|
+
type: :development
|
50
|
+
version_requirements: *id002
|
51
|
+
description: |-
|
52
|
+
This is a port of dylanz's rails plugin by the same name, over to a Rails 3 compatible gem. It:
|
53
|
+
|
54
|
+
Stores your translations in the database, rather than yaml files.
|
55
|
+
As you tag items with i18n.t() throughout your code base, all untranslated items are marked and added to the database.
|
56
|
+
An admin panel is provided so translators can quickly translate untranslated text.
|
57
|
+
All lookups occur in a cache store of your choice prior to hitting the database.
|
58
|
+
email:
|
59
|
+
- btelles@gmail.com
|
60
|
+
executables: []
|
61
|
+
|
62
|
+
extensions: []
|
63
|
+
|
64
|
+
extra_rdoc_files: []
|
65
|
+
|
66
|
+
files:
|
67
|
+
- .gitignore
|
68
|
+
- Gemfile
|
69
|
+
- Rakefile
|
70
|
+
- i18n_backend_database3.gemspec
|
71
|
+
- lib/config/routes.rb
|
72
|
+
- lib/generators/migration_generator.rb
|
73
|
+
- lib/generators/templates/create_i18n_tables.rb
|
74
|
+
- lib/i18n_backend_database3.rb
|
75
|
+
- lib/i18n_backend_database3/engine.rb
|
76
|
+
- lib/i18n_backend_database3/version.rb
|
77
|
+
homepage: ""
|
78
|
+
licenses: []
|
79
|
+
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options: []
|
82
|
+
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 3
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
version: "0"
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ">"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
hash: 25
|
100
|
+
segments:
|
101
|
+
- 1
|
102
|
+
- 3
|
103
|
+
- 1
|
104
|
+
version: 1.3.1
|
105
|
+
requirements: []
|
106
|
+
|
107
|
+
rubyforge_project: i18n_backend_database3
|
108
|
+
rubygems_version: 1.8.5
|
109
|
+
signing_key:
|
110
|
+
specification_version: 3
|
111
|
+
summary: Database Backend for Rails I18n
|
112
|
+
test_files: []
|
113
|
+
|