translatable_routes 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +19 -9
- data/lib/translatable_routes.rb +0 -1
- data/lib/translatable_routes/action_dispatch/mapper.rb +22 -8
- data/lib/translatable_routes/action_dispatch/named_route_collection.rb +1 -1
- data/lib/translatable_routes/version.rb +1 -1
- data/test/dummy/log/test.log +135 -0
- data/test/helpers_test.rb +37 -7
- data/test/routes_test.rb +17 -7
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be4091ea73bb827796addc31258c8be2796284cc
|
4
|
+
data.tar.gz: eeeee1ab0fb27a8072d7f8a939ff877cde527c1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 062244dd2bb527f8f94bf4bea9da1dcd8af0660a852a91ea1fd3484848f43f3b4e5ccc9d6bdf6fffae6423a14ee9e5966a40d398a1306c44ea256e049b411f73
|
7
|
+
data.tar.gz: 559de805002e6d4afb6d7128ca57ec9a56b7d53803ebf56298f3df4db84fe9a9178a207d6dbdddb6b5eac209e0541b23eea079aa03f67a34207d27f6bac0a3c0
|
data/README.rdoc
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
{<img src="https://badge.fury.io/rb/translatable_routes.png" alt="Gem Version" />}[http://badge.fury.io/rb/translatable_routes] {<img src="https://codeclimate.com/github/museways/translatable_routes.png" />}[https://codeclimate.com/github/museways/translatable_routes] {<img src="https://travis-ci.org/museways/translatable_routes.png?branch=master" alt="Build Status" />}[https://travis-ci.org/museways/translatable_routes]
|
1
|
+
{<img src="https://badge.fury.io/rb/translatable_routes.png" alt="Gem Version" />}[http://badge.fury.io/rb/translatable_routes] {<img src="https://codeclimate.com/github/museways/translatable_routes.png" />}[https://codeclimate.com/github/museways/translatable_routes] {<img src="https://travis-ci.org/museways/translatable_routes.png?branch=master" alt="Build Status" />}[https://travis-ci.org/museways/translatable_routes]
|
2
2
|
|
3
3
|
= Translatable Routes
|
4
4
|
|
5
|
-
Minimalistic toolkit to translate routes.
|
5
|
+
Minimalistic toolkit to translate routes in rails.
|
6
6
|
|
7
7
|
= Install
|
8
8
|
|
9
9
|
Put this line in your Gemfile:
|
10
10
|
gem 'translatable_routes'
|
11
|
-
|
11
|
+
|
12
12
|
Then bundle:
|
13
13
|
$ bundle
|
14
|
-
|
15
|
-
=
|
14
|
+
|
15
|
+
= Configuration
|
16
16
|
|
17
17
|
In your config/routes.rb use the localized method to decide wich routes will be localized:
|
18
18
|
localized do
|
@@ -25,13 +25,15 @@ Put your translations inside the routes key in your locales yamls:
|
|
25
25
|
users: "usuarios"
|
26
26
|
profile: "perfil"
|
27
27
|
about: "nosotros"
|
28
|
-
|
29
|
-
|
28
|
+
|
29
|
+
NOTE: There is no need to put the full path, just translate each part individually.
|
30
|
+
|
31
|
+
= Usage
|
30
32
|
|
31
33
|
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
|
34
|
+
about_path # Will output /en/about in case I18n.locale is :en
|
33
35
|
|
34
|
-
|
36
|
+
Here is an example of what you may want to add to your controllers to select the current locale:
|
35
37
|
before_action :select_locale
|
36
38
|
|
37
39
|
protected
|
@@ -39,3 +41,11 @@ This gem will not provide a default locale selection, since you may be intereste
|
|
39
41
|
def select_locale
|
40
42
|
I18n.locale = params[:locale]
|
41
43
|
end
|
44
|
+
|
45
|
+
= Credits
|
46
|
+
|
47
|
+
This gem is maintained and funded by museways[http://museways.com].
|
48
|
+
|
49
|
+
= License
|
50
|
+
|
51
|
+
It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/lib/translatable_routes.rb
CHANGED
@@ -8,16 +8,22 @@ module TranslatableRoutes
|
|
8
8
|
scope(':locale') { yield }
|
9
9
|
@locales = nil
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def add_route(action, options)
|
13
13
|
if @locales
|
14
14
|
@locales.each do |locale|
|
15
|
-
|
16
|
-
|
15
|
+
if @scope[:scope_level_resource]
|
16
|
+
original_scope_level_resource = @scope[:scope_level_resource].dup
|
17
|
+
end
|
18
|
+
if @scope[:path]
|
19
|
+
original_path = @scope[:path].dup
|
20
|
+
end
|
17
21
|
original_path_names = @scope[:path_names].dup
|
18
22
|
original_options = options.dup
|
19
23
|
@scope[:path] = i18n_path(@scope[:path], locale)
|
20
|
-
@scope[:path_names].each
|
24
|
+
@scope[:path_names].each do |key, value|
|
25
|
+
@scope[:path_names][key] = i18n_path(value, locale)
|
26
|
+
end
|
21
27
|
options[:path] = i18n_path(options[:path], locale)
|
22
28
|
options[:constraints] = { locale: locale.to_s }
|
23
29
|
options[:defaults] = { locale: locale.to_s }
|
@@ -33,8 +39,12 @@ module TranslatableRoutes
|
|
33
39
|
options[:as] = "#{options[:as] || action}_#{locale}"
|
34
40
|
end
|
35
41
|
super i18n_path(action, locale), options
|
36
|
-
|
37
|
-
|
42
|
+
if @scope[:scope_level_resource]
|
43
|
+
@scope[:scope_level_resource] = original_scope_level_resource
|
44
|
+
end
|
45
|
+
if @scope[:path]
|
46
|
+
@scope[:path] = original_path
|
47
|
+
end
|
38
48
|
@scope[:path_names] = original_path_names
|
39
49
|
options = original_options
|
40
50
|
end
|
@@ -51,14 +61,18 @@ module TranslatableRoutes
|
|
51
61
|
end
|
52
62
|
|
53
63
|
protected
|
54
|
-
|
64
|
+
|
55
65
|
def i18n_path(path, locale)
|
56
66
|
case path
|
57
67
|
when String
|
58
68
|
i18n_path = []
|
59
69
|
path.split('/').each do |part|
|
60
70
|
next if part == ''
|
61
|
-
|
71
|
+
if part[0] == ':' or part[0] == '*'
|
72
|
+
i18n_path << part
|
73
|
+
else
|
74
|
+
i18n_path << I18n.t("routes.#{part}", locale: locale, default: part.gsub(/_/, '-'))
|
75
|
+
end
|
62
76
|
end
|
63
77
|
i18n_path.join('/')
|
64
78
|
when Symbol
|
@@ -7,7 +7,7 @@ module TranslatableRoutes
|
|
7
7
|
%w(path url).each do |type|
|
8
8
|
helper = :"#{name}_#{type}"
|
9
9
|
@module.remove_possible_method helper
|
10
|
-
@module.module_eval do
|
10
|
+
@module.module_eval do
|
11
11
|
define_method helper do |*args|
|
12
12
|
options = args.extract_options!
|
13
13
|
suffix = (options[:locale] || I18n.locale).to_s.gsub('-', '_').downcase
|
data/test/dummy/log/test.log
CHANGED
@@ -6359,3 +6359,138 @@ RoutesTest: test_should_translate_routes
|
|
6359
6359
|
HelpersTest: test_should_create_helpers
|
6360
6360
|
---------------------------------------
|
6361
6361
|
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
6362
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
6363
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
6364
|
+
[1m[36m (0.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6365
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
6366
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
6367
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6368
|
+
---------------------------------
|
6369
|
+
RoutesTest: test_translate_routes
|
6370
|
+
---------------------------------
|
6371
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6372
|
+
[1m[35m (0.0ms)[0m begin transaction
|
6373
|
+
--------------------------------
|
6374
|
+
HelpersTest: test_create_helpers
|
6375
|
+
--------------------------------
|
6376
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
6377
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
6378
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
6379
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6380
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
6381
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
6382
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6383
|
+
---------------------------------
|
6384
|
+
RoutesTest: test_translate_routes
|
6385
|
+
---------------------------------
|
6386
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6387
|
+
[1m[35m (0.0ms)[0m begin transaction
|
6388
|
+
--------------------------------
|
6389
|
+
HelpersTest: test_create_helpers
|
6390
|
+
--------------------------------
|
6391
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6392
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
6393
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
6394
|
+
[1m[36m (0.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6395
|
+
[1m[35m (0.0ms)[0m SELECT version FROM "schema_migrations"
|
6396
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
6397
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6398
|
+
---------------------------------
|
6399
|
+
RoutesTest: test_translate_routes
|
6400
|
+
---------------------------------
|
6401
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
6402
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6403
|
+
--------------------------------
|
6404
|
+
HelpersTest: test_create_helpers
|
6405
|
+
--------------------------------
|
6406
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6407
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
6408
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
6409
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6410
|
+
[1m[35m (0.0ms)[0m SELECT version FROM "schema_migrations"
|
6411
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
6412
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6413
|
+
---------------------------------
|
6414
|
+
RoutesTest: test_translate_routes
|
6415
|
+
---------------------------------
|
6416
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6417
|
+
[1m[35m (0.0ms)[0m begin transaction
|
6418
|
+
--------------------------------
|
6419
|
+
HelpersTest: test_create_helpers
|
6420
|
+
--------------------------------
|
6421
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6422
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
6423
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
6424
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6425
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
6426
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
6427
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6428
|
+
---------------------------------
|
6429
|
+
RoutesTest: test_translate_routes
|
6430
|
+
---------------------------------
|
6431
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6432
|
+
[1m[35m (0.0ms)[0m begin transaction
|
6433
|
+
--------------------------------
|
6434
|
+
HelpersTest: test_create_helpers
|
6435
|
+
--------------------------------
|
6436
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6437
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
6438
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
6439
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6440
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
6441
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
6442
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6443
|
+
--------------------------------
|
6444
|
+
HelpersTest: test_create_helpers
|
6445
|
+
--------------------------------
|
6446
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
6447
|
+
[1m[35m (0.0ms)[0m begin transaction
|
6448
|
+
---------------------------------
|
6449
|
+
RoutesTest: test_translate_routes
|
6450
|
+
---------------------------------
|
6451
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6452
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
6453
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
6454
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6455
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
6456
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
6457
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6458
|
+
--------------------------------
|
6459
|
+
HelpersTest: test_create_helpers
|
6460
|
+
--------------------------------
|
6461
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
6462
|
+
[1m[35m (0.0ms)[0m begin transaction
|
6463
|
+
---------------------------------
|
6464
|
+
RoutesTest: test_translate_routes
|
6465
|
+
---------------------------------
|
6466
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6467
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
6468
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
6469
|
+
[1m[36m (0.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6470
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
6471
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
6472
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6473
|
+
---------------------------------
|
6474
|
+
RoutesTest: test_translate_routes
|
6475
|
+
---------------------------------
|
6476
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6477
|
+
[1m[35m (0.0ms)[0m begin transaction
|
6478
|
+
--------------------------------
|
6479
|
+
HelpersTest: test_create_helpers
|
6480
|
+
--------------------------------
|
6481
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
6482
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
6483
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
6484
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6485
|
+
[1m[35m (0.0ms)[0m SELECT version FROM "schema_migrations"
|
6486
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
6487
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6488
|
+
--------------------------------
|
6489
|
+
HelpersTest: test_create_helpers
|
6490
|
+
--------------------------------
|
6491
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6492
|
+
[1m[35m (0.0ms)[0m begin transaction
|
6493
|
+
---------------------------------
|
6494
|
+
RoutesTest: test_translate_routes
|
6495
|
+
---------------------------------
|
6496
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
data/test/helpers_test.rb
CHANGED
@@ -2,15 +2,45 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class HelpersTest < ActionView::TestCase
|
4
4
|
|
5
|
-
test "
|
5
|
+
test "create helpers" do
|
6
6
|
I18n.available_locales.each do |locale|
|
7
7
|
I18n.locale = locale
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
assert_equal
|
13
|
-
|
8
|
+
assert_equal(
|
9
|
+
"/#{locale}/#{I18n.t('routes.namespace')}/#{I18n.t('routes.nested')}",
|
10
|
+
namespace_nested_path
|
11
|
+
)
|
12
|
+
assert_equal(
|
13
|
+
"/#{locale}/#{I18n.t('routes.namespace')}/#{I18n.t('routes.resources')}",
|
14
|
+
namespace_resources_path
|
15
|
+
)
|
16
|
+
assert_equal(
|
17
|
+
"/#{locale}/#{I18n.t('routes.namespace')}/#{I18n.t('routes.resources')}/#{I18n.t('routes.new')}",
|
18
|
+
new_namespace_resource_path
|
19
|
+
)
|
20
|
+
assert_equal(
|
21
|
+
"/#{locale}/#{I18n.t('routes.namespace')}/#{I18n.t('routes.resources')}/10/#{I18n.t('routes.edit')}",
|
22
|
+
edit_namespace_resource_path(10)
|
23
|
+
)
|
24
|
+
assert_equal(
|
25
|
+
"/#{locale}/#{I18n.t('routes.simple')}",
|
26
|
+
simple_path
|
27
|
+
)
|
28
|
+
assert_equal(
|
29
|
+
"/#{locale}/complex/1/2",
|
30
|
+
complex_path(1, 2)
|
31
|
+
)
|
32
|
+
assert_equal(
|
33
|
+
"/#{locale}/#{I18n.t('routes.resources')}",
|
34
|
+
resources_path
|
35
|
+
)
|
36
|
+
assert_equal(
|
37
|
+
"/#{locale}/#{I18n.t('routes.resources')}/#{I18n.t('routes.new')}",
|
38
|
+
new_resource_path
|
39
|
+
)
|
40
|
+
assert_equal(
|
41
|
+
"/#{locale}/#{I18n.t('routes.resources')}/10/#{I18n.t('routes.edit')}",
|
42
|
+
edit_resource_path(10)
|
43
|
+
)
|
14
44
|
end
|
15
45
|
end
|
16
46
|
|
data/test/routes_test.rb
CHANGED
@@ -2,35 +2,45 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class RoutesTest < ActionDispatch::IntegrationTest
|
4
4
|
|
5
|
-
test "
|
5
|
+
test "translate routes" do
|
6
6
|
I18n.available_locales.each do |locale|
|
7
7
|
I18n.locale = locale
|
8
|
-
|
9
8
|
assert_recognizes(
|
10
9
|
{ controller: 'namespace/pages', action: 'nested', locale: locale.to_s },
|
11
10
|
"/#{locale}/#{I18n.t('routes.namespace')}/#{I18n.t('routes.nested')}"
|
12
11
|
)
|
13
|
-
|
14
12
|
assert_recognizes(
|
15
13
|
{ controller: 'namespace/resources', action: 'index', locale: locale.to_s },
|
16
14
|
"/#{locale}/#{I18n.t('routes.namespace')}/#{I18n.t('routes.resources')}"
|
17
15
|
)
|
18
|
-
|
16
|
+
assert_recognizes(
|
17
|
+
{ controller: 'namespace/resources', action: 'new', locale: locale.to_s },
|
18
|
+
"/#{locale}/#{I18n.t('routes.namespace')}/#{I18n.t('routes.resources')}/#{I18n.t('routes.new')}"
|
19
|
+
)
|
20
|
+
assert_recognizes(
|
21
|
+
{ controller: 'namespace/resources', action: 'edit', locale: locale.to_s, id: '10' },
|
22
|
+
"/#{locale}/#{I18n.t('routes.namespace')}/#{I18n.t('routes.resources')}/10/#{I18n.t('routes.edit')}"
|
23
|
+
)
|
19
24
|
assert_recognizes(
|
20
25
|
{ controller: 'pages', action: 'simple', locale: locale.to_s },
|
21
26
|
"/#{locale}/#{I18n.t('routes.simple')}"
|
22
27
|
)
|
23
|
-
|
24
28
|
assert_recognizes(
|
25
29
|
{ controller: 'pages', action: 'complex', locale: locale.to_s, p1: '1', p2: '2' },
|
26
30
|
"/#{locale}/complex/1/2"
|
27
31
|
)
|
28
|
-
|
29
32
|
assert_recognizes(
|
30
33
|
{ controller: 'resources', action: 'index', locale: locale.to_s },
|
31
34
|
"/#{locale}/#{I18n.t('routes.resources')}"
|
32
35
|
)
|
33
|
-
|
36
|
+
assert_recognizes(
|
37
|
+
{ controller: 'resources', action: 'new', locale: locale.to_s },
|
38
|
+
"/#{locale}/#{I18n.t('routes.resources')}/#{I18n.t('routes.new')}"
|
39
|
+
)
|
40
|
+
assert_recognizes(
|
41
|
+
{ controller: 'resources', action: 'edit', locale: locale.to_s, id: '10' },
|
42
|
+
"/#{locale}/#{I18n.t('routes.resources')}/10/#{I18n.t('routes.edit')}"
|
43
|
+
)
|
34
44
|
end
|
35
45
|
end
|
36
46
|
|
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.3
|
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-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '1.3'
|
47
|
-
description: Minimalistic toolkit to translate routes.
|
47
|
+
description: Minimalistic toolkit to translate routes in rails.
|
48
48
|
email:
|
49
49
|
- contact@museways.com
|
50
50
|
executables: []
|
@@ -131,7 +131,7 @@ rubyforge_project:
|
|
131
131
|
rubygems_version: 2.2.2
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
|
-
summary: Translatable
|
134
|
+
summary: Translatable routes for rails.
|
135
135
|
test_files:
|
136
136
|
- test/dummy/app/assets/javascripts/application.js
|
137
137
|
- test/dummy/app/assets/stylesheets/application.css
|