Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change makes the call to "MyApp::Application.routes.translate_from_file" unnecessary. It's still possible to call this function for backwards compatibility. It also adds a new config option, "translation_file", which can be used instead of the call to "translate_from_file" to change the default translation file.
- Loading branch information
1 parent
3605d2c
commit 6cd300f
Showing
12 changed files
with
156 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
guard :test do | ||
watch(%r{^lib/(.+)\.rb$}) { |m| "test/route_translator_test.rb" } | ||
watch(%r{^test/.+_test\.rb$}) | ||
watch('test/test_helper.rb') { "test" } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require "rails" | ||
|
||
module Rails | ||
class Application | ||
class RoutesReloader | ||
alias :__reload__! :reload! | ||
|
||
def reload! | ||
result = __reload__! | ||
|
||
route_sets.each do |routes| | ||
routes.default_locale = I18n.default_locale | ||
routes.translate_from_file | ||
end | ||
|
||
result | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module ActionDispatch | ||
class TestRequest < Request | ||
def initialize(env = {}) | ||
env = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application | ||
super(DEFAULT_ENV.merge(env)) | ||
|
||
self.host = 'test.host' | ||
self.remote_addr = '0.0.0.0' | ||
self.user_agent = 'Rails Testing' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters