Skip to content

Commit ba7e63a

Browse files
committed
Merge pull request activeadmin#1775 from caifara/1775-override-i18n-translations
Impossible to override I18n translations
2 parents c01a361 + c063150 commit ba7e63a

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

features/i18n.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,10 @@ Feature: Internationalization
3333
And I go to the dashboard
3434
Then I should see "Bookstore"
3535
Then I should see "Logout"
36+
37+
Scenario: Overriding translations
38+
Given I am logged in
39+
And a store named "Hello words" exists
40+
When I go to the dashboard
41+
When I follow "Bookstores"
42+
Then I should see "Download this:"

lib/active_admin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Railtie < ::Rails::Railtie
5353
config.after_initialize do
5454
# Add load paths straight to I18n, so engines and application can overwrite it.
5555
require 'active_support/i18n'
56-
I18n.load_path += Dir[File.expand_path('../active_admin/locales/*.yml', __FILE__)]
56+
I18n.load_path.unshift *Dir[File.expand_path('../active_admin/locales/*.yml', __FILE__)]
5757
end
5858
end
5959

spec/support/templates/en.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
store:
55
one: Bookstore
66
other: Bookstores
7+
active_admin:
8+
download: "Download this:"

0 commit comments

Comments
 (0)