translatable_routes 1.3.0 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b2256f5d2665216448f928603d879d42122731a
4
- data.tar.gz: f86433d26911d327f2780f7da73574d186f2a2b5
3
+ metadata.gz: ec25e210398145edc2a2021602b5a48b1ada634a
4
+ data.tar.gz: 1353d95eb6f9ff625a21d6749f36f16c4770a047
5
5
  SHA512:
6
- metadata.gz: 21dc6cad8305d32e45928efa48810a51d4d4f9f268bc35917d83e0c2eb01883fffd898bf774efa0388e33f05b2d1cab881cf9a9c35188863745ab7245fe81407
7
- data.tar.gz: a6496d72dc80f6d981c4106f782f559338ce2d6fc9f28923577ff59a98784490da4ba7dac800ada613dee7a06cafa667fd2f93b132d3023aaac748d339734d85
6
+ metadata.gz: 086e5600e84c582bce332e771f985b7ba6ba29c52a42b0e84aa2249c679c761e00ad815448d27296060ddbec7943f18ceafe7a56b1fc0eb2f001c2712e3311d0
7
+ data.tar.gz: 83ce66bba1083954613d1911cbf3734cf0e6c44001e98a1411aa4fcbf9d9e83d8272a0c30e18514ba479bdb069e096b322139c50fc4788cb56e5c75dba7d4e82
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2013 Museways
1
+ Copyright 2014 Museways
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -14,19 +14,28 @@ Then bundle:
14
14
 
15
15
  = Usage
16
16
 
17
- Inside each locale yaml file:
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
- login: "entrar"
27
+ about: "nosotros"
23
28
 
24
- (Please note each part of the path it's translated individually, you don't have to put translations for paths like "users/1/profile" just translate "users" and "profile", the plugin will do the rest)
25
-
26
- In your config/routes.rb use the localized block to decide wich routes will be translated:
27
- localized do
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
- The helpers inside views and controllers will continue working the same but I18n.locale will be use as default locale:
32
- about_path # /en/about
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
@@ -1,5 +1,5 @@
1
1
  module TranslatableRoutes
2
2
 
3
- VERSION = '1.3.0'
3
+ VERSION = '1.3.2'
4
4
 
5
5
  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.0
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-05-19 00:00:00.000000000 Z
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: '0'
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: '0'
41
- description: Minimalistic toolkit to handle translatable routes and detect locale
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: '0'
123
+ version: 1.9.3
119
124
  required_rubygems_version: !ruby/object:Gem::Requirement
120
125
  requirements:
121
126
  - - ">="