Skip to content

Commit

Permalink
Change long-lived structs to classes
Browse files Browse the repository at this point in the history
  • Loading branch information
akadusei committed Feb 16, 2025
1 parent d839c96 commit 4159b84
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions config/i18n.cr
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Rex.configure do |settings|
settings.adapter = Adapter.new
end

I18n.config.loaders << I18n::Loader::YAML.new("lang")
I18n.config.default_locale = :en
I18n.init

private struct I18nAdapter
private class Adapter
include Rex::Adapter

def translate(text : String | Symbol, **named_args) : String
Expand All @@ -15,7 +19,3 @@ private struct I18nAdapter
I18n.l(value, *args)
end
end

Rex.configure do |settings|
settings.adapter = I18nAdapter.new
end

0 comments on commit 4159b84

Please sign in to comment.