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

missing translations #1

Closed
davearonson opened this issue Jun 26, 2013 · 9 comments
Closed

missing translations #1

davearonson opened this issue Jun 26, 2013 · 9 comments

Comments

@davearonson
Copy link
Contributor

There are a couple places where you do t('some_string'), i.e., request a translation from the I18n module. They are in lib/ripple_searchable/criteria.rb, lines 212 ('empty_selector_error') and 328 ('failed_query'). Both of these fail, with a "translation missing" message substituted. None of the other gems I happen to have installed, provide a translation for those. There are no .yml files in this project, meant to hold translations. There are no other mentions of these strings, such that maybe you're using a different mechanism.

Did you simply forget to include the .yml files, or am I missing some gem that was left out of the dependencies, or what?

@computadude
Copy link
Owner

Hmm, are you using it in a rails project?

@davearonson
Copy link
Contributor Author

Yes, I'm setting up a little "spike" to try to get Ripple to play nicely with Devise (working, with some kluges), CanCan (pretty much drop-in), and some kind of admin panel. (Gave up on ActiveAdmin, and now trying RailsAdmin.) That's where I apparently really need ripple_searchable, to provide the scopes and such that RailsAdmin depends on.

Maybe I missed some piece of setup that creates the en.yml files?

Maybe it's supposed to be supplied by Solr, which some parts of ripple_searchable seem to need?

Thanks,
Dave

@computadude
Copy link
Owner

It's probably missing lib/config/en.yml

@davearonson
Copy link
Contributor Author

From ripple_searchable, or some other gem? I don't see such a file in ripple_searchable. If it's supposed to be in there, can you please push it up to Github? I'll just copy it in manually, while the next version of the gem makes its way into the infrastructure.

Thanks,
Dave

@computadude
Copy link
Owner

I have un-commited changes in master, could you add the missing yml file as a pull request and I'll merge it in?

@davearonson
Copy link
Contributor Author

I'll try to get to it tomorrow, gonna call it a day for now. (Yes, this is for work.)

@davearonson
Copy link
Contributor Author

I'm having some problems getting the translations picked up.

If I put them in the en.yml of the app, it works fine... but if I just put them in lib/config/en.yml that doesn't work, nor does config/locales/en.yml nor lib/ripple_searchable/locale/en.yml, those being other common places I have seen for gems' translations. I figured this was probably the sort of thing where Ruby or Rails might have some standard convention for slurping up files put in some magic path, but either I haven't found the right path, or I18n needs to be told specifically where to find it (by adding the dir to the loadpath or some such means).

Have you internationalized a gem before? How is it supposed to work? I've tried Googling, but that just gives me results about gems for use in internationalization, not internationalizing a gem.

Thanks,
Dave

@computadude
Copy link
Owner

After you've placed the yml file(s) into lib/config/locales/, you also have to add it (them) to I18n's load path (in lib/ripple_searchable.rb):

I18n.load_path << File.join(File.dirname(__FILE__), "config", "locales", "en.yml")

@davearonson
Copy link
Contributor Author

That's what I figured, just didn't want to contradict any established convention I was unaware of. Incoming! ;-)

computadude added a commit that referenced this issue Jun 28, 2013
Add missing translations (closes issue #1)
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