Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Support for I18n #137

Open
sshaw opened this issue Jul 29, 2015 · 1 comment
Open

Better Support for I18n #137

sshaw opened this issue Jul 29, 2015 · 1 comment

Comments

@sshaw
Copy link

sshaw commented Jul 29, 2015

Using _() (and others) are preferable to I18n.t as you don't have to explicitly set the separator. Currently these methods are provided via FastGettext's helpers, which are included globally.

The problem is these helpers do not really interact with I18n. So if have something like:

# I18n.backend is set to GettextI18nRails::Backend via this gem
I18n.backend = I18n::Backend::Chain.new(I18n::Backend::KeyValue.new($redis), I18n.backend)

One must say:

I18n.t text, :separator => "|"

To take advantage of the chain.

Instead of including FastGettext::Translation, why not include I18n::Gettext::Helpers instead? Then _() will work out the box for situations like the above.

@grosser
Copy link
Owner

grosser commented Jul 29, 2015

sounds interesting ... if you get the example app running with this / add this new behavior as testcase I think it would be an easy switch ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants