Replies: 1 comment 1 reply
-
I would guess config/application.rb, too. Have you tried it to see if it
works as expected?
…On Thu, Jun 2, 2022 at 4:58 PM andrew nimmo ***@***.***> wrote:
According to the I18n gem itself, it's easy to set up
<https://github.com/ruby-i18n/i18n/blob/master/lib/i18n/backend/cache.rb>.
We'd need to have ActiveSupport::Cache
<https://guides.rubyonrails.org/caching_with_rails.html> set up. But
fragment caching, in Rails, may be on in production by default.
Anyway, sounds like the scope of a different PR. But it sounds like it
could be worth it, according to gem authors.
Here's what the gem has to say:
# This module allows you to easily cache all responses from the backend - thus
# speeding up the I18n aspects of your application quite a bit.
#
# To enable caching you can simply include the Cache module to the Simple
# backend - or whatever other backend you are using:
#
# I18n::Backend::Simple.send(:include, I18n::Backend::Cache)
#
# You will also need to set a cache store implementation that you want to use:
#
# I18n.cache_store = ActiveSupport::Cache.lookup_store(:memory_store)
# ...continued...
...where would these lines go? In config/application.rb?
(The other reference
<https://lingohub.com/blog/2013/08/i18n-gem-advanced-features-ruby-rails-internationalization>
I found is equally vague about where the config goes.)
—
Reply to this email directly, view it on GitHub
<#979>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYTNNIN4R2O5S2KRVPQF5TVNEOADANCNFSM5XWGXJJQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
According to the
I18n
gem itself, it's easy to set up.We'd need to have ActiveSupport::Cache set up. ("Fragment caching", in Rails, may be on in production by default.) Anyway, it sounds like it could be worth setting up, according to gem authors.
Here's what the gem has to say:
...where would these lines go? In
config/application.rb
?(The other reference I found is equally vague about where the config goes.)
Beta Was this translation helpful? Give feedback.
All reactions