Skip to content

Commit

Permalink
autodetect language using rack middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Jul 2, 2023
1 parent a81eff5 commit e22ed89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ gem "lograge", "~> 0.12.0"
gem "sqlite3_ar_regexp", "~> 2.2"

gem "mittsu", github: "danini-the-panini/mittsu", ref: "7f44c46"

gem "rack-contrib", "~> 2.3"
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ GEM
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.7)
rack-contrib (2.3.0)
rack (~> 2.0)
rack-mini-profiler (3.1.0)
rack (>= 1.2.0)
rack-test (2.1.0)
Expand Down Expand Up @@ -497,6 +499,7 @@ DEPENDENCIES
pg (~> 1.5)
public_suffix (~> 5.0)
puma (~> 6.3)
rack-contrib (~> 2.3)
rack-mini-profiler (~> 3.1)
rails (~> 7.0.6)
rails-settings-cached (~> 2.9)
Expand Down
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require_relative "boot"

require "rails/all"
require "rack/contrib"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Expand All @@ -21,5 +22,7 @@ class Application < Rails::Application

# Don't generate system test files.
config.generators.system_tests = nil

config.middleware.use Rack::Locale
end
end

0 comments on commit e22ed89

Please sign in to comment.