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 keys reported incorrectly #117

Closed
rubydesign opened this issue Jan 2, 2015 · 5 comments
Closed

missing keys reported incorrectly #117

rubydesign opened this issue Jan 2, 2015 · 5 comments

Comments

@rubydesign
Copy link

Well, first off: great project.

In my app, i use translation keys that are defined in a gem (engine)
They get reported as missing, even they are not.
Off course i can work around that with the config, but i still feel it's a bug. In the sense that is reported missing but using the key will create a valid translation.

I would be happy to help with this, given a few pointers.

On another note: I have some code that did something quite similar though a web-api.
That was also very useful as we had domain experts translating.
Would you be interested in such a ui, i could port it to your (probably much better) base code.

@glebm
Copy link
Owner

glebm commented Jan 8, 2015

You can load the keys from a gem using the config! A web UI would be fantastic but it can live in a separate gem and use i18n-tasks.

@rubydesign
Copy link
Author

Ok, it's nice that i can do that, my point is more that i shouldn't have too.

So if i can use a key with I18n.t() and it doesn't return "translation missing" , then if i18n-tasks reports it as missing, that's a bug (imho)

On the ui front, would you be able/willing to work on that ? Maybe some time this year, not now.

@glebm
Copy link
Owner

glebm commented Jan 9, 2015

At the moment i18n-tasks only performs static analysis, i.e. it just scans the source code without evaluating it. An improvement to this would be to have a runtime scanner that runs the specs and collects results. I've started a new job last month that doesn't involve Ruby, so I am not actively contributing to this project, but I am here to provide guidance if anyone wants to do this. Issue #81 describes what I would do WRT to improving the scanner if I had time to work on this.

@rubydesign
Copy link
Author

That is a good direction, for sure.

But much much more than what i was talking about. I just meant to do I18n.translate(key) in the rails environment (all locales loaded, also gems) and see if it returns "translation missing".

That i could manage i think, the #81 is too much for me too.

I just have all keys listed as used in the config at the moment (about 30-50) which seems a little silly.

@glebm
Copy link
Owner

glebm commented Jan 10, 2015

Instead of listing the keys, this is a bit better:

data:
  read:
    - "<%= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml"

@glebm glebm closed this as completed Jul 2, 2015
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