-
Notifications
You must be signed in to change notification settings - Fork 264
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
Using scope in rails views is broken #224
Comments
Wow, that was fast! 💃 I don't know if it helps, but it looks like replacing it by: |
Good catch! Fixed and released v0.9.10 🚢 |
Hi @glebm! Thanks for such a quick fix! There's still some scenarios where this is failing though. For example, I have this in my views: <%= t "actions.manage", scope: "app.admin" %> This should resolve to I tried to run the test suite and fix it but couldn't manage to. |
@josepjaume I tried to reproduce it but I can't. Are you sure you are on v0.9.10? What's in your config? What is the exact line with the usage? |
@glebm of course! Actually, the project is open-source, so you can check it out yourself :). The i18n call in the view is at: The translation is found here: Take into account that we've structured the project into engines, so the configuration is found at: Thanks so much for your help! |
Fix released in v0.9.11 🚢 |
Awesome news! Thanks!! <3 |
Hi again! I'm sorry to be such a hassle, but there's still some instances where this is failing, although most of them got fixed. This one is also reporting as missing: We can work against a branch if you'd like, and keep iterating until they're all fixed :) I tried to do this myself but to be honest I'm having a hard time understanding the internals :S |
The nested calls are difficult to get to work with the current regexp parser that's used in the views. The best thing you can do is move this to a helper, then the AST parser will parse them correctly. |
ok @glebm, thanks so much! |
@josepjaume I've managed to fix the nested calls case as well but any further work should be done towards adding AST scanner support for various view formats. The regex hack is at its limits at this point. |
Thanks @glebm! I can see how using regexp has its limits - been there with https://github.com/codegram/spinach and ended up writing a language parser. Let me confirm it works and maybe you can release a new minor? |
Confirmed! It chased all my use cases 💪 . Thanks so much! |
First of all, thanks for the good amount of work you've put in this gem. It works like a charm! It's definitely made my life easier :)
Since the
0.9.9
update, I'm experiencing issues when usingscope
in translations in my rails views.Example:
This resolves to
specific.layouts.application.title
but while0.9.8
works fine and picks it up,0.9.9
doesn't detect it and my locales now show up asunused
.Is there anything I should take into account?
The text was updated successfully, but these errors were encountered: