translatable_routes 1.3.0 → 1.3.2
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.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.rdoc +19 -10
- data/lib/translatable_routes/version.rb +1 -1
- data/test/dummy/config/initializers/secret_token.rb +1 -0
- metadata +14 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec25e210398145edc2a2021602b5a48b1ada634a
|
4
|
+
data.tar.gz: 1353d95eb6f9ff625a21d6749f36f16c4770a047
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 086e5600e84c582bce332e771f985b7ba6ba29c52a42b0e84aa2249c679c761e00ad815448d27296060ddbec7943f18ceafe7a56b1fc0eb2f001c2712e3311d0
|
7
|
+
data.tar.gz: 83ce66bba1083954613d1911cbf3734cf0e6c44001e98a1411aa4fcbf9d9e83d8272a0c30e18514ba479bdb069e096b322139c50fc4788cb56e5c75dba7d4e82
|
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -14,19 +14,28 @@ Then bundle:
|
|
14
14
|
|
15
15
|
= Usage
|
16
16
|
|
17
|
-
|
17
|
+
In your config/routes.rb use the localized method to decide wich routes will be localized:
|
18
|
+
localized do
|
19
|
+
get 'about' => 'pages#about'
|
20
|
+
end
|
21
|
+
|
22
|
+
Put your translations inside the routes key in your locales yamls:
|
18
23
|
es:
|
19
24
|
routes:
|
20
25
|
users: "usuarios"
|
21
26
|
profile: "perfil"
|
22
|
-
|
27
|
+
about: "nosotros"
|
23
28
|
|
24
|
-
(
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
get 'about' => 'pages#about'
|
29
|
-
end
|
29
|
+
(There is no need to put the full path "users/1/profile", just translate each slug individually)
|
30
|
+
|
31
|
+
Helpers will continue working the same but I18n.locale will be use as default locale:
|
32
|
+
about_path # /en/about in case I18n.locale is :en
|
30
33
|
|
31
|
-
|
32
|
-
|
34
|
+
This gem will not provide a default locale selection, since you may be interested in differente types of logics, you should add it manually. Here it's a very simple example:
|
35
|
+
before_action :select_locale
|
36
|
+
|
37
|
+
protected
|
38
|
+
|
39
|
+
def select_locale
|
40
|
+
I18n.locale = params[:locale]
|
41
|
+
end
|
@@ -9,4 +9,5 @@
|
|
9
9
|
|
10
10
|
# Make sure your secret_key_base is kept private
|
11
11
|
# if you're sharing your code publicly.
|
12
|
+
Dummy::Application.config.secret_token = '94bacb757cb090cba6681745bdf0b277d02b62765f5a593cf267c51ec4d2c138c51a1c414fa82a1d8b5429db29926ec56bcacbab6c2e1e74492c8c0274b65077'
|
12
13
|
Dummy::Application.config.secret_key_base = '94bacb757cb090cba6681745bdf0b277d02b62765f5a593cf267c51ec4d2c138c51a1c414fa82a1d8b5429db29926ec56bcacbab6c2e1e74492c8c0274b65077'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: translatable_routes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Museways
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.2.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 4.2.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,22 +27,24 @@ dependencies:
|
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 3.2.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 4.2.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: sqlite3
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
39
|
+
version: '1.3'
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
|
-
- - "
|
44
|
+
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
41
|
-
description: Minimalistic toolkit to
|
42
|
-
from subdomain or prefix.
|
46
|
+
version: '1.3'
|
47
|
+
description: Minimalistic toolkit to translate routes.
|
43
48
|
email:
|
44
49
|
- contact@museways.com
|
45
50
|
executables: []
|
@@ -115,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
120
|
requirements:
|
116
121
|
- - ">="
|
117
122
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
123
|
+
version: 1.9.3
|
119
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
125
|
requirements:
|
121
126
|
- - ">="
|