-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace use of ::I18n.locale with context.locale
This change makes the locale setting thread-safe. The right way to use it is to pass "force_locale: context.locale" or to pass context.locale as third argument to I18n's translate() and locale() methods. Also, remove last remaining pieces of dependence on Amber, since the shard is generic.
- Loading branch information
Showing
3 changed files
with
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
require "amber" | ||
require "http/server/handler" | ||
require "i18n" | ||
require "./citrine-i18n/parser" | ||
require "./citrine-i18n/handler" | ||
|
||
class HTTP::Server::Context | ||
property locale : String = "en" | ||
end | ||
|
||
module Citrine::I18n | ||
def self.configure | ||
yield ::I18n.config | ||
end | ||
def self.configure | ||
yield ::I18n.config | ||
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